Re: [PATCH 04/13] qemu: domain: Store passthrough environment variables in a struct

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

 



On Thu, Aug 05, 2021 at 17:34:20 +0200, Peter Krempa wrote:
> Previously they were stored in two separate arrays. This way it's
> obvious when referencing the same one.
> 
> Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
> ---
>  src/qemu/qemu_command.c |  4 ++--
>  src/qemu/qemu_domain.c  | 45 +++++++++++++++++++++++------------------
>  src/qemu/qemu_domain.h  |  9 +++++++--
>  3 files changed, 34 insertions(+), 24 deletions(-)

[...]

> diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
> index 6f8c93ea0c..21668cae4c 100644
> --- a/src/qemu/qemu_domain.c
> +++ b/src/qemu/qemu_domain.c
> @@ -3319,12 +3319,17 @@ virDomainXMLPrivateDataCallbacks virQEMUDriverPrivateDataCallbacks = {
>  static void
>  qemuDomainXmlNsDefFree(qemuDomainXmlNsDef *def)
>  {
> +    size_t i;
> +
>      if (!def)
>          return;
> 
> +    for (i = 0; i < def->num_env; i++) {
> +        g_free(def->env[i].name);
> +        g_free(def->env[i].value);
> +    }
> +
>      virStringListFreeCount(def->args, def->num_args);

Consider the following squashed in:

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index f5d4db33bf..bc448e48a4 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -3328,6 +3328,7 @@ qemuDomainXmlNsDefFree(qemuDomainXmlNsDef *def)
         g_free(def->env[i].name);
         g_free(def->env[i].value);
     }
+    g_free(def->env);

     g_strfreev(def->args);
     g_strfreev(def->capsadd);




[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