libxl: refactor DEFINE_DEVICE_REMOVE to fit for more device types
authorChunyan Liu <cyliu@suse.com>
Wed, 9 Mar 2016 02:10:11 +0000 (10:10 +0800)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Fri, 18 Mar 2016 12:17:22 +0000 (12:17 +0000)
commit127b37578c51524d87f3d3ab9d0113b64fa83734
tree10c72d63c07f0c6e1a7c1751e6d1dfdd5a84e5b8
parentbc023ecda5ae253e7488723e85472e08c2a0d127
libxl: refactor DEFINE_DEVICE_REMOVE to fit for more device types

For some device type, device removal operation needs to be
handled specially, like usbctrl, it needs to remove all usb
devices under it first, then remove usbctrl. Extend
DEFINE_DEVICE_REMOVE to support generic and custom way
For those need to be handled specially, call
DEFINE_DEVICE_REMOVE_CUSTOM, it requires user defined
libxl__initiate_device_##type##_remove. Otherwise, just
call DEFINE_DEVICE_REMOVE as before.

Signed-off-by: George Dunlap <george.dunlap@citrix.com>
Signed-off-by: Chunyan Liu <cyliu@suse.com>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxl.c
tools/libxl/libxl_device.c
tools/libxl/libxl_internal.h