]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
blockjob: add virsh blockpull --wait
authorEric Blake <eblake@redhat.com>
Thu, 12 Apr 2012 19:12:21 +0000 (13:12 -0600)
committerEric Blake <eblake@redhat.com>
Tue, 17 Apr 2012 17:11:47 +0000 (11:11 -0600)
commit3b96a892427ad2c617b192b569b8a98bfef0837b
tree824f8a4102459e7047c6ffcb0dfe32005d5ba04d
parent6fb8a64d936f71bd991c7c772d9a88dc1b86913b
blockjob: add virsh blockpull --wait

I'm tired of shell-scripting to wait for completion of a block pull,
when virsh can be taught to do the same.  I couldn't quite reuse
vshWatchJob, as this is not a case of a long-running command where
a second thread must be used to probe job status (at least, not unless
I make virsh start doing blocking waits for an event to fire), but it
served as inspiration for my simpler single-threaded loop.  There is
up to a half-second delay between sending SIGINT and the job being
aborted, but I didn't think it worth the complexity of a second thread
and use of poll() just to minimize that delay.

* tools/virsh.c (cmdBlockPull): Add new options to wait for
completion.
(blockJobImpl): Add argument.
(cmdBlockJob): Adjust caller.
* tools/virsh.pod (blockjob): Document new mode.
tools/virsh.c
tools/virsh.pod