summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2014-02-04 16:46:28 +0000
committerDaniel P. Berrange <berrange@redhat.com>2014-02-18 15:52:22 +0000
commit869961c1a2dc718d6272b3218e0263d58d4a6648 (patch)
treead267ccb9cfa7f5a6b5c61074499df1e5bd6e9ca
parentd0ddd54a6706b7bfbc2ff1c2d3352331a8857660 (diff)
downloadlibvirt-869961c1a2dc718d6272b3218e0263d58d4a6648.tar.gz
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)
-rw-r--r--src/lxc/lxc_driver.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index bcb9793019..4da2a44421 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -3378,6 +3378,9 @@ lxcDomainAttachDeviceHostdevSubsysUSBLive(virLXCDriverPtr driver,
mode = 0700 | S_IFCHR;
+ if (VIR_REALLOC_N(vm->def->hostdevs, vm->def->nhostdevs + 1) < 0)
+ goto cleanup;
+
if (virFileMakePath(dstdir) < 0) {
virReportSystemError(errno,
_("Unable to create %s"), dstdir);
@@ -3406,6 +3409,8 @@ lxcDomainAttachDeviceHostdevSubsysUSBLive(virLXCDriverPtr driver,
priv->cgroup) < 0)
goto cleanup;
+ vm->def->hostdevs[vm->def->nhostdevs++] = def;
+
ret = 0;
cleanup: