From 17c0a1aad98effa4554a9083b35185f2d430d81f Mon Sep 17 00:00:00 2001 From: Ewan Mellor Date: Sun, 28 Aug 2011 23:40:09 +0530 Subject: In the XenAPI simulator, set VM.domid, when creating the instance initially, and when starting the VM. This shows up in the logs for Bug #831599, but this fix doesn't actually fix the hang. --- nova/virt/xenapi/fake.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'nova/virt') diff --git a/nova/virt/xenapi/fake.py b/nova/virt/xenapi/fake.py index 7c91aa9b9..399f6ec54 100644 --- a/nova/virt/xenapi/fake.py +++ b/nova/virt/xenapi/fake.py @@ -51,6 +51,7 @@ A fake XenAPI SDK. """ +import random import uuid from pprint import pformat @@ -103,8 +104,10 @@ 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 return _create_object('VM', {'name_label': name_label, + 'domid': domid, 'power-state': status, 'is_a_template': is_a_template, 'is_control_domain': is_control_domain}) -- cgit From c35086ca2d2ac1a519442217bf89c0572b28053b Mon Sep 17 00:00:00 2001 From: Ewan Mellor Date: Mon, 29 Aug 2011 00:41:14 +0530 Subject: Start domid's at 1, not 0, to avoid any confusion with dom0. --- nova/virt/xenapi/fake.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nova/virt') 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, -- cgit