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)
Backport fixed for OOM error reporting
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);
priv->cgroup) < 0)
goto cleanup;
+ vm->def->hostdevs[vm->def->nhostdevs++] = def;
+
ret = 0;
cleanup: