From: Chris Lalancette Date: Wed, 10 Mar 2010 18:22:02 +0000 (-0500) Subject: Fix a JSON CPU information bug. X-Git-Tag: v0.8.0~311 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed3d86c9a9d90f2e381c23f5c95391dbe185bc85;p=thirdparty%2Flibvirt.git Fix a JSON CPU information bug. 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 " work when using the JSON monitor. Signed-off-by: Chris Lalancette --- diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index f04fd2eb5a..7a263cb664 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -648,7 +648,7 @@ qemuMonitorJSONExtractCPUInfo(virJSONValuePtr reply, *pids = threads; threads = NULL; - ret = 0; + ret = ncpus; cleanup: VIR_FREE(threads);