[libvirt] [PATCH v2 07/25] conf: Add virDomainDeviceSetData

Andrea Bolognani abologna at redhat.com
Thu Jan 24 16:02:19 UTC 2019


On Wed, 2019-01-23 at 16:32 -0500, Cole Robinson wrote:
[...]
> +/**
> + * virDomainDeviceSetData
> + * @device: virDomainDeviceDefPtr with ->type filled in
> + * @data: *DefPtr data for a device. Ex: virDomainDiskDefPtr
> + *
> + * Set the data.X variable for the device->type value. Basically
> + * a mapping of virDomainDeviceType to the associated name in
> + * the virDomainDeviceDef union
> + */
> +void
> +virDomainDeviceSetData(virDomainDeviceDefPtr device,
> +                       void *devicedata)

Documentation doesn't match signature: use either 'devicedata'
or 'data' in both cases. I personally prefer the latter, but either
one is fine :)

Additionally, please move both the implementation...

[...]
> @@ -2937,6 +2937,9 @@ virDomainDeviceDefPtr virDomainDeviceDefCopy(virDomainDeviceDefPtr src,
>  virDomainDeviceInfoPtr virDomainDeviceGetInfo(virDomainDeviceDefPtr device);
>  void virDomainTPMDefFree(virDomainTPMDefPtr def);
>  
> +void virDomainDeviceSetData(virDomainDeviceDefPtr device,
> +                            void *devicedata);
> +

... and the declaration right after virDomainDeviceGetInfo(), as
they're very closely related.

With the above addressed,

  Reviewed-by: Andrea Bolognani <abologna at redhat.com>

-- 
Andrea Bolognani / Red Hat / Virtualization




More information about the libvir-list mailing list