Re: [PATCH] esx: Allow esxVI_X_DynamicCast to be called successfully on X objects

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

 



On 05/18/2010 10:30 AM, Matthias Bolte wrote:
> This semantic will be used in the ESX storage driver.
> ---
>  src/esx/esx_vi_types.c |   16 +++++++++-------
>  1 files changed, 9 insertions(+), 7 deletions(-)
> 
> diff --git a/src/esx/esx_vi_types.c b/src/esx/esx_vi_types.c
> index 7d2c02c..de2839f 100644
> --- a/src/esx/esx_vi_types.c
> +++ b/src/esx/esx_vi_types.c
> @@ -540,6 +540,13 @@
>  
>  
>  
> +#define ESX_VI__TEMPLATE__DYNAMIC_CAST__ACCEPT(__type)                        \
> +    if (((esxVI_Object *)item)->_type == esxVI_Type_##__type) {               \
> +        return item;                                                          \
> +    }
> +
> +
> +
>  #define ESX_VI__TEMPLATE__DYNAMIC_CAST(__type, _accept)                       \
>      esxVI_##__type *                                                          \
>      esxVI_##__type##_DynamicCast(void *item)                                  \
> @@ -550,6 +557,8 @@
>              return NULL;                                                      \
>          }                                                                     \
>                                                                                \
> +        ESX_VI__TEMPLATE__DYNAMIC_CAST__ACCEPT(__type)                        \
> +                                                                              \

Code motion and one additional use.  ACK.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

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