]> git.ipfire.org Git - thirdparty/libvirt.git/commit
blockjob: shuffle block rebase code
authorEric Blake <eblake@redhat.com>
Fri, 29 Aug 2014 19:27:18 +0000 (13:27 -0600)
committerEric Blake <eblake@redhat.com>
Thu, 4 Sep 2014 23:23:33 +0000 (17:23 -0600)
commit02d2bd7d91c200d1ea1a5b3f78c8b41720cea832
treed1147f486bc84d76fade66f9693718254d30c3aa
parentbc7e63d39ca0e96073ba04e5a0c2b5471ca05b85
blockjob: shuffle block rebase code

The existing virDomainBlockRebase code rejected the combination of
_RELATIVE and _COPY flags, but only by accident.  It makes sense
to add support for the combination someday, at least for the case
of _SHALLOW and not _REUSE_EXT; but to implement it, libvirt would
have to pre-create the file with a relative backing name, and I'm
not ready to code that in yet.

Meanwhile, the code to forward on to the block copy code is getting
longer, and reorganizing the function to have the block pull done
early makes it easier to add even more block copy prep code.

This patch should have no semantic difference other than the quality
of the error message on the unsupported flag combination.  Pre-patch:

error: unsupported flags (0x10) in function qemuDomainBlockCopy

Post-patch:

error: argument unsupported: Relative backing during copy not supported yet

* src/qemu/qemu_driver.c (qemuDomainBlockRebase): Reorder code,
and improve error message of relative copy.

Signed-off-by: Eric Blake <eblake@redhat.com>
src/qemu/qemu_driver.c