Bug 182328 - "Error: [Errno 17] File exists" on xm create due to dangling /var/lib/xen/xenbl
Summary: "Error: [Errno 17] File exists" on xm create due to dangling /var/lib/xen/xenbl
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: xen
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jeremy Katz
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: FC5Blocker
TreeView+ depends on / blocked
 
Reported: 2006-02-21 21:08 UTC by Stephen Tweedie
Modified: 2007-11-30 22:11 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2006-02-23 21:53:40 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Always delete the /var/lib/xen/xenbl file on error. (2.36 KB, patch)
2006-02-21 21:13 UTC, Stephen Tweedie
no flags Details | Diff

Description Stephen Tweedie 2006-02-21 21:08:26 UTC
Description of problem:
/var/lib/xen/xenbl can be left behind, leading to spurious

[root@xentest1 ~]# xm create -c guest1
Using config file "/etc/xen/guest1".
Error: [Errno 17] File exists

errors.

Version-Release number of selected component (if applicable):
xen-3.0.1-0.20060208.fc5.2

xen/tools/python/xen/xend/XenBootloader.py creates the xenbl FIFO to communicate
to a subprocess but does not delete it for all errors; nor does it handle
multiple instances running at the same time.

Comment 1 Stephen Tweedie 2006-02-21 21:13:00 UTC
Created attachment 124983 [details]
Always delete the /var/lib/xen/xenbl file on error.

Simple XenBootloader.py patch to add a try...finally: construct to make sure we
delete /var/lib/xen/xenbl on error.

We still need to handle the case where it exists on entry, by forming a new
filename (based on pid?) to avoid collisions.

Comment 2 Jeremy Katz 2006-02-22 20:35:18 UTC
I vaguely remember there being a reason why I was using a defined name instead
of actually doing a mktemp'd name.  Let me look further

Comment 3 Jeremy Katz 2006-02-23 21:53:40 UTC
Can't tell what it was.  Committed a fix to CVS and sent upstream


Note You need to log in before you can comment on or make changes to this bug.