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

Re: [Xen-users] Problems starting xend


  • To: Ian Pratt <m+Ian.Pratt@xxxxxxxxxxxx>
  • 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=
  • List-id: Xen user discussion <xen-users.lists.xensource.com>

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

 


Rackspace

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