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

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

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 redhat com>

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);

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