summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEwan Mellor <ewan.mellor@citrix.com>2011-08-29 00:41:14 +0530
committerEwan Mellor <ewan.mellor@citrix.com>2011-08-29 00:41:14 +0530
commitc35086ca2d2ac1a519442217bf89c0572b28053b (patch)
tree0880af11b95555b77bf4fec21fbc448bbfa0f05d
parent17c0a1aad98effa4554a9083b35185f2d430d81f (diff)
downloadnova-c35086ca2d2ac1a519442217bf89c0572b28053b.tar.gz
nova-c35086ca2d2ac1a519442217bf89c0572b28053b.tar.xz
nova-c35086ca2d2ac1a519442217bf89c0572b28053b.zip
Start domid's at 1, not 0, to avoid any confusion with dom0.
-rw-r--r--nova/tests/xenapi/stubs.py4
-rw-r--r--nova/virt/xenapi/fake.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/nova/tests/xenapi/stubs.py b/nova/tests/xenapi/stubs.py
index d309cfb88..647a4c1df 100644
--- a/nova/tests/xenapi/stubs.py
+++ b/nova/tests/xenapi/stubs.py
@@ -193,7 +193,7 @@ class FakeSessionForVMTests(fake.SessionBase):
vm['power_state'] = 'Running'
vm['is_a_template'] = False
vm['is_control_domain'] = False
- vm['domid'] = random.randrange(0, 1 << 16)
+ vm['domid'] = random.randrange(1, 1 << 16)
def VM_snapshot(self, session_ref, vm_ref, label):
status = "Running"
@@ -293,7 +293,7 @@ class FakeSessionForMigrationTests(fake.SessionBase):
vm['power_state'] = 'Running'
vm['is_a_template'] = False
vm['is_control_domain'] = False
- vm['domid'] = random.randrange(0, 1 << 16)
+ vm['domid'] = random.randrange(1, 1 << 16)
def stub_out_migration_methods(stubs):
diff --git a/nova/virt/xenapi/fake.py b/nova/virt/xenapi/fake.py
index 399f6ec54..97dfd9fa9 100644
--- a/nova/virt/xenapi/fake.py
+++ b/nova/virt/xenapi/fake.py
@@ -104,7 +104,7 @@ def create_network(name_label, bridge):
def create_vm(name_label, status,
is_a_template=False, is_control_domain=False):
- domid = status == 'Running' and random.randrange(0, 1 << 16) or -1
+ domid = status == 'Running' and random.randrange(1, 1 << 16) or -1
return _create_object('VM',
{'name_label': name_label,
'domid': domid,