libxl: cleanup remaining backend xs dirs after driver domain
authorMarek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Sun, 8 Nov 2020 14:59:42 +0000 (15:59 +0100)
committerWei Liu <wl@xen.org>
Tue, 5 Jan 2021 12:33:55 +0000 (12:33 +0000)
commitc992efd06a4c092f6fb3b8ab10d4f8ca35d42bbd
tree284f239447e80252576662fe9ff2852850459789
parentc7115531ea8ede5c6ab27f972c1be6ecad388f55
libxl: cleanup remaining backend xs dirs after driver domain

When device is removed, backend domain (which may be a driver domain) is
responsible for removing backend entries from xenstore. But in case of
driver domain, it has no access to remove all of them - specifically the
directory named after frontend-id remains. This may accumulate enough to
exceed xenstore quote of the driver domain, breaking further devices.

Fix this by calling libxl__xs_path_cleanup() on the backend path from
libxl__device_destroy() in the toolstack domain too. Note
libxl__device_destroy() is called when the driver domain already removed
what it can (see device_destroy_be_watch_cb()->device_hotplug_done()).

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Acked-by: Wei Liu <wl@xen.org>
tools/libs/light/libxl_device.c