summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
authorChristian Berendt <berendt@b1-systems.de>2011-02-21 16:16:21 +0100
committerChristian Berendt <berendt@b1-systems.de>2011-02-21 16:16:21 +0100
commiteebb9bb14edb6fd1d218b3aa18142ee739ddd715 (patch)
treedb32345c52798f0600f2fcc05fb777e1108911fe /nova
parentbd0ca93866b48a7a65de8b97ab0ac0ac9c737f73 (diff)
downloadnova-eebb9bb14edb6fd1d218b3aa18142ee739ddd715.tar.gz
nova-eebb9bb14edb6fd1d218b3aa18142ee739ddd715.tar.xz
nova-eebb9bb14edb6fd1d218b3aa18142ee739ddd715.zip
introducing a new flag timeout_nbd for manually setting the time in seconds for waiting for an upcoming NBD device
Diffstat (limited to 'nova')
-rw-r--r--nova/virt/disk.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/nova/virt/disk.py b/nova/virt/disk.py
index c5565abfa..cb639a102 100644
--- a/nova/virt/disk.py
+++ b/nova/virt/disk.py
@@ -38,6 +38,8 @@ flags.DEFINE_integer('minimum_root_size', 1024 * 1024 * 1024 * 10,
'minimum size in bytes of root partition')
flags.DEFINE_integer('block_size', 1024 * 1024 * 256,
'block_size to use for dd')
+flags.DEFINE_integer('timeout_nbd', 10,
+ 'time to wait for a NBD device coming up')
def extend(image, size):
@@ -117,7 +119,7 @@ def _link_device(image, nbd):
utils.execute('sudo qemu-nbd -c %s %s' % (device, image))
# NOTE(vish): this forks into another process, so give it a chance
# to set up before continuuing
- for i in xrange(10):
+ for i in xrange(FLAGS.timeout_nbd):
if os.path.exists("/sys/block/%s/pid" % os.path.basename(device)):
return device
time.sleep(1)