mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +00:00
ESX: Fix ESX_VI__TEMPLATE__DYNAMIC_DEEP_COPY
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@hotmail.com>
This commit is contained in:
parent
d4611c0ee3
commit
04d9cf8e6c
1
AUTHORS
1
AUTHORS
@ -250,6 +250,7 @@ Patches have also been contributed by:
|
||||
Sascha Peilicke <saschpe@suse.de>
|
||||
Chuck Short <chuck.short@canonical.com>
|
||||
Sebastian Wiedenroth <wiedi@frubar.net>
|
||||
Ata E Husain Bohra <ata.husain@hotmail.com>
|
||||
[....send patches to get your name here....]
|
||||
|
||||
The libvirt Logo was designed by Diana Fong
|
||||
|
@ -832,7 +832,7 @@ class Object(Type):
|
||||
else:
|
||||
if self.features & Object.FEATURE__DEEP_COPY:
|
||||
source += "/* esxVI_%s_DeepCopy */\n" % self.name
|
||||
source += "ESX_VI__TEMPLATE__DYNAMIC_DEEP_COPY(%s)\n" % self.name
|
||||
source += "ESX_VI__TEMPLATE__DYNAMIC_DEEP_COPY(%s,\n" % self.name
|
||||
source += "{\n"
|
||||
|
||||
for extended_by in self.extended_by:
|
||||
|
@ -559,7 +559,7 @@
|
||||
|
||||
#define ESX_VI__TEMPLATE__DISPATCH__DEEP_COPY(_type) \
|
||||
case esxVI_Type_##_type: \
|
||||
return esxVI_##_type##_DeepCopy((esxVI_##_type **)dst, \
|
||||
return esxVI_##_type##_DeepCopy((esxVI_##_type **)dest, \
|
||||
(esxVI_##_type *)src);
|
||||
|
||||
|
||||
@ -618,6 +618,13 @@
|
||||
|
||||
|
||||
|
||||
#define ESX_VI__TEMPLATE__DYNAMIC_DEEP_COPY(__type, _dispatch, _deep_copy) \
|
||||
ESX_VI__TEMPLATE__DEEP_COPY(__type, \
|
||||
ESX_VI__TEMPLATE__DISPATCH(src->_type, __type, _dispatch, -1) \
|
||||
_deep_copy)
|
||||
|
||||
|
||||
|
||||
#define ESX_VI__TEMPLATE__DYNAMIC_CAST_FROM_ANY_TYPE(__type, _dispatch) \
|
||||
ESX_VI__TEMPLATE__CAST_FROM_ANY_TYPE_EXTRA(__type, esxVI_##__type, \
|
||||
ESX_VI__TEMPLATE__DISPATCH(anyType->type, __type, _dispatch, -1), \
|
||||
@ -1337,6 +1344,12 @@ ESX_VI__TEMPLATE__VALIDATE(Long,
|
||||
/* esxVI_Long_AppendToList */
|
||||
ESX_VI__TEMPLATE__LIST__APPEND(Long)
|
||||
|
||||
/* esxVI_Long_DeepCopy */
|
||||
ESX_VI__TEMPLATE__DEEP_COPY(Long,
|
||||
{
|
||||
(*dest)->value = src->value;
|
||||
})
|
||||
|
||||
/* esxVI_Long_CastFromAnyType */
|
||||
ESX_VI__TEMPLATE__CAST_FROM_ANY_TYPE(Long)
|
||||
|
||||
|
@ -236,6 +236,7 @@ int esxVI_Long_Alloc(esxVI_Long **number);
|
||||
void esxVI_Long_Free(esxVI_Long **numberList);
|
||||
int esxVI_Long_Validate(esxVI_Long *number);
|
||||
int esxVI_Long_AppendToList(esxVI_Long **numberList, esxVI_Long *number);
|
||||
int esxVI_Long_DeepCopy(esxVI_Long **dest, esxVI_Long *src);
|
||||
int esxVI_Long_CastFromAnyType(esxVI_AnyType *anyType, esxVI_Long **number);
|
||||
int esxVI_Long_Serialize(esxVI_Long *number, const char *element,
|
||||
virBufferPtr output);
|
||||
|
Loading…
x
Reference in New Issue
Block a user