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: Daniel P. Berrange <berrange@redhat.com> (cherry picked from commit a537827d15516f2b59afb23ce2d50b8a88d7f090)
This commit is contained in:
parent
79754d40bf
commit
d2fc280c9b
@ -3336,6 +3336,9 @@ lxcDomainAttachDeviceHostdevSubsysUSBLive(virLXCDriverPtr driver,
|
|||||||
|
|
||||||
mode = 0700 | S_IFCHR;
|
mode = 0700 | S_IFCHR;
|
||||||
|
|
||||||
|
if (VIR_REALLOC_N(vm->def->hostdevs, vm->def->nhostdevs + 1) < 0)
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
if (virFileMakePath(dstdir) < 0) {
|
if (virFileMakePath(dstdir) < 0) {
|
||||||
virReportSystemError(errno,
|
virReportSystemError(errno,
|
||||||
_("Unable to create %s"), dstdir);
|
_("Unable to create %s"), dstdir);
|
||||||
@ -3364,6 +3367,8 @@ lxcDomainAttachDeviceHostdevSubsysUSBLive(virLXCDriverPtr driver,
|
|||||||
priv->cgroup) < 0)
|
priv->cgroup) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
vm->def->hostdevs[vm->def->nhostdevs++] = def;
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user