From: Shivaprasad G Bhat <sbhat(a)linux.vnet.ibm.com>
Helps calling multiple time per device.
Signed-off-by: Shivaprasad G Bhat <sbhat(a)linux.vnet.ibm.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413(a)gmail.com>
---
src/qemu/qemu_driver.c | 23 +++++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 43a3ffea99..f880a5d6cf 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -7824,9 +7824,9 @@ qemuDomainUndefine(virDomainPtr dom)
}
static int
-qemuDomainAttachDeviceLive(virDomainObjPtr vm,
- virDomainDeviceDefPtr dev,
- virQEMUDriverPtr driver)
+qemuDomainAttachDeviceLiveInternal(virDomainObjPtr vm,
+ virDomainDeviceDefPtr dev,
+ virQEMUDriverPtr driver)
{
int ret = -1;
const char *alias = NULL;
@@ -7972,13 +7972,28 @@ qemuDomainAttachDeviceLive(virDomainObjPtr vm,
virObjectEventStateQueue(driver->domainEventState, event);
}
+ return ret;
+}
+
+static int
+qemuDomainAttachDeviceLive(virDomainObjPtr vm,
+ virDomainDeviceDefPtr dev,
+ virQEMUDriverPtr driver)
+{
+ int ret = -1;
+
+ if (virDomainDefCompatibleDevice(vm->def, dev, NULL,
+ VIR_DOMAIN_DEVICE_ACTION_ATTACH,
+ false) < 0)
+ return -1;
+
+ ret = qemuDomainAttachDeviceLiveInternal(vm, dev, driver);
if (ret == 0)
ret = qemuDomainUpdateDeviceList(driver, vm, QEMU_ASYNC_JOB_NONE);
return ret;
}
-
static int
qemuDomainChangeDiskLive(virDomainObjPtr vm,
virDomainDeviceDefPtr dev,
--
2.26.2