[PATCH] qemu: Don't fail qemuProcessAttach for IOThreads if no JSON

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

 



While doing some investigation for another bug I found that I could
not qemu-attach to the process and got the following:

   error: Operation not supported: JSON monitor is required

while running thru qemuProcessAttach. Since we can only get the data
using the JSON parser and if the guest to be attached to doesn't have
it we shouldn't just fail. See example in virsh qemu-attach for sample
command that failed.

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---

I also considered removing the call from qemuProcessAttach rather than
this approach.

 src/qemu/qemu_monitor.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
index 8927dbb..4342088 100644
--- a/src/qemu/qemu_monitor.c
+++ b/src/qemu/qemu_monitor.c
@@ -4112,11 +4112,9 @@ qemuMonitorGetIOThreads(qemuMonitorPtr mon,
         return -1;
     }
 
-    if (!mon->json) {
-        virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
-                       _("JSON monitor is required"));
-        return -1;
-    }
+    /* Requires JSON to make the query */
+    if (!mon->json)
+        return 0;
 
     return qemuMonitorJSONGetIOThreads(mon, iothreads);
 }
-- 
1.9.3

--
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]