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:
Michal Privoznik 2018-09-25 13:32:07 +02:00
parent 06af6609e9
commit 08e3b1c0dc
1 changed files with 10 additions and 10 deletions

View File

@ -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;
} }