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

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

 



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@xxxxxxxxxx>

-- 
Andrea Bolognani / Red Hat / Virtualization

--
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