• A
    blockjob: add API for async virDomainBlockJobAbort · a696f8b7
    Adam Litke 提交于
    Block job cancellation can take a while.  Now that upstream qemu 1.1
    has asynchronous block cancellation, we want to expose that to the user.
    Therefore, the following updates are made to the virDomainBlockJob API:
    
    A new block job event type VIR_DOMAIN_BLOCK_JOB_CANCELED is managed by
    libvirt.  Regardless of the flags used with virDomainBlockJobAbort, this
    event will be raised: 1. when using synchronous block_job_cancel (the
    event will be synthesized by libvirt), and 2. whenever it is received
    from qemu (via asynchronous block-job-cancel).  Note that the event
    may be detected by libvirt even before the virDomainBlockJobAbort
    completes (always true when it is synthesized, but also possible if
    cancellation was fast).
    
    A new extension flag VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC is added to the
    virDomainBlockJobAbort API.  When enabled, this function will allow
    (but not require) asynchronous operation (ie, it returns as soon as
    possible, which might be before the job has actually been canceled).
    When the API is used in this mode, it is the responsibility of the
    caller to wait for a VIR_DOMAIN_BLOCK_JOB_CANCELED event or poll via
    the virDomainGetBlockJobInfo API to check the cancellation status.
    
    This patch also exposes the new flag through virsh, and makes virsh
    slightly easier to use (--async implies --abort, and lack of any options
    implies --info), although it leaves the qemu implementation for later
    patches.
    Signed-off-by: NAdam Litke <agl@us.ibm.com>
    Cc: Stefan Hajnoczi <stefanha@gmail.com>
    Signed-off-by: NEric Blake <eblake@redhat.com>
    a696f8b7
virsh.pod 108.5 KB