WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] Triggering hotplug scripts multiple times

To: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Subject: Re: [Xen-devel] Triggering hotplug scripts multiple times
From: Jacob Gorm Hansen <jacobg@xxxxxxx>
Date: Fri, 30 Mar 2007 11:25:50 +0200
Cc: Jacob Gorm Hansen <jacobg@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Fri, 30 Mar 2007 10:27:12 +0100
Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:date:from:to:cc:subject:message-id:references:mime-version:content-type:content-disposition:in-reply-to:user-agent:sender; b=jjMSZUl5Rk5j5Z2cYOywvuzEL4aCpLlIZthN//mmej/PTfft62GkGHeX/LnLxj//B2jkQ1gE27iBhnBXG5s9s8xuVCUoVxsG0Hl7yC0woJc36cQ1l1oJAF6MH2kX4ZgV09uqdOUi8rzvVe0A/MydF51T9uSzoEEdICJN4TcWseU=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:date:from:to:cc:subject:message-id:references:mime-version:content-type:content-disposition:in-reply-to:user-agent:sender; b=pMf19FBfSb4KvQbZKR2VQLoiEo3et/utvZ3TTIWKdUIPKKwMFm35vlM3IwYvgmoR2kJef1PnQsqtDcn7r9JWsL+q5fE6bu0hxOUOCc1v/Q5XjGhEFso+8Tti4q5FAron94GZSnvvVk6qMQ2StsclEfGMuY3msJX2Qx9lrGcPpQ0=
Envelope-to: Keir.Fraser@xxxxxxxxxxxx
In-reply-to: <C232841E.5274%Keir.Fraser@xxxxxxxxxxxx>
References: <20070330080149.GA3725@xxxxxxxxxxxxxxxxxxxx> <C232841E.5274%Keir.Fraser@xxxxxxxxxxxx>
Sender: Jacob Gorm Hansen <jacobgorm@xxxxxxxxx>
User-agent: Mutt/1.5.12-2006-07-14
On Fri, Mar 30, 2007 at 09:08:46AM +0100, Keir Fraser wrote:
> 
> 
> 
> On 30/3/07 09:01, "Jacob Gorm Hansen" <jacobg@xxxxxxx> wrote:
> 
> > I am not sure what the correct workaround is, other than paying
> > attention to the quality of hotplug scripts.  Somehow it feels wrong
> > that a guest domain is able to arbitrarily trigger scripts in dom0,
> > though the ability to restart devices is a necessity for unprivileged
> > boot-loaders.  Perhaps the hotplug scripts should only be triggered
> > once, the first time the frontend is configured?
> 
> I thought the scripts only triggered when the backend device was first
> created. I don't think they should need to execute on frontend state
> transitions.

Problem is that if the domain disconnects from the netif, which it has
to when handing over the device to the domU kernel from a bootloader,
the netif is destroyed, and when the new one is created the hotplug
script gets kicked, e.g.:

case XenbusStateInitialising:
if (dev->state == XenbusStateClosed) {
        printk("%s: %s: prepare for reconnect\n", __FUNCTION__, dev->nodename);
        if (be->netif) {
                netif_disconnect(be->netif);
                be->netif = NULL;
        }
        xenbus_switch_state(dev, XenbusStateInitWait);
}

I suppose one could postpone freeing the netif until the domain has gone
away.

Another problem with how this currently works is that vifs don't get
garbage collected properly if the domain is killed without a proper
shutdown. 


Jacob