[Libvir] [PATCH] Fix Xen-3.2 hypercalls

While testing against Xen-3.2 I found out that the Xen hypercalls failed, this patches fixes it by checking the newer sysctl versions when initializing the driver. I also merged the associated debugging with the DEBUG from libvirt.c, to allow easier debugging of this issue. Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

On Thu, Feb 28, 2008 at 06:22:35AM -0500, Daniel Veillard wrote:
While testing against Xen-3.2 I found out that the Xen hypercalls failed, this patches fixes it by checking the newer sysctl versions when initializing the driver. I also merged the associated debugging with the DEBUG from libvirt.c, to allow easier debugging of this issue.
It's a bit tricky to understand this patch just by looking at it. After removing all the debug changes I get down to this:
sys_interface_version = 4; /* XEN_SYSCTL_INTERFACE_VERSION */ if (virXen_getdomaininfo(fd, 0, &info) == 1) { - /* xen-unstable */ + /* Fedora 8 */ dom_interface_version = 5; /* XEN_DOMCTL_INTERFACE_VERSION */ if (virXen_getvcpusinfo(fd, 0, 0, ipt, NULL, 0) == 0){ -#ifdef DEBUG - fprintf(stderr, "Using hypervisor call v2, sys ver4 dom ver5\n"); -#endif + DEBUG0("Using hypervisor call v2, sys ver4 dom ver5\n"); + goto done; + } + } + + sys_interface_version = 6; /* XEN_SYSCTL_INTERFACE_VERSION */ + if (virXen_getdomaininfo(fd, 0, &info) == 1) { + /* Xen 3.2, Fedora 9 */ + dom_interface_version = 5; /* XEN_DOMCTL_INTERFACE_VERSION */ + if (virXen_getvcpusinfo(fd, 0, 0, ipt, NULL, 0) == 0){ + DEBUG0("Using hypervisor call v2, sys ver6 dom ver5\n"); goto done; } }
The only change is to pass 6 to op->interface_version in the ioctl? Anyway, if it makes Xen 3.2 work, +1. I'm still fixing my Rawhide box at the moment, so can't test this ... Rich. -- Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://et.redhat.com/~rjones/virt-top

"Richard W.M. Jones" <rjones@redhat.com> wrote:
On Thu, Feb 28, 2008 at 06:22:35AM -0500, Daniel Veillard wrote:
While testing against Xen-3.2 I found out that the Xen hypercalls failed, this patches fixes it by checking the newer sysctl versions when initializing the driver. I also merged the associated debugging with the DEBUG from libvirt.c, to allow easier debugging of this issue.
It's a bit tricky to understand this patch just by looking at it. After removing all the debug changes I get down to this:
sys_interface_version = 4; /* XEN_SYSCTL_INTERFACE_VERSION */ if (virXen_getdomaininfo(fd, 0, &info) == 1) { - /* xen-unstable */ + /* Fedora 8 */ dom_interface_version = 5; /* XEN_DOMCTL_INTERFACE_VERSION */ if (virXen_getvcpusinfo(fd, 0, 0, ipt, NULL, 0) == 0){ -#ifdef DEBUG - fprintf(stderr, "Using hypervisor call v2, sys ver4 dom ver5\n"); -#endif + DEBUG0("Using hypervisor call v2, sys ver4 dom ver5\n"); + goto done; + } + } + + sys_interface_version = 6; /* XEN_SYSCTL_INTERFACE_VERSION */ + if (virXen_getdomaininfo(fd, 0, &info) == 1) { + /* Xen 3.2, Fedora 9 */ + dom_interface_version = 5; /* XEN_DOMCTL_INTERFACE_VERSION */ + if (virXen_getvcpusinfo(fd, 0, 0, ipt, NULL, 0) == 0){ + DEBUG0("Using hypervisor call v2, sys ver6 dom ver5\n"); goto done; } }
The only change is to pass 6 to op->interface_version in the ioctl?
Anyway, if it makes Xen 3.2 work, +1. I'm still fixing my Rawhide box at the moment, so can't test this ...
Same here. ACK.

On Thu, Feb 28, 2008 at 01:52:00PM +0100, Jim Meyering wrote:
"Richard W.M. Jones" <rjones@redhat.com> wrote:
On Thu, Feb 28, 2008 at 06:22:35AM -0500, Daniel Veillard wrote:
While testing against Xen-3.2 I found out that the Xen hypercalls failed, this patches fixes it by checking the newer sysctl versions when initializing the driver. I also merged the associated debugging with the DEBUG from libvirt.c, to allow easier debugging of this issue.
It's a bit tricky to understand this patch just by looking at it. After removing all the debug changes I get down to this:
sys_interface_version = 4; /* XEN_SYSCTL_INTERFACE_VERSION */ if (virXen_getdomaininfo(fd, 0, &info) == 1) { - /* xen-unstable */ + /* Fedora 8 */ dom_interface_version = 5; /* XEN_DOMCTL_INTERFACE_VERSION */ if (virXen_getvcpusinfo(fd, 0, 0, ipt, NULL, 0) == 0){ -#ifdef DEBUG - fprintf(stderr, "Using hypervisor call v2, sys ver4 dom ver5\n"); -#endif + DEBUG0("Using hypervisor call v2, sys ver4 dom ver5\n"); + goto done; + } + } + + sys_interface_version = 6; /* XEN_SYSCTL_INTERFACE_VERSION */ + if (virXen_getdomaininfo(fd, 0, &info) == 1) { + /* Xen 3.2, Fedora 9 */ + dom_interface_version = 5; /* XEN_DOMCTL_INTERFACE_VERSION */ + if (virXen_getvcpusinfo(fd, 0, 0, ipt, NULL, 0) == 0){ + DEBUG0("Using hypervisor call v2, sys ver6 dom ver5\n"); goto done; } }
The only change is to pass 6 to op->interface_version in the ioctl?
yes, add this as a new option in the hypercall sequence trial.
Anyway, if it makes Xen 3.2 work, +1. I'm still fixing my Rawhide box at the moment, so can't test this ...
Same here.
Well this can't break anything working :-) Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

DV> this patches fixes it by checking the newer sysctl versions when DV> initializing the driver. This fixes my problem on Xen 3.2. Thanks! -- Dan Smith IBM Linux Technology Center Open Hypervisor Team email: danms@us.ibm.com

On Thu, Feb 28, 2008 at 06:22:35AM -0500, Daniel Veillard wrote:
While testing against Xen-3.2 I found out that the Xen hypercalls failed, this patches fixes it by checking the newer sysctl versions when initializing the driver. I also merged the associated debugging with the DEBUG from libvirt.c, to allow easier debugging of this issue.
Oops apparently i had forgotten to commit it, it's in CVs now, Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
participants (4)
-
Dan Smith
-
Daniel Veillard
-
Jim Meyering
-
Richard W.M. Jones