From ed3d86c9a9d90f2e381c23f5c95391dbe185bc85 Mon Sep 17 00:00:00 2001 From: Chris Lalancette Date: Wed, 10 Mar 2010 13:22:02 -0500 Subject: [PATCH] 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 --- src/qemu/qemu_monitor_json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);