You need to sign in or sign up before continuing.
提交 7d93a885 编写于 作者: M Michal Privoznik

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: NMichal Privoznik <mprivozn@redhat.com>
上级 2841e675
...@@ -2552,8 +2552,7 @@ qemuDomainAttachSCSIVHostDevice(virQEMUDriverPtr driver, ...@@ -2552,8 +2552,7 @@ qemuDomainAttachSCSIVHostDevice(virQEMUDriverPtr driver,
goto cleanup; goto cleanup;
teardowncgroup = true; teardowncgroup = true;
if (virSecurityManagerSetHostdevLabel(driver->securityManager, if (qemuSecuritySetHostdevLabel(driver, vm, hostdev) < 0)
vm->def, hostdev, NULL) < 0)
goto cleanup; goto cleanup;
teardownlabel = true; teardownlabel = true;
...@@ -2612,8 +2611,7 @@ qemuDomainAttachSCSIVHostDevice(virQEMUDriverPtr driver, ...@@ -2612,8 +2611,7 @@ qemuDomainAttachSCSIVHostDevice(virQEMUDriverPtr driver,
if (teardowncgroup && qemuTeardownHostdevCgroup(vm, hostdev) < 0) if (teardowncgroup && qemuTeardownHostdevCgroup(vm, hostdev) < 0)
VIR_WARN("Unable to remove host device cgroup ACL on hotplug fail"); VIR_WARN("Unable to remove host device cgroup ACL on hotplug fail");
if (teardownlabel && if (teardownlabel &&
virSecurityManagerRestoreHostdevLabel(driver->securityManager, qemuSecurityRestoreHostdevLabel(driver, vm, hostdev) < 0)
vm->def, hostdev, NULL) < 0)
VIR_WARN("Unable to restore host device labelling on hotplug fail"); VIR_WARN("Unable to restore host device labelling on hotplug fail");
if (releaseaddr) if (releaseaddr)
qemuDomainReleaseDeviceAddress(vm, hostdev->info, NULL); qemuDomainReleaseDeviceAddress(vm, hostdev->info, NULL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册