Hi,
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().
Here is the patch, please comment!
Signed-off-by: tangchen <tangchen(a)cn.fujitsu.com>
---
src/qemu/qemu_driver.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 2e6f3e4..a564afb 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -4480,6 +4480,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;
@@ -4577,11 +4578,15 @@ static char *qemuDomainXMLToNative(virConnectPtr conn,
&qemuCaps) < 0)
goto cleanup;
+#ifdef HAVE_YAJL
+ monitor_json = qemuCapsGet(qemuCaps, QEMU_CAPS_MONITOR_JSON);
+#endif
+
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;
-- 1.7.3.1
--
Best Regards,
Tang chen