[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] libxl: cleanup remaining backend xs dirs after driver domain



commit c992efd06a4c092f6fb3b8ab10d4f8ca35d42bbd
Author:     Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
AuthorDate: Sun Nov 8 15:59:42 2020 +0100
Commit:     Wei Liu <wl@xxxxxxx>
CommitDate: Tue Jan 5 12:33:55 2021 +0000

    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@xxxxxxxxxxxxxxxxxxxxxx>
    Acked-by: Wei Liu <wl@xxxxxxx>
---
 tools/libs/light/libxl_device.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tools/libs/light/libxl_device.c b/tools/libs/light/libxl_device.c
index ac173a043d..36c4e41e4d 100644
--- a/tools/libs/light/libxl_device.c
+++ b/tools/libs/light/libxl_device.c
@@ -763,6 +763,12 @@ int libxl__device_destroy(libxl__gc *gc, libxl__device 
*dev)
              * from the backend path.
              */
             libxl__xs_path_cleanup(gc, t, be_path);
+        } else if (domid == LIBXL_TOOLSTACK_DOMID && !libxl_only) {
+            /*
+             * Then, toolstack domain is in charge of removing the parent
+             * directory if empty already.
+             */
+            libxl__xs_path_cleanup(gc, t, be_path);
         }
 
         rc = libxl__xs_transaction_commit(gc, &t);
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.