]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
* src/libvir.c src/xen_internal.c: fixed the new Xen hypervisor call
authorDaniel Veillard <veillard@redhat.com>
Thu, 8 Dec 2005 10:12:18 +0000 (10:12 +0000)
committerDaniel Veillard <veillard@redhat.com>
Thu, 8 Dec 2005 10:12:18 +0000 (10:12 +0000)
Daniel

ChangeLog
src/libvir.c
src/xen_internal.c

index 072344ddfcd0b2539e76dc5cb1a45ee04eb5313c..2b5dac79e5e1cac36c9710fbed01eb605d2f6d63 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Thu Dec  8 11:12:36 CET 2005 Daniel Veillard <veillard@redhat.com>
+
+       * src/libvir.c src/xen_internal.c: fixed the new Xen hypervisor call
+
 Wed Dec  7 19:09:48 CET 2005 Daniel Veillard <veillard@redhat.com>
 
        * configure.in src/Makefile.am src/libvir.c src/xen_internal.c
index 0fef72975b7c63cf2e4ddd6a50d97fc4af3b7e61..52c82fbcd70d0b3efbfd55ff46d8b5a661880a57 100644 (file)
@@ -636,7 +636,7 @@ virDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info) {
        dominfo.domain = domain->handle;
         ret = xenHypervisorGetDomainInfo(domain->conn->handle, domain->handle,
                                         &dominfo);
-        if (ret <= 0)
+        if (ret < 0)
            return(-1);
        switch (dominfo.flags & 0xFF) {
            case DOMFLAGS_DYING:
index dc79a5183244294e68bdc0ee55c9e56d6a22d817..0eb49b6dda57a6bb8658e4060da9cdd9d50f664a 100644 (file)
@@ -84,6 +84,7 @@ int xenHypervisorClose(int handle) {
 static int
 xenHypervisorDoOp(int handle, dom0_op_t *op) {
     int ret;
+    unsigned int cmd;
     hypercall_t hc;
 
     op->interface_version = DOM0_INTERFACE_VERSION;
@@ -93,8 +94,8 @@ xenHypervisorDoOp(int handle, dom0_op_t *op) {
     if (mlock(op, sizeof(dom0_op_t)) < 0)
         return(-1);
 
-    ret = ioctl(handle, _IOC(_IOC_NONE, 'P', 0, sizeof(hypercall_t)),
-                             (unsigned long) &hc);
+    cmd = _IOC(_IOC_NONE, 'P', 0, sizeof(hc));
+    ret = ioctl(handle, cmd, (unsigned long) &hc);
 
     if (munlock(op, sizeof(dom0_op_t)) < 0)
         ret = -1;
@@ -132,13 +133,15 @@ xenHypervisorGetDomainInfo(int handle, int domain, dom0_getdomaininfo_t *info) {
     op.u.getdomaininfolist.first_domain = (domid_t) domain;
     op.u.getdomaininfolist.max_domains = 1;
     op.u.getdomaininfolist.buffer = info;
+    op.u.getdomaininfolist.num_domains = 1;
+    info->domain = domain;
 
     ret = xenHypervisorDoOp(handle, &op);
 
     if (munlock(info, sizeof(dom0_getdomaininfo_t)) < 0)
         ret = -1;
 
-    if (ret <= 0)
+    if (ret < 0)
         return(-1);
     return(0);
 }