---
src/lxc/lxc_driver.c | 10 +++++-----
src/qemu/qemu_driver.c | 8 ++++----
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index fe583ccb76..7bc39120ee 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -4308,17 +4308,17 @@ static int lxcDomainAttachDeviceFlags(virDomainPtr dom,
false) < 0)
goto endjob;
- if ((ret = lxcDomainAttachDeviceConfig(vmdef, dev)) < 0)
+ if ((ret = lxcDomainAttachDeviceConfig(vmdef, dev_copy)) < 0)
goto endjob;
}
if (flags & VIR_DOMAIN_AFFECT_LIVE) {
- if (virDomainDefCompatibleDevice(vm->def, dev_copy, NULL,
+ if (virDomainDefCompatibleDevice(vm->def, dev, NULL,
VIR_DOMAIN_DEVICE_ACTION_ATTACH,
true) < 0)
goto endjob;
- if ((ret = lxcDomainAttachDeviceLive(driver, vm, dev_copy)) < 0)
+ if ((ret = lxcDomainAttachDeviceLive(driver, vm, dev)) < 0)
goto endjob;
/*
* update domain status forcibly because the domain status may be
@@ -4475,12 +4475,12 @@ static int lxcDomainDetachDeviceFlags(virDomainPtr dom,
if (!vmdef)
goto endjob;
- if ((ret = lxcDomainDetachDeviceConfig(vmdef, dev)) < 0)
+ if ((ret = lxcDomainDetachDeviceConfig(vmdef, dev_copy)) < 0)
goto endjob;
}
if (flags & VIR_DOMAIN_AFFECT_LIVE) {
- if ((ret = lxcDomainDetachDeviceLive(driver, vm, dev_copy)) < 0)
+ if ((ret = lxcDomainDetachDeviceLive(driver, vm, dev)) < 0)
goto endjob;
/*
* update domain status forcibly because the domain status may be
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index b8537a4260..b1255da9f2 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -8020,7 +8020,7 @@ static int qemuDomainUpdateDeviceFlags(virDomainPtr dom,
/* virDomainDefCompatibleDevice call is delayed until we know the
* device we're going to update. */
- if ((ret = qemuDomainUpdateDeviceConfig(vmdef, dev, priv->qemuCaps,
+ if ((ret = qemuDomainUpdateDeviceConfig(vmdef, dev_copy, priv->qemuCaps,
parse_flags,
driver->xmlopt)) < 0)
goto endjob;
@@ -8029,7 +8029,7 @@ static int qemuDomainUpdateDeviceFlags(virDomainPtr dom,
if (flags & VIR_DOMAIN_AFFECT_LIVE) {
/* virDomainDefCompatibleDevice call is delayed until we know the
* device we're going to update. */
- if ((ret = qemuDomainUpdateDeviceLive(vm, dev_copy, dom, force)) < 0)
+ if ((ret = qemuDomainUpdateDeviceLive(vm, dev, dom, force)) < 0)
goto endjob;
qemuDomainSaveStatus(vm);
@@ -8100,7 +8100,7 @@ qemuDomainDetachDeviceLiveAndConfig(virQEMUDriver *driver,
if (!vmdef)
goto cleanup;
- if (qemuDomainDetachDeviceConfig(vmdef, dev, priv->qemuCaps,
+ if (qemuDomainDetachDeviceConfig(vmdef, dev_copy, priv->qemuCaps,
parse_flags,
driver->xmlopt) < 0)
goto cleanup;
@@ -8109,7 +8109,7 @@ qemuDomainDetachDeviceLiveAndConfig(virQEMUDriver *driver,
if (flags & VIR_DOMAIN_AFFECT_LIVE) {
int rc;
- if ((rc = qemuDomainDetachDeviceLive(vm, dev_copy, driver, false)) < 0)
+ if ((rc = qemuDomainDetachDeviceLive(vm, dev, driver, false)) < 0)
goto cleanup;
if (rc == 0 && qemuDomainUpdateDeviceList(driver, vm, QEMU_ASYNC_JOB_NONE) < 0)