]> git.ipfire.org Git - thirdparty/libvirt.git/commit
esx: Fix dynamic dispatch for CastFromAnyType functions
authorMatthias Bolte <matthias.bolte@googlemail.com>
Mon, 25 Apr 2011 10:38:17 +0000 (12:38 +0200)
committerMatthias Bolte <matthias.bolte@googlemail.com>
Wed, 27 Apr 2011 07:33:02 +0000 (09:33 +0200)
commit4a9019afbb640616528ad601a86840b8e4beefc1
treea0ecdbdf01fd0d92caac0453278c66dc29ee4a4d
parent3ba5d77f3c817cfe8029dba8212d96d3a98a5ff9
esx: Fix dynamic dispatch for CastFromAnyType functions

This was broken by the refactoring in ac1e6586ec75. It resulted in a
segfault for 'virsh vol-dumpxml' and related volume functions.

Before the refactoring all users of the ESX_VI__TEMPLATE__DISPATCH
macro dispatched on the item type, as the item is the input to all those
functions.

Commit ac1e6586ec75 made the dynamically dispatched CastFromAnyType
functions use this macro too, but this functions dispatched on the
actual type of the AnyType object. The item is the output of the
CastFromAnyType functions.

This difference was missed in the refactoring, making CastFromAnyType
functions dereferencing the item pointer that is NULL at the time of
the dispatch.
src/esx/esx_vi_types.c