]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virsh: improve blockcopy UI
authorEric Blake <eblake@redhat.com>
Wed, 11 Jun 2014 15:36:49 +0000 (09:36 -0600)
committerEric Blake <eblake@redhat.com>
Thu, 12 Jun 2014 20:41:40 +0000 (14:41 -0600)
commit17840379910757c0bf04d204b58a3e3a016787d0
tree6499a87b2f8dafeb9af51cc339fa3952c4b12c48
parentbab45585473628e9353ed3dca0869ae376714fb5
virsh: improve blockcopy UI

Peter's review of an early version of my addition of active block
commit pointed out some issues that I was copying from the block
copy code; fix them up now before perpetuating them.

For virsh commands that manage a single API call, it's nice to have
a 1:1 mapping of options to flags, so that we can test that
lower-layer software handles flag combinations correctly.  But where
virsh is introducing syntactic sugar to combine multiple API calls
into a single user interface, we might as well make that interface
compact.  That is, we should allow the shorter command-line of
'blockcopy $dom $disk --pivot' without having to explicitly specify
--wait, because this isn't directly a flag passed to a single
underlying API call.

Also, my use of embedded ?: ternaries bordered on unreadable.

* tools/virsh-domain.c (cmdBlockCopy): Make --pivot, --finish,
and --timeout imply --wait. Drop excess ?: operators.
* tools/virsh.pod (blockcopy): Update documentation.

Signed-off-by: Eric Blake <eblake@redhat.com>
tools/virsh-domain.c
tools/virsh.pod