On 12/02/13 22:36, Adam Walters wrote:
This patch modifies the switch statement in qemuBuildVolumeString
to format and pass the needed argument to handle a volume from an
RBD storage pool properly. If the volume is a VIR_STORAGE_VOL_NETWORK
but is not from an RBD pool, I goto cleanup, just like the other
unimplemented volume types. Currently, the code only supports RBD
volumes, as I lack the facilities to test other network storage pools.
Once I have the ability to test those, I will revisit the possibility
of implementing additional types.
---
src/qemu/qemu_command.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 763417f..4102568 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -3825,6 +3825,17 @@ qemuBuildVolumeString(virConnectPtr conn,
}
break;
case VIR_STORAGE_VOL_NETWORK:
+ if (disk->srcpool->pooltype == VIR_STORAGE_POOL_RBD) {
+ virBufferAddLit(opt, "file=");
+
+ if (qemuBuildRBDString(conn, disk, opt) < 0)
+ goto cleanup;
+
+ virBufferAddChar(opt, ',');
+ } else {
+ goto cleanup;
+ }
+ break;
case VIR_STORAGE_VOL_NETDIR:
case VIR_STORAGE_VOL_LAST:
/* Keep the compiler quiet, qemuTranslateDiskSourcePool already
I'm about to push patch [1] that will kill the whole
qemuBuildVolumeString function. You will need to adapt your patch to do
the usefull stuff in qemuTranslateDiskSourcePool present in
src/qemu/qemu_conf.c
Sorry for the inconvenience.
Peter
[1]:
http://www.redhat.com/archives/libvir-list/2013-December/msg00064.html