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] vbd devices stuck in Initialising/InitWait

To: "Christopher S. Aker" <caker@xxxxxxxxxxxx>
Subject: Re: [Xen-devel] vbd devices stuck in Initialising/InitWait
From: Ewan Mellor <ewan@xxxxxxxxxxxxx>
Date: Thu, 30 Mar 2006 17:49:02 +0100
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 30 Mar 2006 16:50:37 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <442B556A.8000907@xxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <4429C801.7070900@xxxxxxxxxxxx> <20060329085320.GA31336@xxxxxxxxxxxxxxxxxxxxxx> <442B150D.6000903@xxxxxxxxxxxx> <442B556A.8000907@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.9i
On Wed, Mar 29, 2006 at 09:50:02PM -0600, Christopher S. Aker wrote:

> Christopher S. Aker wrote:
> >When devices are missing, talk_to_backend() is making duplicate calls 
> >for the same vbd to xenbus_switch_state(), and on the second call 
> >xenbus_switch_state avoids writing to xenstore an identical value (which 
> >it's supposed to).  Why the duplicate calls?
> 
> That got me thinking .. The duplicate calls are happening for some 
> reason, but they're never attempting to write out the state value again 
> because of this code in xenbus_switch_state():
> 
> if (state == dev->state) {
>       return 0;
> }
> 
> The initial call to xenbus_switch_state() _did_ set the value in 
> dev->state, it just never made it into xenstore even though the 
> xenbus_printf call didn't return an error.
> 
> So, commenting out the code above makes everything work.  15 reboots and 
> all the devices have show up every time.
> 
> I don't know why the first call to xenbus_switch_state() isn't really 
> writing out the value to xenstore. xenbus_printf() isn't returning an 
> error, but still the value fails to make it into the store.  That's the 
> best of my understanding at the moment...

I've figured this one out.  The duplicate calls are coming because the call to
xenbus_switch_state is inside a transaction, which is then aborted and
retried.  This breaks, because of the test above -- the state has been cached
locally, but it's not actually made it to the store, because the transaction
fails.

xenbus_switch_state simply shouldn't be being called in a transaction.  I am
testing a patch at the moment that should solve this problem for you.

Cheers,

Ewan.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel