
On Wed, Dec 7, 2011 at 11:01 PM, Eric Blake <eblake@redhat.com> wrote:
On 12/07/2011 03:35 PM, Adam Litke wrote: 4) Ask Stefan to make the HMP monitor command synchronous, but only expose the JSON command as asynchronous. After all, it is only HMP where we can't wait for an event.
QEMU cannot do async commands, even for HMP. My QEMU patches used to work because there is a broken async flag for monitor commands. I didn't know it was broken at the time O:-). I have CCed Luiz who has been working on moving commands off the old MONITOR_CMD_ASYNC flag. My current understanding is that patches adding use of MONITOR_CMD_ASYNC will not be accepted.
2) Poll the qemu monitor To do it this way, I would write a function that repeatedly calls virDomainGetBlockJobInfo() against the disk in question. Once the job disappears from the list I can return with confidence that the job is gone. This is obviously sub-optimal because I need to poll and sleep.
We've done this before, for both HMP and JSON - see qemuMigrationWaitForCompletion. I agree that an event is nicer than polling, but we may be locked into this.
This seems like the safest option although it's ugly. Stefan