]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu_monitor_json: fix JSON generator for VC chardev
authorPavel Hrdina <phrdina@redhat.com>
Mon, 1 Feb 2021 10:59:48 +0000 (11:59 +0100)
committerPavel Hrdina <phrdina@redhat.com>
Thu, 4 Feb 2021 12:07:02 +0000 (13:07 +0100)
The correct backend type is 'vc', same as in qemuBuildChrChardevStr()
where we generate qemu command line.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_monitor_json.c
tests/qemumonitorjsontest.c

index 97c5e5b36cee0fc3defa50af66051e69a4186153..231f0ded32c1a9807f9f5ed5ba2424f347331f33 100644 (file)
@@ -7438,10 +7438,13 @@ qemuMonitorJSONAttachCharDevCommand(const char *chrID,
 
     switch ((virDomainChrType)chr->type) {
     case VIR_DOMAIN_CHR_TYPE_NULL:
-    case VIR_DOMAIN_CHR_TYPE_VC:
         backend_type = "null";
         break;
 
+    case VIR_DOMAIN_CHR_TYPE_VC:
+        backend_type = "vc";
+        break;
+
     case VIR_DOMAIN_CHR_TYPE_PTY:
         backend_type = "pty";
         break;
index 29c396891b40d3dde546bb0515e2f1628dbb5903..956423f10fbe2da1702f8db07be51a0591ea2205 100644 (file)
@@ -718,7 +718,7 @@ qemuMonitorJSONTestAttachChardev(virDomainXMLOptionPtr xmlopt,
 
     chr = (virDomainChrSourceDef) { .type = VIR_DOMAIN_CHR_TYPE_VC };
     CHECK("vc", false,
-          "{'id':'alias','backend':{'type':'null','data':{}}}");
+          "{'id':'alias','backend':{'type':'vc','data':{}}}");
 
     chr = (virDomainChrSourceDef) { .type = VIR_DOMAIN_CHR_TYPE_PTY };
     if (qemuMonitorJSONTestAttachOneChardev(xmlopt, schema, "pty", &chr,