提交 6910309c 编写于 作者: D Daniel P. Berrange

Record hotplugged USB device in LXC live guest config

After hotplugging a USB device, the LXC driver forgot
to add the device def to the virDomainDefPtr.
Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
(cherry picked from commit a537827d)

Backport fixed for OOM error reporting
上级 7fcb42e9
......@@ -3595,6 +3595,11 @@ lxcDomainAttachDeviceHostdevSubsysUSBLive(virLXCDriverPtr driver,
mode = 0700 | S_IFCHR;
if (VIR_REALLOC_N(vm->def->hostdevs, vm->def->nhostdevs + 1) < 0) {
virReportOOMError();
goto cleanup;
}
if (virFileMakePath(dstdir) < 0) {
virReportSystemError(errno,
_("Unable to create %s"), dstdir);
......@@ -3620,6 +3625,8 @@ lxcDomainAttachDeviceHostdevSubsysUSBLive(virLXCDriverPtr driver,
priv->cgroup) < 0)
goto cleanup;
vm->def->hostdevs[vm->def->nhostdevs++] = def;
ret = 0;
cleanup:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册