mirror of https://gitee.com/openkylin/libvirt.git
virSecurityDACRestoreAllLabel: Reorder device relabeling
It helps whe trying to match calls with virSecurityDACSetAllLabel if the order in which devices are set/restored is the same in both functions. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
06af6609e9
commit
08e3b1c0dc
|
@ -1664,11 +1664,11 @@ virSecurityDACRestoreAllLabel(virSecurityManagerPtr mgr,
|
|||
VIR_DEBUG("Restoring security label on %s migrated=%d",
|
||||
def->name, migrated);
|
||||
|
||||
for (i = 0; i < def->nhostdevs; i++) {
|
||||
if (virSecurityDACRestoreHostdevLabel(mgr,
|
||||
def,
|
||||
def->hostdevs[i],
|
||||
NULL) < 0)
|
||||
for (i = 0; i < def->ndisks; i++) {
|
||||
if (virSecurityDACRestoreImageLabelInt(mgr,
|
||||
def,
|
||||
def->disks[i]->src,
|
||||
migrated) < 0)
|
||||
rc = -1;
|
||||
}
|
||||
|
||||
|
@ -1682,11 +1682,11 @@ virSecurityDACRestoreAllLabel(virSecurityManagerPtr mgr,
|
|||
rc = -1;
|
||||
}
|
||||
|
||||
for (i = 0; i < def->ndisks; i++) {
|
||||
if (virSecurityDACRestoreImageLabelInt(mgr,
|
||||
def,
|
||||
def->disks[i]->src,
|
||||
migrated) < 0)
|
||||
for (i = 0; i < def->nhostdevs; i++) {
|
||||
if (virSecurityDACRestoreHostdevLabel(mgr,
|
||||
def,
|
||||
def->hostdevs[i],
|
||||
NULL) < 0)
|
||||
rc = -1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue