Make XenAPI agent configuration synchronous

Fixes bug 897887

Much of the XenAPI agent configuration happens asynchronously from the
spawn process. This allows the instance to go ACTIVE state earlier and
leaves the possibility of a race with delete open. This makes the
steps synchronous, ensuring the process only goes to ACTIVE after the
configuration is done.

Change-Id: I294b595128979e153c797d9e610b66bc76f47666
This commit is contained in:
Johannes Erdfelt
2011-12-12 18:01:54 +00:00
parent e48aad7b28
commit 8ac7846ee8

View File

@@ -188,7 +188,7 @@ class XenAPIVolumeTestCase(test.TestCase):
self.stubs.UnsetAll()
def reset_network(*args):
def configure_instance(*args):
pass
@@ -214,7 +214,8 @@ class XenAPIVMTestCase(test.TestCase):
stubs.stubout_get_this_vm_uuid(self.stubs)
stubs.stubout_stream_disk(self.stubs)
stubs.stubout_is_vdi_pv(self.stubs)
self.stubs.Set(vmops.VMOps, 'reset_network', reset_network)
self.stubs.Set(vmops.VMOps, '_configure_instance',
configure_instance)
self.stubs.Set(vmops.VMOps, '_find_rescue_vbd_ref',
_find_rescue_vbd_ref)
stubs.stub_out_vm_methods(self.stubs)