]> xenbits.xensource.com Git - libvirt.git/commitdiff
Record hotplugged USB device in LXC live guest config
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 4 Feb 2014 16:46:28 +0000 (16:46 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Mon, 17 Feb 2014 15:39:37 +0000 (15:39 +0000)
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>
src/lxc/lxc_driver.c

index a381cbd29525c8da58a874aebedd8095c06aa25b..fa299dae2e86612b1d51103d7d4924870cdae700 100644 (file)
@@ -3973,6 +3973,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);
@@ -4001,6 +4004,8 @@ lxcDomainAttachDeviceHostdevSubsysUSBLive(virLXCDriverPtr driver,
                                 priv->cgroup) < 0)
         goto cleanup;
 
+    vm->def->hostdevs[vm->def->nhostdevs++] = def;
+
     ret = 0;
 
 cleanup: