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

Re: [libvirt] [PATCH v2 1/2] device_conf: Split virDomainDeviceInfoClear



On Tue, 2018-08-21 at 12:12 +0200, Michal Privoznik wrote:
>  void
> -virDomainDeviceInfoClear(virDomainDeviceInfoPtr info)
> +virDomainDeviceInfoClearAddress(virDomainDeviceInfoPtr info)
>  {
> -    VIR_FREE(info->alias);
>      memset(&info->addr, 0, sizeof(info->addr));
>      info->type = VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE;
>      VIR_FREE(info->romfile);

Now virDomainDeviceInfoClearAddress() clears out *way more* than
just the address, including romfile and other information not
visible in the context... It should really only call memset and
reset info->type in order for the name not to be very misleading.

[...]
> +void
> +virDomainDeviceInfoClear(virDomainDeviceInfoPtr info)
> +{
> +    VIR_FREE(info->alias);
> +    virDomainDeviceInfoClearAddress(info);
> +}

romfile and friends should be cleared out here along with the alias
and, of course, the address :)

With that fixed

  Reviewed-by: Andrea Bolognani <abologna redhat com>

-- 
Andrea Bolognani / Red Hat / Virtualization


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