From ccef7d7876df5e222e78907b22aa4f0990b54b5f Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Mon, 24 Mar 2014 20:00:11 +0100 Subject: [PATCH] apparmor: Fix build after split of disk source metadata Commit 4f20226664b2d4d9e9496ec1e05c9280581a1ca0 breaks build with AppArmor enabled as it missed the refactor to the new accessors. --- src/security/security_apparmor.c | 13 ++++++++----- src/security/virt-aa-helper.c | 4 ++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/security/security_apparmor.c b/src/security/security_apparmor.c index f7b67bae09..6dca476971 100644 --- a/src/security/security_apparmor.c +++ b/src/security/security_apparmor.c @@ -688,7 +688,7 @@ AppArmorRestoreSecurityImageLabel(virSecurityManagerPtr mgr, virDomainDefPtr def, virDomainDiskDefPtr disk) { - if (disk->type == VIR_DOMAIN_DISK_TYPE_NETWORK) + if (virDomainDiskGetType(disk) == VIR_DOMAIN_DISK_TYPE_NETWORK) return 0; return reload_profile(mgr, def, NULL, false); @@ -710,14 +710,16 @@ AppArmorSetSecurityImageLabel(virSecurityManagerPtr mgr, if (secdef->norelabel) return 0; - if (!disk->src || disk->type == VIR_DOMAIN_DISK_TYPE_NETWORK) + if (!virDomainDiskGetSource(disk) || + virDomainDiskGetType(disk) == VIR_DOMAIN_DISK_TYPE_NETWORK) return 0; if (secdef->imagelabel) { /* if the device doesn't exist, error out */ - if (!virFileExists(disk->src)) { + if (!virFileExists(virDomainDiskGetSource(disk))) { virReportError(VIR_ERR_INTERNAL_ERROR, - _("\'%s\' does not exist"), disk->src); + _("\'%s\' does not exist"), + virDomainDiskGetSource(disk)); return rc; } @@ -726,7 +728,8 @@ AppArmorSetSecurityImageLabel(virSecurityManagerPtr mgr, /* update the profile only if it is loaded */ if (profile_loaded(secdef->imagelabel) >= 0) { - if (load_profile(mgr, secdef->imagelabel, def, disk->src, + if (load_profile(mgr, secdef->imagelabel, def, + virDomainDiskGetSource(disk), false) < 0) { virReportError(VIR_ERR_INTERNAL_ERROR, _("cannot update AppArmor profile " diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c index b8b0610050..ddfcb0adc4 100644 --- a/src/security/virt-aa-helper.c +++ b/src/security/virt-aa-helper.c @@ -948,8 +948,8 @@ get_files(vahControl * ctl) */ if (!disk->backingChain) { bool probe = ctl->allowDiskFormatProbing; - disk->backingChain = virStorageFileGetMetadata(disk->src, - disk->format, + disk->backingChain = virStorageFileGetMetadata(virDomainDiskGetSource(disk), + virDomainDiskGetFormat(disk), -1, -1, probe); } -- GitLab