libxl: make default path to add/remove all PV devices
authorOleksandr Grytsov <oleksandr_grytsov@epam.com>
Thu, 21 Nov 2019 18:13:00 +0000 (20:13 +0200)
committerWei Liu <wl@xen.org>
Mon, 25 Nov 2019 10:43:32 +0000 (10:43 +0000)
commit8f486344a00652ed202ade43c02c96771812bf8c
treeeb8aba6fa992277ea6a5bb905384438a9ee55f9c
parentc568b11da248daca832c160e29ee83e82ada8841
libxl: make default path to add/remove all PV devices

Adding/removing device is handled for specific devices only: VBD, VIF,
QDISK. This commit adds default case to handle adding/removing for all PV
devices by default, except QDISK device, which requires special handling.
If any other device is required a special handling it should be done by
implementing separate case (similar to QDISK device). The default
behaviour for adding device is to wait when the backend goes to
XenbusStateInitWait and the default behaviour on removing device is to
start generic device remove procedure.

Also this commit fixes removing guest function: before the guest was
removed when all VIF and VBD devices are removed. The fix removes
guest when all created devices are removed. This is done by checking the
guest device list instead of checking num_vifs and num_vbds. num_vifs and
num_vbds variables are removed as redundant in this case.

Signed-off-by: Oleksandr Grytsov <oleksandr_grytsov@epam.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Wei Liu <wl@xen.org>
Release-acked-by: Juergen Gross <jgross@suse.com>
tools/libxl/libxl_device.c