mirror of
https://github.com/libvirt/libvirt.git
synced 2026-10-02 12:20:06 -05:00
esx: Allow esxVI_X_DynamicCast to be called successfully on X objects
This semantic will be used in the ESX storage driver.
This commit is contained in:
1 parent
10c681622a
commit
90fce23f24
1 file changed
+9
-7
@@ -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) \
|
||||
\
|
||||
_accept \
|
||||
\
|
||||
return NULL; \
|
||||
@@ -557,13 +566,6 @@
|
||||
|
||||
|
||||
|
||||
#define ESX_VI__TEMPLATE__DYNAMIC_CAST__ACCEPT(__type) \
|
||||
if (((esxVI_Object *)item)->_type == esxVI_Type_##__type) { \
|
||||
return item; \
|
||||
}
|
||||
|
||||
|
||||
|
||||
#define ESX_VI__TEMPLATE__DYNAMIC_SERIALIZE(__type, _dispatch, _serialize) \
|
||||
ESX_VI__TEMPLATE__SERIALIZE_EXTRA(__type, \
|
||||
ESX_VI__TEMPLATE__DISPATCH(__type, _dispatch, -1), \
|
||||
|
||||
Reference in new issue
Block a user