Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

Commit

Permalink
libxl: fix the cleanup of the backend path when using driver domains
Browse files Browse the repository at this point in the history
With the current libxl implementation the control domain will remove both
the frontend and the backend xenstore paths of a device that's handled by a
driver domain. This is incorrect, since the driver domain possibly needs to
access the backend path in order to perform the disconnection and cleanup of
the device.

Fix this by making sure the control domain only cleans the frontend path,
leaving the backend path to be cleaned by the driver domain. Note that if
the device is not handled by a driver domain the control domain will perform
the removal of both the frontend and the backend paths.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Reported-by: Alex Velazquez <alex.j.velazquez@gmail.com>
Cc: Alex Velazquez <alex.j.velazquez@gmail.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
  • Loading branch information
royger authored and Ian Campbell committed Sep 24, 2015
1 parent 5c9a00c commit 546678c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tools/libxl/libxl_device.c
Expand Up @@ -591,15 +591,15 @@ int libxl__device_destroy(libxl__gc *gc, libxl__device *dev)

if (domid == LIBXL_TOOLSTACK_DOMID) {
/*
* The toolstack domain is in charge for removing both the
* frontend and the backend path
* The toolstack domain is in charge of removing the
* frontend path.
*/
libxl__xs_path_cleanup(gc, t, fe_path);
libxl__xs_path_cleanup(gc, t, be_path);
} else if (dev->backend_domid == domid) {
}
if (dev->backend_domid == domid) {
/*
* The driver domain is in charge for removing what it can
* from the backend path
* The driver domain is in charge of removing what it can
* from the backend path.
*/
libxl__xs_path_cleanup(gc, t, be_path);
}
Expand Down

0 comments on commit 546678c

Please sign in to comment.