提交 ee3efc41 编写于 作者: J Josh Durgin 提交者: Eric Blake

Skip file-based security checks for network disks

Network disks are accessed by qemu directly, and have no
associated file on the host, so checking for file ownership etc.
is unnecessary.
Signed-off-by: NJosh Durgin <joshd@hq.newdream.net>
上级 2954eb7b
...@@ -8353,7 +8353,7 @@ int virDomainDiskDefForeachPath(virDomainDiskDefPtr disk, ...@@ -8353,7 +8353,7 @@ int virDomainDiskDefForeachPath(virDomainDiskDefPtr disk,
size_t depth = 0; size_t depth = 0;
char *nextpath = NULL; char *nextpath = NULL;
if (!disk->src) if (!disk->src || disk->type == VIR_DOMAIN_DISK_TYPE_NETWORK)
return 0; return 0;
if (disk->driverType) { if (disk->driverType) {
......
...@@ -144,7 +144,7 @@ qemuSecurityDACRestoreSecurityImageLabelInt(virSecurityDriverPtr drv ATTRIBUTE_U ...@@ -144,7 +144,7 @@ qemuSecurityDACRestoreSecurityImageLabelInt(virSecurityDriverPtr drv ATTRIBUTE_U
if (disk->readonly || disk->shared) if (disk->readonly || disk->shared)
return 0; return 0;
if (!disk->src) if (!disk->src || disk->type == VIR_DOMAIN_DISK_TYPE_NETWORK)
return 0; return 0;
/* If we have a shared FS & doing migrated, we must not /* If we have a shared FS & doing migrated, we must not
......
...@@ -619,7 +619,7 @@ AppArmorSetSecurityImageLabel(virSecurityDriverPtr drv, ...@@ -619,7 +619,7 @@ AppArmorSetSecurityImageLabel(virSecurityDriverPtr drv,
if (secdef->type == VIR_DOMAIN_SECLABEL_STATIC) if (secdef->type == VIR_DOMAIN_SECLABEL_STATIC)
return 0; return 0;
if (!disk->src) if (!disk->src || disk->type == VIR_DOMAIN_DISK_TYPE_NETWORK)
return 0; return 0;
if (secdef->imagelabel) { if (secdef->imagelabel) {
......
...@@ -436,7 +436,7 @@ SELinuxRestoreSecurityImageLabelInt(virSecurityDriverPtr drv ATTRIBUTE_UNUSED, ...@@ -436,7 +436,7 @@ SELinuxRestoreSecurityImageLabelInt(virSecurityDriverPtr drv ATTRIBUTE_UNUSED,
if (disk->readonly || disk->shared) if (disk->readonly || disk->shared)
return 0; return 0;
if (!disk->src) if (!disk->src || disk->type == VIR_DOMAIN_DISK_TYPE_NETWORK)
return 0; return 0;
/* If we have a shared FS & doing migrated, we must not /* If we have a shared FS & doing migrated, we must not
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册