Merge lp:~berendt/nova/lp719325 into lp:~hudson-openstack/nova/trunk

Proposed by Christian Berendt
Status: Merged
Approved by: Todd Willey
Approved revision: 707
Merged at revision: 707
Proposed branch: lp:~berendt/nova/lp719325
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 21 lines (+3/-1)
1 file modified
nova/virt/disk.py (+3/-1)
To merge this branch: bzr merge lp:~berendt/nova/lp719325
Reviewer Review Type Date Requested Status
Todd Willey (community) Approve
Jay Pipes (community) Approve
Review via email: mp+50607@code.launchpad.net

Description of the change

introducing a new flag timeout_nbd for manually setting the time in seconds for waiting for an upcoming NBD device

To post a comment you must log in.
Revision history for this message
Jay Pipes (jaypipes) wrote :

Think you might have forgotten to bzr commit or bzr push, Christian :) Empty diff.

Revision history for this message
Christian Berendt (berendt) wrote :

I always forget one of those.. This time it was commit.. Knarf..

lp:~berendt/nova/lp719325 updated
707. By Christian Berendt

introducing a new flag timeout_nbd for manually setting the time in seconds for waiting for an upcoming NBD device

Revision history for this message
Jay Pipes (jaypipes) wrote :

lgtm :)

review: Approve
Revision history for this message
Todd Willey (xtoddx) wrote :

This change is fine, but we really should document flags somewhere.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'nova/virt/disk.py'
--- nova/virt/disk.py 2011-01-13 23:13:31 +0000
+++ nova/virt/disk.py 2011-02-21 15:19:16 +0000
@@ -38,6 +38,8 @@
38 'minimum size in bytes of root partition')38 'minimum size in bytes of root partition')
39flags.DEFINE_integer('block_size', 1024 * 1024 * 256,39flags.DEFINE_integer('block_size', 1024 * 1024 * 256,
40 'block_size to use for dd')40 'block_size to use for dd')
41flags.DEFINE_integer('timeout_nbd', 10,
42 'time to wait for a NBD device coming up')
4143
4244
43def extend(image, size):45def extend(image, size):
@@ -117,7 +119,7 @@
117 utils.execute('sudo qemu-nbd -c %s %s' % (device, image))119 utils.execute('sudo qemu-nbd -c %s %s' % (device, image))
118 # NOTE(vish): this forks into another process, so give it a chance120 # NOTE(vish): this forks into another process, so give it a chance
119 # to set up before continuuing121 # to set up before continuuing
120 for i in xrange(10):122 for i in xrange(FLAGS.timeout_nbd):
121 if os.path.exists("/sys/block/%s/pid" % os.path.basename(device)):123 if os.path.exists("/sys/block/%s/pid" % os.path.basename(device)):
122 return device124 return device
123 time.sleep(1)125 time.sleep(1)