From 56945e1374bd254148643d76a98fba9be67fba15 Mon Sep 17 00:00:00 2001 From: Chunyan Liu Date: Thu, 17 Sep 2015 01:15:22 -0400 Subject: [PATCH] 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 --- src/libxl/libxl_driver.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index e2797d5275..8087c27797 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: -- 2.39.5