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

Re: [libvirt] [PATCH 02/20] Wait to receive QMP greeting before sending any monitor commands



On 09/11/2012 05:34 PM, Eric Blake wrote:
>>> soon after startup. Waiting for the QMP greeting avoids the
>>> race
>>>

> 
> Spoke too soon. This makes the testsuite hang in qemumonitorjsontest, as
> the fake json monitor never manages to trigger the wait_greeting reset
> to 0.  I'm not sure how best to fix the infloop, but that is needed
> before this patch can go in.

My down-and-dirty hack:

diff --git i/src/qemu/qemu_monitor.c w/src/qemu/qemu_monitor.c
index fb67b9a..157d58f 100644
--- i/src/qemu/qemu_monitor.c
+++ w/src/qemu/qemu_monitor.c
@@ -720,8 +720,8 @@ qemuMonitorOpen(virDomainObjPtr vm,
     }
     mon->fd = -1;
     mon->vm = vm;
-    mon->json = json;
-    if (json)
+    mon->json = !!json;
+    if (json == 1)
         mon->wait_greeting = 1;
     mon->cb = cb;
     qemuMonitorLock(mon);
diff --git i/tests/qemumonitortestutils.c w/tests/qemumonitortestutils.c
index 76b11e6..3e7285f 100644
--- i/tests/qemumonitortestutils.c
+++ w/tests/qemumonitortestutils.c
@@ -458,7 +458,7 @@ qemuMonitorTestPtr qemuMonitorTestNew(bool json,
virCapsPtr caps)

     if (!(test->mon = qemuMonitorOpen(test->vm,
                                       &src,
-                                      true,
+                                      2,
                                       &qemuCallbacks)))
         goto error;
     qemuMonitorLock(test->mon);


-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


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