|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH RFC 05/12] libxl: don't remove device backend path if not local
On Mon, 2013-09-23 at 12:30 +0200, Roger Pau Monne wrote:
> If the backend of a device is running on a driver domain, it should be
> the driver domain itself the one to clean the backend path once the
> device has been successfully disconnected.
>
> And the opposite way, a domain different than LIBXL_TOOLSTACK_DOMID
> should not try to remove the frontend paths of a device.
>
> Signed-off-by: Roger Pau Monnà <roger.pau@xxxxxxxxxx>
> Cc: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
> ---
> tools/libxl/libxl_device.c | 10 ++++++++--
> 1 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
> index 48acc92..082bd2a 100644
> --- a/tools/libxl/libxl_device.c
> +++ b/tools/libxl/libxl_device.c
> @@ -562,6 +562,10 @@ int libxl__device_destroy(libxl__gc *gc, libxl__device
> *dev)
> const char *tapdisk_params;
> xs_transaction_t t = 0;
> int rc;
> + uint32_t domid;
> +
> + rc = libxl__get_domid(gc, &domid);
> + if (rc) goto out;
>
> for (;;) {
> rc = libxl__xs_transaction_start(gc, &t);
> @@ -571,8 +575,10 @@ int libxl__device_destroy(libxl__gc *gc, libxl__device
> *dev)
> rc = libxl__xs_read_checked(gc, t, tapdisk_path, &tapdisk_params);
> if (rc) goto out;
>
> - libxl__xs_path_cleanup(gc, t, fe_path);
> - libxl__xs_path_cleanup(gc, t, be_path);
> + if (domid == LIBXL_TOOLSTACK_DOMID)
> + libxl__xs_path_cleanup(gc, t, fe_path);
> + if (dev->backend_domid == domid)
> + libxl__xs_path_cleanup(gc, t, be_path);
>
> rc = libxl__xs_transaction_commit(gc, &t);
> if (!rc) break;
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |