]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: Ignore the volume type disk if its mode is "direct"
authorOsier Yang <jyang@redhat.com>
Tue, 18 Jun 2013 08:36:41 +0000 (16:36 +0800)
committerJohn Ferlan <jferlan@redhat.com>
Mon, 22 Jul 2013 18:03:31 +0000 (14:03 -0400)
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="direct" for cgroup
setting.

src/conf/domain_conf.c

index dae50c78f753d0871544e9095e38cf3a5d657258..10cb7f6102c0c54aca424215f52ffbb0127de1f0 100644 (file)
@@ -17533,7 +17533,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_DIRECT))
         return 0;
 
     if (iter(disk, disk->src, 0, opaque) < 0)