<div dir="ltr">I tested the patch, and it didn't work for me (already found the bug, though, and a new patch will be sent shortly). The bug is related to the cGroup code (specifically, the virDomainDiskDefForeachPath function in conf/domain_conf.c). The entire libvirt codebase does not yet utilize the actualtype value in a disk definition. cGroup creation thus fails in that function due to the source path (in the form of "rbd_pool/rbd_image_name" not existing on the file system).<div>
<br></div><div>A question prior to creating a new patch, though. Would you prefer I modify virDomainDiskDefForeachPath to also check def->srcpool->actualtype for equality against VIR_DOMAIN_DISK_TYPE_NETWORK, or bypass the check by setting the the access mode on the disk definition to direct (which would work around the bug). I'm sure there is more to the virDomainDiskDefForeachPath function (and other functions, too) that a simple equality check in one spot may not handle, but I'm not intimately familiar enough with the code to really know what will happen.<br>
<div><br></div><div>The only reason I had implemented the switch statement was to handle a possible future use case where it is decided that support for RBD devices through the kernel should be added, which might be considered "host mode." I probably should've asked that question before making a patch, but I figured it was probably better to try and handle possible future use cases, rather than make it work solely for what I currently use. Also, sorry for the delayed response. I had to make a trip out to Tallahassee yesterday for work, which took all day.<br>
</div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Dec 5, 2013 at 6:13 AM, Peter Krempa <span dir="ltr"><<a href="mailto:pkrempa@redhat.com" target="_blank">pkrempa@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Adam Walters <<a href="mailto:adam@pandorasboxen.com">adam@pandorasboxen.com</a>><br>
<div class="im"><br>
This implements RBD storage pool support in the<br>
qemuTranslateDiskSourcePool function. This support is working on my<br>
machine, but could probably use some additional testing. It is<br>
implemented very similarly to the ISCSI support.<br>
---<br>
</div> src/qemu/qemu_conf.c | 21 ++++++++++++++++++++-<br>
 1 file changed, 20 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c<br>
index 2d42c3b..a44c71f 100644<br>
--- a/src/qemu/qemu_conf.c<br>
+++ b/src/qemu/qemu_conf.c<br>
@@ -1478,8 +1478,27 @@ qemuTranslateDiskSourcePool(virConnectPtr conn,<br>
<div class="im HOEnZb">        }<br>
        break;<br>
<br>
-    case VIR_STORAGE_POOL_MPATH:<br>
     case VIR_STORAGE_POOL_RBD:<br>
+        if (def->startupPolicy) {<br>
+            virReportError(VIR_ERR_XML_ERROR, "%s",<br>
+                           _("'startupPolicy' is only valid for "<br>
+                             "'file' type volume"));<br>
+            goto cleanup;<br>
+        }<br>
</div><div class="im HOEnZb">+        def->srcpool->actualtype = VIR_DOMAIN_DISK_TYPE_NETWORK;<br>
+        def->protocol = VIR_DOMAIN_DISK_PROTOCOL_RBD;<br>
+<br>
+        if (!(def->src = virStorageVolGetPath(vol)))<br>
+            goto cleanup;<br>
+<br>
+        if (qemuTranslateDiskSourcePoolAuth(def, pooldef) < 0)<br>
+            goto cleanup;<br>
+<br>
+        if (qemuAddRBDPoolSourceHost(def, pooldef) < 0)<br>
+            goto cleanup;<br>
+        break;<br>
+<br>
</div><div class="HOEnZb"><div class="h5">+    case VIR_STORAGE_POOL_MPATH:<br>
     case VIR_STORAGE_POOL_SHEEPDOG:<br>
     case VIR_STORAGE_POOL_GLUSTER:<br>
     case VIR_STORAGE_POOL_LAST:<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
1.8.4.3<br>
<br>
</font></span></blockquote></div><br></div>