implement clean test to check if device is coming up after using qemu-nbd
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Wishlist
|
Unassigned |
Bug Description
I don't like the used test (sleeping for 1 second and recheck afterwards). Please implement some clean test to check if the device is coming up after running qemu-nbd...
in nova/virt/disk.py:
def _link_device(image, nbd):
"""Link image to device using loopback or nbd"""
if nbd:
device = _allocate_device()
# NOTE(vish): this forks into another process, so give it a chance
# to set up before continuuing
for i in xrange(10):
if os.path.
raise exception.
else:
out, err = utils.execute('sudo losetup --find --show %s' % image)
if err:
raise exception.
return out.strip()
Related branches
- Todd Willey (community): Approve
- Jay Pipes (community): Approve
-
Diff: 21 lines (+3/-1)1 file modifiednova/virt/disk.py (+3/-1)
Changed in nova: | |
importance: | Undecided → Wishlist |
Changed in nova: | |
milestone: | none → 2011.2 |
status: | Fix Committed → Fix Released |
I'm afraid this is the best we can do. nbd is notoriously difficult to get feedback from.