]> xenbits.xensource.com Git - libvirt.git/commitdiff
ESX: Fix ESX_VI__TEMPLATE__DYNAMIC_DEEP_COPY
authorAta E Husain Bohra <ata.husain@hotmail.com>
Thu, 19 Jul 2012 06:14:18 +0000 (23:14 -0700)
committerMatthias Bolte <matthias.bolte@googlemail.com>
Sat, 21 Jul 2012 21:24:25 +0000 (23:24 +0200)
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>
AUTHORS
src/esx/esx_vi_generator.py
src/esx/esx_vi_types.c
src/esx/esx_vi_types.h

diff --git a/AUTHORS b/AUTHORS
index 092e279d1f9fed1f9e4d5e9bc3595e38cd53c998..ca823895adfe4d72195055b9d36bf97984feab27 100644 (file)
--- a/AUTHORS
+++ b/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
index 8a128df9e123c7bf992b3c9e8ed53c277e98f30a..97b8e15f36dca1247bb2f426d237fbfc459e08e8 100755 (executable)
@@ -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:
index 9e67effbbef7f1e8fcff6375bd93204e76c40d29..8e22b66b8128cd1d95a7e244d34abec3f249c42a 100644 (file)
 
 #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);
 
 
 
 
 
+#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)
 
index 3d843bff9f80b5d14fc2373d9889a962fd97f6d2..a44d78325752cb5aef24f5574a0cbe399192c4ac 100644 (file)
@@ -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);