[libvirt] [Libvirt][PATCH] ESX: Fix ESX_VI__TEMPLATE__DYNAMIC_DEEP_COPY

Matthias Bolte matthias.bolte at googlemail.com
Sat Jul 21 21:39:09 UTC 2012


2012/7/19 Ata E Husain Bohra <ata.husain at hotmail.com>:
> Fix addresses two issues:
> 1. Fix generator code to allow deep copy operation for objects with
>    Dynamic_Cast capabilities.
> 2. Add missing deep copy routine to Long datatype.
> Signed-off-by: Ata E Husain Bohra <ata.husain at hotmail.com>

True, deep copy + dynamic dispatch is broken. This combination wasn't
tested as no VI type used it until now.

> index 844fb65..8211c93 100644
> --- a/src/esx/esx_vi_types.c
> +++ b/src/esx/esx_vi_types.c
> @@ -549,6 +549,21 @@
>      }
>
>
> +#define ESX_VI__TEMPLATE__DEEPCOPY_DISPATCH(_actual_type, __type, _dispatch,  \
> +                                            _error_return)                    \
> +    switch (_actual_type) {                                                   \
> +      _dispatch                                                               \
> +                                                                              \
> +      case esxVI_Type_##__type:                                               \
> +        break;                                                                \
> +                                                                              \
> +      default:                                                                \
> +        ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR,                                  \
> +                     _("Call to %s for unexpected type '%s'"), __FUNCTION__,  \
> +                     esxVI_Type_ToString(_actual_type));                      \
> +        return _error_return;                                                 \
> +    }
> +

No need for this extra copy of the ESX_VI__TEMPLATE__DISPATCH macro,
I'll remove it before pushing.

ACK and pushed, thanks.

-- 
Matthias Bolte
http://photron.blogspot.com




More information about the libvir-list mailing list