]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemuMonitorJSONAttachCharDev: Teach spicevmc
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 8 Jun 2016 13:51:27 +0000 (15:51 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 10 Jun 2016 13:22:07 +0000 (15:22 +0200)
https://bugzilla.redhat.com/show_bug.cgi?id=1298070

We have the code for attaching redirdevs for ages now.
Unfortunately, our monitor code that handles talking to the qemu
process was missing a little piece of code that actually enabled
the feature.

BTW: it really is called "type" on the monitor, even though it's
called "name" on the cmd line. Don't ask.

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

index 12d2e2240e86f745121f3fe501e38185463802c8..380ddabf5e6822fbbbfd599b04cfaa5b6bdb1bb1 100644 (file)
@@ -6209,6 +6209,13 @@ qemuMonitorJSONAttachCharDevCommand(const char *chrID,
         break;
 
     case VIR_DOMAIN_CHR_TYPE_SPICEVMC:
+        backend_type = "spicevmc";
+
+        if (virJSONValueObjectAppendString(data, "type",
+                                           virDomainChrSpicevmcTypeToString(chr->data.spicevmc)) < 0)
+            goto error;
+        break;
+
     case VIR_DOMAIN_CHR_TYPE_SPICEPORT:
     case VIR_DOMAIN_CHR_TYPE_PIPE:
     case VIR_DOMAIN_CHR_TYPE_STDIO:
index 2cd824f8e972cfdfd1eb7f7db1eabeac47216248..0bcf62a4253348fa41451951fc219cbf65268bd1 100644 (file)
@@ -769,7 +769,7 @@ testQemuMonitorJSONAttachChardev(const void *data)
     CHECK("chr_unix", "{\"return\": {}}");
 
     chr = (virDomainChrSourceDef) { .type = VIR_DOMAIN_CHR_TYPE_SPICEVMC };
-    CHECK_FAIL("chr_spicevmc", "{\"return\": {}}");
+    CHECK("chr_spicevmc", "{\"return\": {}}");
 
     chr = (virDomainChrSourceDef) { .type = VIR_DOMAIN_CHR_TYPE_PIPE };
     CHECK_FAIL("chr_pipe", "{\"return\": {}}");