提交 45599e40 编写于 作者: M Michal Privoznik

qemuDomainAttachSCSIVHostDevice: manage /dev entry

Again, one missed bit. This time without this commit there is no
/dev entry in the namespace of the qemu process when attaching
vhost SCSI device.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
上级 7d93a885
...@@ -2532,6 +2532,7 @@ qemuDomainAttachSCSIVHostDevice(virQEMUDriverPtr driver, ...@@ -2532,6 +2532,7 @@ qemuDomainAttachSCSIVHostDevice(virQEMUDriverPtr driver,
char *devstr = NULL; char *devstr = NULL;
bool teardowncgroup = false; bool teardowncgroup = false;
bool teardownlabel = false; bool teardownlabel = false;
bool teardowndevice = false;
bool releaseaddr = false; bool releaseaddr = false;
if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE_SCSI_GENERIC)) { if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE_SCSI_GENERIC)) {
...@@ -2548,6 +2549,10 @@ qemuDomainAttachSCSIVHostDevice(virQEMUDriverPtr driver, ...@@ -2548,6 +2549,10 @@ qemuDomainAttachSCSIVHostDevice(virQEMUDriverPtr driver,
return -1; return -1;
} }
if (qemuDomainNamespaceSetupHostdev(driver, vm, hostdev) < 0)
goto cleanup;
teardowndevice = true;
if (qemuSetupHostdevCgroup(vm, hostdev) < 0) if (qemuSetupHostdevCgroup(vm, hostdev) < 0)
goto cleanup; goto cleanup;
teardowncgroup = true; teardowncgroup = true;
...@@ -2613,6 +2618,9 @@ qemuDomainAttachSCSIVHostDevice(virQEMUDriverPtr driver, ...@@ -2613,6 +2618,9 @@ qemuDomainAttachSCSIVHostDevice(virQEMUDriverPtr driver,
if (teardownlabel && if (teardownlabel &&
qemuSecurityRestoreHostdevLabel(driver, vm, hostdev) < 0) qemuSecurityRestoreHostdevLabel(driver, vm, hostdev) < 0)
VIR_WARN("Unable to restore host device labelling on hotplug fail"); VIR_WARN("Unable to restore host device labelling on hotplug fail");
if (teardowndevice &&
qemuDomainNamespaceTeardownHostdev(driver, vm, hostdev) < 0)
VIR_WARN("Unable to remove host device from /dev");
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.
先完成此消息的编辑!
想要评论请 注册