On 09/12/2014 05:41 AM, Peter Krempa wrote:
On 09/12/14 05:55, Eric Blake wrote:
> The hard part of managing the disk copy is already coded; all
> this had to do was convert the XML and virTypedParameters into
> the internal representation.
>
> With this patch, all blockcopy operations that used the old
> API should also work via the new API. Additional extensions,
> such as supporting the granularity tunable or a network rather
> than file destination, will be added as later patches.
>
> * src/qemu/qemu_driver.c (qemuDomainBlockCopy): New function.
>
> Signed-off-by: Eric Blake <eblake(a)redhat.com>
> ---
> src/qemu/qemu_driver.c | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 84 insertions(+)
>
> + if (!(dest = virDomainDiskDefSourceParse(destxml,
vm->def, driver->xmlopt,
> + VIR_DOMAIN_XML_INACTIVE)))
IIRC you added "VIR_DOMAIN_XML_INTERNAL_DISK_SOURCE" so that some of the
members of the <disk> structure can be omitted, so I presume you want to
pass it here.
No, all the VIR_DOMAIN_XML_INTERNAL_* flags are intentionally private to
the domain_conf.c file; you get them not by using them here, but by
calling the correct entry point (that is, this code calls
virDomainDiskDefSourceParse, and THAT function adds the internal flag
before calling into the real workhorse of virDomainDiskDefParseXML).
ACK if you pass VIR_DOMAIN_XML_INTERNAL_DISK_SOURCE or explain why not
appropriately.
Assuming my explanation is good enough, I'm pushing 1-4. I'll leave the
virsh changes of 5-7 for later in case there is more conversation on how
complex or simple the user interface should be (I'll reply more on 7 to
get the ball rolling).
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library
http://libvirt.org