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-users

Re: [Xen-users] Problems starting xend

To: Ian Pratt <m+Ian.Pratt@xxxxxxxxxxxx>
Subject: Re: [Xen-users] Problems starting xend
From: aq <aquynh@xxxxxxxxx>
Date: Tue, 14 Jun 2005 07:35:34 -0700
Cc: Stewart Outram <stewart@xxxxxxxxxxxxxxxxxxx>, ian.pratt@xxxxxxxxxxxx, Xen User List <xen-users@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Tue, 14 Jun 2005 14:34:39 +0000
Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:references; b=O8uBkmrIcFKweBoAqaogLRfeSG5tDwrqbAO785u+bOVsr9a8D7c/92OtemkA15+piiHQjtSPWArNGvUvmRqq0BChfr68SLaWm6qjPxPqzt57Rtdsl41DR69sLDBebFmT+8QdqbO+mLjex7FRkjOdSajMezVE+oy5Fe2OPfoAxS0=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <A95E2296287EAD4EB592B5DEEFCE0E9D2821F3@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <A95E2296287EAD4EB592B5DEEFCE0E9D2821F3@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
Reply-to: aq <aquynh@xxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
On 6/14/05, Ian Pratt <m+Ian.Pratt@xxxxxxxxxxxx> wrote:
> > indeed, just checked out and the reason is pretty simple ;-)
> >
> > - python 2.3 doesnt complain if dircache.listdir() execute on
> > non-existent directory.
> > - python 2.4 spit out an error and stop on the same situation.
> >
> > now the problem is how to fix it. i propose checking for and
> > make necessary directories from Makefile, and that is clean
> > enough. any comment, Ian?
> 
> Thanks for investigating.
> 
> Having empty directories under /var in an install tar ball doesn't seem
> the right soloution. We could fix it in install.sh, but by far the best
> soloution would be to create the directories from within xend. Let's
> catch the exception from listdir and create the directory.
> 

i have another idea on solution to this problem.

the root of problem is XendDB::fetchall(): this method calls
dircache.listdir("dir-name"). python 2.3 has odd behavior: it doesnt
complain if the "dir-name" is non-existent, and still returns an empty
list. meanwhile, python 2.4 (properly) generates an exception and
stops.

it is tempting to make a directory in fetchall() in this case, but i
dont like that solution, because it would slightly change the semantic
of this method. the directory should be created later if needed, when
xend saves data.

in this patch, i adapt the trick from XendDB of -unstable: returns an
empty list in case the directory is non-existent. this is same as the
behaviour of python 2.3 on current code.

note that this problem only occurs with -stable and -testing, and this
patch is against -testing ChangeSet@xxxxxx

Signed-off-by: Nguyen Anh Quynh <aquynh@xxxxxxxxx>


$ diffstat xendmkdir.patch 
 XendDB.py |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

Attachment: xendmkdir.patch
Description: Binary data

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