Bug 182328 - "Error: [Errno 17] File exists" on xm create due to dangling /var/lib/xen/xenbl
"Error: [Errno 17] File exists" on xm create due to dangling /var/lib/xen/xenbl
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: xen (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jeremy Katz
:
Depends On:
Blocks: FC5Blocker
  Show dependency treegraph
 
Reported: 2006-02-21 16:08 EST by Stephen Tweedie
Modified: 2007-11-30 17:11 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-02-23 16:53:40 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


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

  None (edit)
Description Stephen Tweedie 2006-02-21 16:08:26 EST
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 16:13:00 EST
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 15:35:18 EST
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 16:53:40 EST
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.