summaryrefslogtreecommitdiffstats
path: root/nova/virt
diff options
context:
space:
mode:
authorJosh Kearney <josh.kearney@rackspace.com>2011-02-23 10:45:04 -0600
committerJosh Kearney <josh.kearney@rackspace.com>2011-02-23 10:45:04 -0600
commit58215533559a9fde3aa75e942fb547bb14aa9ecf (patch)
treebf26c56eaa1773325bc9b1b8f94675561de9e986 /nova/virt
parent78ed840ef2f7066c638a76cc3192fec2f93d8450 (diff)
parentafcec00e9e05031e1e7c086ff75fb05cf97c412d (diff)
Merged trunk
Diffstat (limited to 'nova/virt')
-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)