[libvirt] [PATCH 0/9] Progress monitoring & cancellation of jobs

Daniel P. Berrange berrange at redhat.com
Thu Feb 4 17:25:22 UTC 2010


This series introduces 2 new APIs to allow long running jobs to
be monitored and cancelled. This applies to virDomainMigrate,
virDomainSave, virDomainRestore and virDomainCoreDump at least.
The implementation is provided for QEMU only, any others that
are able to implementation can do so as desired.

Usefulness of these new APIs requires use of multiple threads on
a single connection, or multiple connections, since the main
API calls are still all fully blocking. Instead a parallel thread
or process can monitor. This can be seen with virsh

In termainl 1

 $ virsh save demo demo.img

In terminal 2

 $ ./virsh domjobinfo demo
  Job type:         Unbounded   
  Time elapsed:     795          ms
  Data processed:   22446080     bytes
  Data remaining:   219119616    bytes
  Data total:       241565696    bytes
  Memory processed: 22446080     bytes
  Memory remaining: 219119616    bytes
  Memory total:     241565696    bytes

 $ ./virsh domjobinfo demo
  Job type:         Unbounded   
  Time elapsed:     1669         ms
  Data processed:   139784192    bytes
  Data remaining:   101781504    bytes
  Data total:       241565696    bytes
  Memory processed: 139784192    bytes
  Memory remaining: 101781504    bytes
  Memory total:     241565696    bytes

 $ ./virsh domjobabort demo


Back in terminal 1

  error: Failed to save domain demo to demo.img
  error: operation failed: Migration was cancelled by client






More information about the libvir-list mailing list