render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
Daniel P. Berrange 511f6c
From: Daniel P. Berrange <berrange@redhat.com>
Daniel P. Berrange 511f6c
Date: Mon, 16 Mar 2009 10:33:01 +0000 (+0000)
Daniel P. Berrange 511f6c
Subject: Fix handling of cpumaps arg to virDomainGetVcpus RPC dispatcher
Daniel P. Berrange 511f6c
X-Git-Url: http://git.et.redhat.com/?p=libvirt.git;a=commitdiff_plain;h=2d75d954f52a740470f85ceece4eb995d79968ca
Daniel P. Berrange 511f6c
Daniel P. Berrange 511f6c
Fix handling of cpumaps arg to virDomainGetVcpus RPC dispatcher
Daniel P. Berrange 511f6c
---
Daniel P. Berrange 511f6c
Daniel P. Berrange 511f6c
diff --git a/qemud/remote.c b/qemud/remote.c
Daniel P. Berrange 511f6c
index 8eaa7d6..44a274a 100644
Daniel P. Berrange 511f6c
--- a/qemud/remote.c
Daniel P. Berrange 511f6c
+++ b/qemud/remote.c
Daniel P. Berrange 511f6c
@@ -1475,7 +1475,8 @@ remoteDispatchDomainGetVcpus (struct qemud_server *server ATTRIBUTE_UNUSED,
Daniel P. Berrange 511f6c
     /* Allocate buffers to take the results. */
Daniel P. Berrange 511f6c
     if (VIR_ALLOC_N(info, args->maxinfo) < 0)
Daniel P. Berrange 511f6c
         goto oom;
Daniel P. Berrange 511f6c
-    if (VIR_ALLOC_N(cpumaps, args->maxinfo) < 0)
Daniel P. Berrange 511f6c
+    if (args->maplen > 0 &&
Daniel P. Berrange 511f6c
+        VIR_ALLOC_N(cpumaps, args->maxinfo * args->maplen) < 0)
Daniel P. Berrange 511f6c
         goto oom;
Daniel P. Berrange 511f6c
 
Daniel P. Berrange 511f6c
     info_len = virDomainGetVcpus (dom,