]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: allow json in domxml-to-native
authortangchen <tangchen@cn.fujitsu.com>
Thu, 20 Oct 2011 10:37:52 +0000 (18:37 +0800)
committerEric Blake <eblake@redhat.com>
Thu, 20 Oct 2011 20:30:48 +0000 (14:30 -0600)
There is a little difference between the output of domxml-to-native and the actual commandline.
No matter qemu is in control or readline mode, domxml-to-native always converts it to readline mode.

That is because the parameter "monitor_json" for qemuBuildCommandLine() is always set to false
in qemuDomainXMLToNative().

Signed-off-by: tangchen <tangchen@cn.fujitsu.com>
src/qemu/qemu_driver.c

index 84ef4dd0782b04940a2eaa4f97ced855d2e92eb7..0a0a34ac7b16882da24bf82b11455bdf9f2fb2b4 100644 (file)
@@ -4511,6 +4511,7 @@ static char *qemuDomainXMLToNative(virConnectPtr conn,
     virDomainDefPtr def = NULL;
     virDomainChrSourceDef monConfig;
     virBitmapPtr qemuCaps = NULL;
+    bool monitor_json = false;
     virCommandPtr cmd = NULL;
     char *ret = NULL;
     int i;
@@ -4608,11 +4609,13 @@ static char *qemuDomainXMLToNative(virConnectPtr conn,
                                    &qemuCaps) < 0)
         goto cleanup;
 
+    monitor_json = qemuCapsGet(qemuCaps, QEMU_CAPS_MONITOR_JSON);
+
     if (qemuProcessPrepareMonitorChr(driver, &monConfig, def->name) < 0)
         goto cleanup;
 
     if (!(cmd = qemuBuildCommandLine(conn, driver, def,
-                                     &monConfig, false, qemuCaps,
+                                     &monConfig, monitor_json, qemuCaps,
                                      NULL, -1, NULL, VIR_VM_OP_NO_OP)))
         goto cleanup;