[libvirt] [RFC PATCH] qemu: Fail APIs not allowed during async job

Eric Blake eblake at redhat.com
Fri Jul 15 15:09:52 UTC 2011

On 07/15/2011 08:41 AM, Jiri Denemark wrote:
> When an asynchronous job is running while another API that is
> incompatible with that job is called, we now try to wait until the job
> finishes and either run the API or fail with timeout. I guess nicer
> solution is to just fail such API immediately and let the application
> retry once the asynchronous job ends.
> ---
>  src/qemu/THREADS.txt   |    5 ++---
>  src/qemu/qemu_domain.c |   28 +++++++++++++++-------------
>  2 files changed, 17 insertions(+), 16 deletions(-)

If all such APIs have a flag argument, then we could make the behavior
configurable - passing 0 blocks until possible, and passing
VIR_DOMAIN_OPERATION_NONBLOCK as a flag returns immediately.

But we probably don't have uniform flags arguments.  Which APIs are

If we can't control things by a flag, then returning a specific failure
seems like the best way to go (it is easier to write an app that can
retry than it is to write an app that doesn't suffer from unintended

So this patch seems sane to me, although I'd still like a list of all
affected APIs before giving ack.

Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110715/0709b3e0/attachment-0001.sig>

More information about the libvir-list mailing list