mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 19:32:19 +00:00
qemuDomainAttachSCSIVHostDevice: Prefer qemuSecurity wrappers
Since we have qemuSecurity wrappers over virSecurityManagerSetHostdevLabel and virSecurityManagerRestoreHostdevLabel we ought to use them instead of calling secdriver APIs directly. Without those wrappers the labelling won't be done in the correct namespace and thus won't apply to the nodes seen by qemu itself. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
2841e6756d
commit
7d93a88519
@ -2552,8 +2552,7 @@ qemuDomainAttachSCSIVHostDevice(virQEMUDriverPtr driver,
|
||||
goto cleanup;
|
||||
teardowncgroup = true;
|
||||
|
||||
if (virSecurityManagerSetHostdevLabel(driver->securityManager,
|
||||
vm->def, hostdev, NULL) < 0)
|
||||
if (qemuSecuritySetHostdevLabel(driver, vm, hostdev) < 0)
|
||||
goto cleanup;
|
||||
teardownlabel = true;
|
||||
|
||||
@ -2612,8 +2611,7 @@ qemuDomainAttachSCSIVHostDevice(virQEMUDriverPtr driver,
|
||||
if (teardowncgroup && qemuTeardownHostdevCgroup(vm, hostdev) < 0)
|
||||
VIR_WARN("Unable to remove host device cgroup ACL on hotplug fail");
|
||||
if (teardownlabel &&
|
||||
virSecurityManagerRestoreHostdevLabel(driver->securityManager,
|
||||
vm->def, hostdev, NULL) < 0)
|
||||
qemuSecurityRestoreHostdevLabel(driver, vm, hostdev) < 0)
|
||||
VIR_WARN("Unable to restore host device labelling on hotplug fail");
|
||||
if (releaseaddr)
|
||||
qemuDomainReleaseDeviceAddress(vm, hostdev->info, NULL);
|
||||
|
Loading…
x
Reference in New Issue
Block a user