Merge "compute: Take an instance.uuid lock when rebooting" into stable/stein

This commit is contained in:
Zuul 2019-12-06 18:34:26 +00:00 committed by Gerrit Code Review
commit 75b47936b3
1 changed files with 9 additions and 0 deletions

View File

@ -3549,6 +3549,15 @@ class ComputeManager(manager.Manager):
@wrap_instance_fault
def reboot_instance(self, context, instance, block_device_info,
reboot_type):
@utils.synchronized(instance.uuid)
def do_reboot_instance(context, instance, block_device_info,
reboot_type):
self._reboot_instance(context, instance, block_device_info,
reboot_type)
do_reboot_instance(context, instance, block_device_info, reboot_type)
def _reboot_instance(self, context, instance, block_device_info,
reboot_type):
"""Reboot an instance on this host."""
# acknowledge the request made it to the manager
if reboot_type == "SOFT":