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

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

 



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@xxxxxxxxxx    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

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