[PATCHv4 2/2] qemu: conf: Implement RBD storage pool support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Adam Walters <adam@xxxxxxxxxxxxxxxxx>

This implements RBD storage pool support in the
qemuTranslateDiskSourcePool function. This support is working on my
machine, but could probably use some additional testing. It is
implemented very similarly to the ISCSI support.
---
 src/qemu/qemu_conf.c | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 2d42c3b..a44c71f 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -1478,8 +1478,27 @@ qemuTranslateDiskSourcePool(virConnectPtr conn,
        }
        break;

-    case VIR_STORAGE_POOL_MPATH:
     case VIR_STORAGE_POOL_RBD:
+        if (def->startupPolicy) {
+            virReportError(VIR_ERR_XML_ERROR, "%s",
+                           _("'startupPolicy' is only valid for "
+                             "'file' type volume"));
+            goto cleanup;
+        }
+        def->srcpool->actualtype = VIR_DOMAIN_DISK_TYPE_NETWORK;
+        def->protocol = VIR_DOMAIN_DISK_PROTOCOL_RBD;
+
+        if (!(def->src = virStorageVolGetPath(vol)))
+            goto cleanup;
+
+        if (qemuTranslateDiskSourcePoolAuth(def, pooldef) < 0)
+            goto cleanup;
+
+        if (qemuAddRBDPoolSourceHost(def, pooldef) < 0)
+            goto cleanup;
+        break;
+
+    case VIR_STORAGE_POOL_MPATH:
     case VIR_STORAGE_POOL_SHEEPDOG:
     case VIR_STORAGE_POOL_GLUSTER:
     case VIR_STORAGE_POOL_LAST:
-- 
1.8.4.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]