[PATCH] apparmor: Fix build after split of disk source metadata

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit 4f20226664b2d4d9e9496ec1e05c9280581a1ca0 breaks build with
AppArmor enabled as it missed the refactor to the new accessors.
---

Notes:
    Pushed under the build-breaker rule.

 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 f7b67ba..6dca476 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 b8b0610..ddfcb0a 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);
         }

-- 
1.9.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]