[libvirt] [PATCH v3 08/10] qemu: remove virConnectPtr in some migration methods

John Ferlan jferlan at redhat.com
Fri Feb 16 22:02:34 UTC 2018



On 02/16/2018 06:22 AM, Daniel P. Berrangé wrote:
> The qemuMigrationPrecreateStorage method needs a connection
> to access the storage driver. Instead of passing it around,
> open it at time of use.
> 
> Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
> ---
>  src/qemu/qemu_driver.c    | 16 +++++++--------
>  src/qemu/qemu_migration.c | 51 ++++++++++++++++++++++-------------------------
>  src/qemu/qemu_migration.h |  4 +---
>  3 files changed, 33 insertions(+), 38 deletions(-)
> 

[...]

>  
> diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
> index 312d717617..6edadac719 100644
> --- a/src/qemu/qemu_migration.c
> +++ b/src/qemu/qemu_migration.c

[...]

>  static int doPeer2PeerMigrate2(virQEMUDriverPtr driver,
> -                               virConnectPtr sconn ATTRIBUTE_UNUSED,
> +                               virConnectPtr sconn,

I know this has an impact in later patches too, but @sconn is only used
for (duplicated) debug prints...

>                                 virConnectPtr dconn,
>                                 virDomainObjPtr vm,
>                                 const char *dconnuri,
> @@ -4654,7 +4651,7 @@ doPeer2PeerMigrate3(virQEMUDriverPtr driver,

Same here it seems.  Removing affects the calling stack a bit, but I
think would be the right thing to do.


Signed-off-by: John Ferlan <jferlan at redhat.com>

John

>      cookieinlen = cookieoutlen;
>      cookieout = NULL;
>      cookieoutlen = 0;
> -    ret = qemuMigrationConfirmPhase(driver, sconn, vm,
> +    ret = qemuMigrationConfirmPhase(driver, vm,
>                                      cookiein, cookieinlen,
>                                      flags, cancelled);
>      /* If Confirm3 returns -1, there's nothing more we can

[...]




More information about the libvir-list mailing list