[libvirt] How do I get the progress of a long operation

Eric Blake eblake at redhat.com
Fri Nov 7 14:03:46 UTC 2014

On 11/07/2014 02:24 PM, windy wrote:
> Dear Libvirt:      How do  I get  the  progress of a long operation (such as Snapshot take and recover )through libvirt API?

virsh exists as a sample of how to do this for several long-running APIs.

Some APIs are (currently) blocking-only; for those, you have to have a
second thread/process open a second connection to the hypervisor to
track ongoing progress (see how 'virsh migrate --verbose' does this).

Others are asynchronous by default, and require you to poll or wait for
an event for the end of the operation; so a single thread can also query
state in the middle of the operation (see how 'virsh blockpull --wait
--verbose' works).

And for some APIs, we just haven't yet implemented job reporting and
status of those jobs (sadly; 'virsh vol-download' is an example of
this); patches are welcome to help us improve these interfaces to use a
more generic job handling mechanism that can let us run multiple jobs in

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

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

More information about the libvir-list mailing list