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
1=== modified file 'nova/virt/disk.py'
2--- nova/virt/disk.py 2011-01-13 23:13:31 +0000
3+++ nova/virt/disk.py 2011-02-21 15:19:16 +0000
4@@ -38,6 +38,8 @@
5 'minimum size in bytes of root partition')
6 flags.DEFINE_integer('block_size', 1024 * 1024 * 256,
7 'block_size to use for dd')
8+flags.DEFINE_integer('timeout_nbd', 10,
9+ 'time to wait for a NBD device coming up')
10
11
12 def extend(image, size):
13@@ -117,7 +119,7 @@
14 utils.execute('sudo qemu-nbd -c %s %s' % (device, image))
15 # NOTE(vish): this forks into another process, so give it a chance
16 # to set up before continuuing
17- for i in xrange(10):
18+ for i in xrange(FLAGS.timeout_nbd):
19 if os.path.exists("/sys/block/%s/pid" % os.path.basename(device)):
20 return device
21 time.sleep(1)