[libvirt] [PATCH v2 01/10] Change parameters to qemuDomainAttachDeviceLive

Martin Kletzander mkletzan at redhat.com
Mon Jul 25 09:39:09 UTC 2016


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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20160725/2a73e466/attachment-0001.sig>


More information about the libvir-list mailing list