[libvirt] [PATCH 5/6] conf: Ignore the volume type disk if its mode is "uri"

Osier Yang jyang at redhat.com
Tue Jun 18 08:55:39 UTC 2013


virDomainDiskDefForeachPath is not only used by the security
setting helpers, also used by cgroup setting helpers, so this
is to ignore the volume type disk with mode="uri" for cgroup
setting.
---
 src/conf/domain_conf.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 04b14dc..2f397de 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -17155,7 +17155,10 @@ virDomainDiskDefForeachPath(virDomainDiskDefPtr disk,
     size_t depth = 0;
     virStorageFileMetadata *tmp;
 
-    if (!disk->src || disk->type == VIR_DOMAIN_DISK_TYPE_NETWORK)
+    if (!disk->src || disk->type == VIR_DOMAIN_DISK_TYPE_NETWORK ||
+        (disk->type == VIR_DOMAIN_DISK_TYPE_VOLUME &&
+         disk->srcpool &&
+         disk->srcpool->mode == VIR_DOMAIN_DISK_SOURCE_POOL_MODE_URI))
         return 0;
 
     if (iter(disk, disk->src, 0, opaque) < 0)
-- 
1.8.1.4




More information about the libvir-list mailing list