diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c index f79d47ab152b42f2a4fc4ec9971a9e85348388e1..cecf7635c3bd4c8f7750f999197d090061b3027f 100644 --- a/src/security/security_selinux.c +++ b/src/security/security_selinux.c @@ -1749,10 +1749,10 @@ virSecuritySELinuxRestoreTPMFileLabelInt(virSecurityManagerPtr mgr, static int -virSecuritySELinuxRestoreImageLabelInt(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virStorageSourcePtr src, - bool migrated) +virSecuritySELinuxRestoreImageLabelSingle(virSecurityManagerPtr mgr, + virDomainDefPtr def, + virStorageSourcePtr src, + bool migrated) { virSecurityLabelDefPtr seclabel; virSecurityDeviceLabelDefPtr disk_seclabel; @@ -1804,6 +1804,26 @@ virSecuritySELinuxRestoreImageLabelInt(virSecurityManagerPtr mgr, } +static int +virSecuritySELinuxRestoreImageLabelInt(virSecurityManagerPtr mgr, + virDomainDefPtr def, + virStorageSourcePtr src, + bool migrated) +{ + if (virSecuritySELinuxRestoreImageLabelSingle(mgr, def, src, migrated) < 0) + return -1; + + if (src->externalDataStore && + virSecuritySELinuxRestoreImageLabelSingle(mgr, + def, + src->externalDataStore, + migrated) < 0) + return -1; + + return 0; +} + + static int virSecuritySELinuxRestoreImageLabel(virSecurityManagerPtr mgr, virDomainDefPtr def,