On Sat, Jul 16, 2016 at 02:42:46AM +0200, Tomasz Flendrich wrote:
We want to be able to pass a NULL instead of the connection
and use this function in tests. To achieve this, the virConnectPtr
is passed instead of virDomainPtr, and the driver is a new separate
parameter.
---
src/qemu/qemu_driver.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index cda85f6..9d1f256 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -8151,7 +8151,8 @@ qemuDomainAttachDeviceFlags(virDomainPtr dom,
VIR_DOMAIN_DEVICE_ACTION_ATTACH) < 0)
goto endjob;
- if ((ret = qemuDomainAttachDeviceLive(vm, dev_copy, dom)) < 0)
+ if ((ret = qemuDomainAttachDeviceLive(vm, dev_copy, dom->conn,
+ dom->conn->privateData)) < 0)
You can pass 'driver' here, it exists here in this function. Not only
it makes the line shorter, it will not bite us if we change the type of
the function parameter.