From: Osier Yang Date: Tue, 18 Jun 2013 08:36:41 +0000 (+0800) Subject: conf: Ignore the volume type disk if its mode is "direct" X-Git-Tag: v1.1.1-rc1~25 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=985843586f9b1370c2b0862ca08fc130c1445607;p=thirdparty%2Flibvirt.git conf: Ignore the volume type disk if its mode is "direct" 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. --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index dae50c78f7..10cb7f6102 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -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)