]> xenbits.xensource.com Git - libvirt.git/commit
blockcopy: expose new API in virsh
authorEric Blake <eblake@redhat.com>
Fri, 29 Aug 2014 21:47:28 +0000 (15:47 -0600)
committerEric Blake <eblake@redhat.com>
Sun, 7 Sep 2014 03:45:05 +0000 (21:45 -0600)
commitc1d75deea228e7f4a7462aef143e18c456b2a82c
tree9e80ef1c965a5ffeb5930603e6bb89fd750a5ffa
parent0e8bed817705664764db408c93ba54277ef85157
blockcopy: expose new API in virsh

Expose the new power of virDomainBlockCopy through virsh (well,
all but the finer-grained bandwidth, as that is its own can of
worms for a later patch).  Continue to use the older API where
possible, for maximum compatibility.

The command now requires either --dest (with optional --format
and --blockdev), to directly describe the file destination, or
--xml, to name a file that contains an XML description such as:

<disk type='network'>
  <driver type='raw'/>
  <source protocol='gluster' name='vol1/img'>
    <host name='red'/>
  </source>
</disk>

[well, it may be a while before the qemu driver is actually patched
to act on that particular xml beyond just parsing it, but the virsh
interface won't need changing at that time]

Non-zero option parameters are converted into virTypedParameters,
and if anything requires the new API, the command can synthesize
appropriate XML even if the --dest option was used instead of --xml.

The existing --raw flag remains for back-compat, but the preferred
spelling is now --format=raw, since the new API now allows us
to specify all formats rather than just a boolean raw to suppress
probing.

I hope I did justice in describing the effects of granularity and
buf-size on how they get passed through to qemu.

* tools/virsh-domain.c (cmdBlockCopy): Add new options --xml,
--granularity, --buf-size, --format. Make --raw an alias for
--format=raw. Call new API if new parameters are in use.
* tools/virsh.pod (blockcopy): Document new options.

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