]> git.ipfire.org Git - thirdparty/libvirt.git/commit
blockjob: implement block copy for qemu
authorEric Blake <eblake@redhat.com>
Fri, 19 Oct 2012 23:46:08 +0000 (17:46 -0600)
committerEric Blake <eblake@redhat.com>
Sat, 27 Oct 2012 13:43:39 +0000 (07:43 -0600)
commitc1eb38053d616d764c0c5381301b4cd5d2c45921
tree759d2ab6378f1279bd99aa64ede342c485382296
parent400ac797effe853b66106353a770434f9064cf9d
blockjob: implement block copy for qemu

Minimal patch to wire up all the pieces in the previous patches
to actually enable a block copy job.  By minimal, I mean that
qemu creates the file (that is, no REUSE_EXT flag support yet),
SELinux must be disabled, a lock manager is not informed, and the
audit logs aren't updated.  But those will be added as
improvements in future patches.

This patch is designed so that if we ever add a future API
virDomainBlockCopy with more bells and whistles (such as letting
the user specify a destination image format different than the
source), where virDomainBlockRebase is a wrapper around the
simpler portions of the new functionality, then the new API can
just reuse the new qemuDomainBlockCopy function and already
support _SHALLOW and _REUSE_EXT flags.  Also note that libvirt.c
already filtered the new flags if _COPY is not present, so that
we are not impacting the case of BlockRebase being a wrapper
around BlockPull.

* src/qemu/qemu_driver.c (qemuDomainBlockCopy): New function.
(qemuDomainBlockRebase): Call it when appropriate.
src/qemu/qemu_driver.c