]> xenbits.xensource.com Git - libvirt.git/commit
qemu: Refactor qemuTranslateDiskSourcePool
authorPeter Krempa <pkrempa@redhat.com>
Wed, 20 Nov 2013 09:37:31 +0000 (10:37 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 3 Dec 2013 09:16:12 +0000 (10:16 +0100)
commite1a4d08baf9a8cc86c8b5ca27da9aeedb34b5908
tree7a076fbc73972b00b771892d1340aa55cd8f3a28
parentec2fb767bbd087c30b421b6c10eb2de25e90aa62
qemu: Refactor qemuTranslateDiskSourcePool

Before this patch, the translation function still needs a second ugly
helper function to actually format the command line for qemu. But if we
do the right stuff in the translation function, we don't have to bother
with the second function any more.

This patch removes the messy qemuBuildVolumeString function and changes
qemuTranslateDiskSourcePool to set stuff up correctly so that the
regular code paths meant for volumes can be used to format the command
line correctly.

For this purpose a new helper "qemuDiskGetActualType()" is introduced to
return the type of the volume in a pool.

As a part of the refactor the qemuTranslateDiskSourcePool function is
fixed to do decisions based on the pool type instead of the volume type.
This allows to separate pool-type-specific stuff more clearly and will
ease addition of other pool types that will require certain other
operations to get the correct pool source.

The previously fixed tests should make sure that we don't break stuff
that was working before.
src/conf/domain_conf.h
src/libvirt_private.syms
src/qemu/qemu_command.c
src/qemu/qemu_conf.c
src/qemu/qemu_conf.h