]> xenbits.xensource.com Git - libvirt.git/commitdiff
Fix handling of cpumaps arg to virDomainGetVcpus RPC dispatcher
authorDaniel P. Berrange <berrange@redhat.com>
Mon, 16 Mar 2009 10:33:01 +0000 (10:33 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Mon, 16 Mar 2009 10:33:01 +0000 (10:33 +0000)
ChangeLog
qemud/remote.c

index 48d4f8fbbee2e13253f8c65205647f3eb13d00f0..102318ee7db90a24a60c962e8e16e648e9523333 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Mar 16 10:30:00 GMT 2009 Daniel P. Berrange <berrange@redhat.com>
+
+       * qemud/remote.c: Don't allocate cpumaps arg if maplength is
+       0, and fix size of cpumaps allocation
+
 Mon Mar 16 10:30:00 GMT 2009 Daniel P. Berrange <berrange@redhat.com>
 
        * src/storage_driver.c: Don't free storage volume in error
index 8eaa7d66d861568a4a0afb62e458c31a473e93bb..44a274ab30569bab2cd7aaf3e5a03521a115067a 100644 (file)
@@ -1475,7 +1475,8 @@ remoteDispatchDomainGetVcpus (struct qemud_server *server ATTRIBUTE_UNUSED,
     /* Allocate buffers to take the results. */
     if (VIR_ALLOC_N(info, args->maxinfo) < 0)
         goto oom;
-    if (VIR_ALLOC_N(cpumaps, args->maxinfo) < 0)
+    if (args->maplen > 0 &&
+        VIR_ALLOC_N(cpumaps, args->maxinfo * args->maplen) < 0)
         goto oom;
 
     info_len = virDomainGetVcpus (dom,