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",
|
VIR_DEBUG("Restoring security label on %s migrated=%d",
|
||||||
def->name, migrated);
|
def->name, migrated);
|
||||||
|
|
||||||
for (i = 0; i < def->nhostdevs; i++) {
|
for (i = 0; i < def->ndisks; i++) {
|
||||||
if (virSecurityDACRestoreHostdevLabel(mgr,
|
if (virSecurityDACRestoreImageLabelInt(mgr,
|
||||||
def,
|
def,
|
||||||
def->hostdevs[i],
|
def->disks[i]->src,
|
||||||
NULL) < 0)
|
migrated) < 0)
|
||||||
rc = -1;
|
rc = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1682,11 +1682,11 @@ virSecurityDACRestoreAllLabel(virSecurityManagerPtr mgr,
|
||||||
rc = -1;
|
rc = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < def->ndisks; i++) {
|
for (i = 0; i < def->nhostdevs; i++) {
|
||||||
if (virSecurityDACRestoreImageLabelInt(mgr,
|
if (virSecurityDACRestoreHostdevLabel(mgr,
|
||||||
def,
|
def,
|
||||||
def->disks[i]->src,
|
def->hostdevs[i],
|
||||||
migrated) < 0)
|
NULL) < 0)
|
||||||
rc = -1;
|
rc = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue