From: Chunyan Liu Date: Thu, 17 Sep 2015 05:15:22 +0000 (-0400) Subject: libxl: fix AttachDeviceConfig on hostdev type X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=56945e1374bd254148643d76a98fba9be67fba15;p=people%2Fliuw%2Flibxenctrl-split%2Flibvirt.git libxl: fix AttachDeviceConfig on hostdev type After attach-device a with --config, new device doesn't show up in dumpxml and in guest. To fix that, set dev->data.hostdev = NULL after work so that the pointer is not freed, since vmdef has the pointer and still need it. Signed-off-by: Chunyan Liu --- diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index e2797d527..8087c2779 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -3312,6 +3312,7 @@ libxlDomainAttachDeviceConfig(virDomainDefPtr vmdef, virDomainDeviceDefPtr dev) if (virDomainHostdevInsert(vmdef, hostdev) < 0) return -1; + dev->data.hostdev = NULL; break; default: