Rename the existing virSecurityDACRestoreImageLabelInt to virSecurityDACRestoreImageLabelSingle, and extend the new ImageLabelInt handle externalDataStore Signed-off-by: Cole Robinson <crobinso@xxxxxxxxxx> --- src/security/security_dac.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/src/security/security_dac.c b/src/security/security_dac.c index 6d0c8a9b1c..befa388791 100644 --- a/src/security/security_dac.c +++ b/src/security/security_dac.c @@ -954,10 +954,10 @@ virSecurityDACSetImageLabel(virSecurityManagerPtr mgr, static int -virSecurityDACRestoreImageLabelInt(virSecurityManagerPtr mgr, - virDomainDefPtr def, - virStorageSourcePtr src, - bool migrated) +virSecurityDACRestoreImageLabelSingle(virSecurityManagerPtr mgr, + virDomainDefPtr def, + virStorageSourcePtr src, + bool migrated) { virSecurityDACDataPtr priv = virSecurityManagerGetPrivateData(mgr); virSecurityLabelDefPtr secdef; @@ -1008,6 +1008,26 @@ virSecurityDACRestoreImageLabelInt(virSecurityManagerPtr mgr, } +static int +virSecurityDACRestoreImageLabelInt(virSecurityManagerPtr mgr, + virDomainDefPtr def, + virStorageSourcePtr src, + bool migrated) +{ + if (virSecurityDACRestoreImageLabelSingle(mgr, def, src, migrated) < 0) + return -1; + + if (src->externalDataStore && + virSecurityDACRestoreImageLabelSingle(mgr, + def, + src->externalDataStore, + migrated) < 0) + return -1; + + return 0; +} + + static int virSecurityDACRestoreImageLabel(virSecurityManagerPtr mgr, virDomainDefPtr def, -- 2.23.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list