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

Re: [Xen-devel] [PATCH 1/6] libxl: add "merge" function to generic device type support



On Tue, Jul 12, Juergen Gross wrote:

> Instead of using a macro generating the code to merge xenstore and
> json configuration data, use the generic device type support for
> this purpose.
> This requires to add some accessor functions to the framework and
> a structure for disks (as disks are added separately they didn't need
> such a structure up to now).

> +++ b/tools/libxl/libxl.c
> @@ -7371,93 +7371,68 @@ int libxl_retrieve_domain_configuration(libxl_ctx 
> *ctx, uint32_t domid,

> +            if (!dt->list || !dt->compare)
> +                continue;


This makes libxl_device_<type>_compare optional ...

> +#define DEFINE_DEVICE_TYPE_STRUCT_X(name, sname, ...)                        
>   \
> +    const struct libxl_device_type libxl__ ## name ## _devtype = {           
>   \
> +        .type          = #sname,                                             
>   \
> +        .ptr_offset    = offsetof(libxl_domain_config, name ## s),           
>   \
> +        .num_offset    = offsetof(libxl_domain_config, num_ ## name ## s),   
>   \
> +        .dev_elem_size = sizeof(libxl_device_ ## sname),                     
>   \
> +        .add           = libxl__add_ ## name ## s,                           
>   \
> +        .list          = (void *(*)(libxl_ctx *, uint32_t, int *))           
>   \
> +                         libxl_device_ ## sname ## _list,                    
>   \
> +        .dispose       = (void (*)(void *))libxl_device_ ## sname ## 
> _dispose, \
> +        .compare       = (int (*)(void *, void *))                           
>   \
> +                         libxl_device_ ## sname ## _compare,                 
>   \

... and this makes libxl_device_<type>_compare mandatory.

Which one is correct?

Olaf

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.