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

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


  • To: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
  • 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
  • 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=

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



 


Rackspace

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