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

Re: [Xen-devel] [PATCH RFC 03/12] libxl: make hotplug execution conditional on backend_domid == domid



On Mon, 2013-09-23 at 12:30 +0200, Roger Pau Monne wrote:
> libxl currently refuses to execute hotplug scripts if the backend
> domid of a device is different than LIBXL_TOOLSTACK_DOMID. This will
> prevent libxl from executing hotplug scripts when running on a domain
> different than LIBXL_TOOLSTACK_DOMID, we should instead check if
> backend_domid is different than current domid.
> 
> Signed-off-by: Roger Pau Monnà <roger.pau@xxxxxxxxxx>
> Cc: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>

Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

Although as I read the rest of the series I may wonder if this should'be
be a parameter which comes in i.e. handle_hotplug_events_for_domid.
We'll see.

> ---
>  tools/libxl/libxl_device.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
> index 2971dd3..48acc92 100644
> --- a/tools/libxl/libxl_device.c
> +++ b/tools/libxl/libxl_device.c
> @@ -908,12 +908,15 @@ static void device_hotplug(libxl__egc *egc, 
> libxl__ao_device *aodev)
>      int rc = 0;
>      int hotplug;
>      pid_t pid;
> +    uint32_t domid;
>  
>      /*
>       * If device is attached from a driver domain don't try to execute
>       * hotplug scripts
>       */
> -    if (aodev->dev->backend_domid != LIBXL_TOOLSTACK_DOMID)
> +    rc = libxl__get_domid(gc, &domid);
> +    if (rc) goto out;
> +    if (aodev->dev->backend_domid != domid)
>          goto out;
>  
>      /* Check if we have to execute hotplug scripts for this device



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

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