Re: [libvirt PATCH 02/14] virQEMUCapsSEVInfoCopy: Remove superfluous g_auto usage

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

 



On 1/12/22 14:10, Tim Wiederhake wrote:
> Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx>
> ---
>  src/qemu/qemu_capabilities.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
> index 5f1eb5014c..f8db6fd370 100644
> --- a/src/qemu/qemu_capabilities.c
> +++ b/src/qemu/qemu_capabilities.c
> @@ -1891,7 +1891,7 @@ static int
>  virQEMUCapsSEVInfoCopy(virSEVCapability **dst,
>                         virSEVCapability *src)
>  {
> -    g_autoptr(virSEVCapability) tmp = NULL;
> +    virSEVCapability *tmp;
>  
>      if (!src) {
>          *dst = NULL;
> @@ -1908,7 +1908,7 @@ virQEMUCapsSEVInfoCopy(virSEVCapability **dst,
>      tmp->max_guests = src->max_guests;
>      tmp->max_es_guests = src->max_es_guests;
>  
> -    *dst = g_steal_pointer(&tmp);
> +    *dst = tmp;
>      return 0;
>  }
>  

I have to admit that I find code as-is more future proof. If we ever
want to add a check there, it can simply return NULL, -1 or whatever.
But at the same time it's matter of preference.

Michal




[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