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

Re: [Xen-devel] [PATCH 2/3] libxl: don't execute hotplug scripts if device is on a driver domain



On 03/05/13 13:44, Ian Campbell wrote:
> On Fri, 2013-05-03 at 12:23 +0100, Roger Pau Monne wrote:
>> Prevent hotplug script execution from libxl if device is on a
>> different domain.
> 
> The assumption being that the user has enabled udev in the driver
> domain?

Yes, although it doesn't have to be udev specifically, for example
something similar to xenbackendd could be used in the driver domain, but
I have only tested it with udev.

> 
> Is a log message going to be worthwhile?

There's already one log message earlier in disk_try_backend, but I guess
it won't hurt to add another one here, specifically saying that hotplug
scripts will not be executed by libxl for this specific device.

> Does this obsolete run_hotplug_scripts somewhat?

Not really, it just prevents libxl from calling hotplug scripts that
will surely fail (because the domain where the toolstack is running
doesn't have access to the device). run_hotplug_scripts tells whether
hotplug scripts will be executed by udev or libxl, so this code just
changes the behaviour when run_hotplug_scripts == 1 and backend_domid !=
TOOLSTACK_DOMID.

> 
>> Signed-off-by: Roger Pau Monnà <roger.pau@xxxxxxxxxx>
>> Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
>> Cc: Ian Jackson <ian.jackson@xxxxxxxxxx>
>> Cc: George Dunlap <george.dunlap@xxxxxxxxxx>
>> ---
>>  tools/libxl/libxl_device.c |    7 +++++++
>>  1 files changed, 7 insertions(+), 0 deletions(-)
>>
>> diff --git a/tools/libxl/libxl_device.c b/tools/libxl/libxl_device.c
>> index b1fc4ef..bc86648 100644
>> --- a/tools/libxl/libxl_device.c
>> +++ b/tools/libxl/libxl_device.c
>> @@ -903,6 +903,13 @@ static void device_hotplug(libxl__egc *egc, 
>> libxl__ao_device *aodev)
>>      int hotplug;
>>      pid_t pid;
>>  
>> +    /*
>> +     * If device is attached from a driver domain don't try to execute
>> +     * hotplug scripts
>> +     */
>> +    if (aodev->dev->backend_domid != LIBXL_TOOLSTACK_DOMID)
>> +        goto out;
>> +
>>      /* Check if we have to execute hotplug scripts for this device
>>       * and return the necessary args/env vars for execution */
>>      hotplug = libxl__get_hotplug_script_info(gc, aodev->dev, &args, &env,
> 
> 


_______________________________________________
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®.