]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
Fix a JSON CPU information bug.
authorChris Lalancette <clalance@redhat.com>
Wed, 10 Mar 2010 18:22:02 +0000 (13:22 -0500)
committerChris Lalancette <clalance@redhat.com>
Thu, 11 Mar 2010 15:39:18 +0000 (10:39 -0500)
When using the JSON monitor, qemuMonitorJSONExtractCPUInfo
was returning 0 on success.  Unfortunately, higher levels of
the cpuinfo code expect that it returns the number of CPUs
it found on success.  This one-line patch fixes it so that
it returns the correct number.  This makes "virsh vcpuinfo <domain>"
work when using the JSON monitor.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
src/qemu/qemu_monitor_json.c

index f04fd2eb5a813dd3903b53aec1ecb2a0d470f143..7a263cb664600e0f59e94c3746f8ff77022d1672 100644 (file)
@@ -648,7 +648,7 @@ qemuMonitorJSONExtractCPUInfo(virJSONValuePtr reply,
 
     *pids = threads;
     threads = NULL;
-    ret = 0;
+    ret = ncpus;
 
 cleanup:
     VIR_FREE(threads);