Re: [PATCH] qemu: Clean up qemuDomainSecretPrepare

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



ping?  It's perhaps trivial, but nonetheless...

Tks,

John

On 08/30/2017 03:48 PM, John Ferlan wrote:
> No need to pass a @driver parameter since all that's done is deref
> the @cfg especially since the only caller can just pass an already
> referenced @cfg.
> 
> Also, looks like commit id '0298531b' at one time had a different
> name for the API, so I took the liberty of fixing the comments too
> since I would already be updating them for the @cfg variable.
> 
> Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
> ---
>  Saw this while doing some updates for the recently posted VxHS series.
> 
>  src/qemu/qemu_domain.c  | 11 ++++-------
>  src/qemu/qemu_domain.h  |  2 +-
>  src/qemu/qemu_process.c |  2 +-
>  3 files changed, 6 insertions(+), 9 deletions(-)
> 
> diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
> index cbee151..4cd0087 100644
> --- a/src/qemu/qemu_domain.c
> +++ b/src/qemu/qemu_domain.c
> @@ -7454,7 +7454,7 @@ qemuDomainPrepareChannel(virDomainChrDefPtr channel,
>  }
>  
>  
> -/* qemuProcessPrepareDomainChardevSourceTLS:
> +/* qemuDomainPrepareChardevSourceTLS:
>   * @source: pointer to host interface data for char devices
>   * @cfg: driver configuration
>   *
> @@ -7478,19 +7478,18 @@ qemuDomainPrepareChardevSourceTLS(virDomainChrSourceDefPtr source,
>  }
>  
>  
> -/* qemuProcessPrepareDomainChardevSource:
> +/* qemuDomainPrepareChardevSource:
>   * @def: live domain definition
> - * @driver: qemu driver
> + * @cfg: driver configuration
>   *
>   * Iterate through all devices that use virDomainChrSourceDefPtr as host
>   * interface part.
>   */
>  void
>  qemuDomainPrepareChardevSource(virDomainDefPtr def,
> -                               virQEMUDriverPtr driver)
> +                               virQEMUDriverConfigPtr cfg)
>  {
>      size_t i;
> -    virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
>  
>      for (i = 0; i < def->nserials; i++)
>          qemuDomainPrepareChardevSourceTLS(def->serials[i]->source, cfg);
> @@ -7515,8 +7514,6 @@ qemuDomainPrepareChardevSource(virDomainDefPtr def,
>  
>      for (i = 0; i < def->nredirdevs; i++)
>          qemuDomainPrepareChardevSourceTLS(def->redirdevs[i]->source, cfg);
> -
> -    virObjectUnref(cfg);
>  }
>  
>  
> diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
> index f93b09b..4b030ae 100644
> --- a/src/qemu/qemu_domain.h
> +++ b/src/qemu/qemu_domain.h
> @@ -842,7 +842,7 @@ void qemuDomainPrepareChardevSourceTLS(virDomainChrSourceDefPtr source,
>      ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
>  
>  void qemuDomainPrepareChardevSource(virDomainDefPtr def,
> -                                    virQEMUDriverPtr driver)
> +                                    virQEMUDriverConfigPtr cfg)
>      ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2);
>  
>  int qemuDomainPrepareShmemChardev(virDomainShmemDefPtr shmem)
> diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
> index 364c359..44df858 100644
> --- a/src/qemu/qemu_process.c
> +++ b/src/qemu/qemu_process.c
> @@ -5327,7 +5327,7 @@ qemuProcessPrepareDomain(virConnectPtr conn,
>          goto cleanup;
>  
>      VIR_DEBUG("Prepare chardev source backends for TLS");
> -    qemuDomainPrepareChardevSource(vm->def, driver);
> +    qemuDomainPrepareChardevSource(vm->def, cfg);
>  
>      VIR_DEBUG("Add secrets to disks, hostdevs, and chardevs");
>      if (qemuDomainSecretPrepare(conn, driver, vm) < 0)
> 

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux