[PATCH 6/9] qemuMonitorJSONAttachCharDev: Teach spicevmc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 src/qemu/qemu_monitor_json.c | 7 +++++++
 tests/qemumonitorjsontest.c  | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 12d2e22..380ddab 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -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:
diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c
index 2cd824f..0bcf62a 100644
--- a/tests/qemumonitorjsontest.c
+++ b/tests/qemumonitorjsontest.c
@@ -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\": {}}");
-- 
2.8.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]