diff options
author | Rick Harris <rconradharris@gmail.com> | 2013-01-29 00:19:24 +0000 |
---|---|---|
committer | Rick Harris <rconradharris@gmail.com> | 2013-01-30 18:06:02 +0000 |
commit | 21b4531927ab786ec4c45ee26d94fccfb45bc951 (patch) | |
tree | 75307fa6806d0d676406c785732ed6ee34b5286e | |
parent | 8ab6a0fd9e16f650e202c8cf631fa03004451d9f (diff) | |
download | nova-21b4531927ab786ec4c45ee26d94fccfb45bc951.tar.gz nova-21b4531927ab786ec4c45ee26d94fccfb45bc951.tar.xz nova-21b4531927ab786ec4c45ee26d94fccfb45bc951.zip |
xenapi: Ax unecessary `block_device_info` params
The xenapi driver uses the 'osvol' other_config to determine which
volumes to detach, making `block_device_info` unecessary for internal
functions.
`destroy` still needs to accept the param since it's part of the
virt-driver API.
Change-Id: I1bbd69f41f9a1e18d4759d0ef3c6de027d3c9981
-rw-r--r-- | nova/virt/xenapi/vmops.py | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/nova/virt/xenapi/vmops.py b/nova/virt/xenapi/vmops.py index 4a8372cda..e10b52ad6 100644 --- a/nova/virt/xenapi/vmops.py +++ b/nova/virt/xenapi/vmops.py @@ -183,7 +183,7 @@ class VMOps(object): def confirm_migration(self, migration, instance, network_info): name_label = self._get_orig_vm_name_label(instance) vm_ref = vm_utils.lookup(self._session, name_label) - return self._destroy(instance, vm_ref, network_info) + return self._destroy(instance, vm_ref, network_info=network_info) def _attach_mapped_block_devices(self, instance, block_device_info): # We are attaching these volumes before start (no hotplugging) @@ -294,7 +294,7 @@ class VMOps(object): def create_disks_step(undo_mgr, disk_image_type, image_meta): vdis = self._create_disks(context, instance, name_label, disk_image_type, image_meta, - block_device_info) + block_device_info=block_device_info) def undo_create_disks(): vdi_refs = [vdi['ref'] for vdi in vdis.values() @@ -338,7 +338,7 @@ class VMOps(object): vdis, disk_image_type, kernel_file, ramdisk_file) def undo_create_vm(): - self._destroy(instance, vm_ref, network_info) + self._destroy(instance, vm_ref, network_info=network_info) undo_mgr.undo_with(undo_create_vm) return vm_ref @@ -998,7 +998,7 @@ class VMOps(object): raise exception.NotFound(_("Unable to find root VBD/VDI for VM")) - def _detach_vm_vols(self, instance, vm_ref, block_device_info=None): + def _detach_vm_vols(self, instance, vm_ref): """Detach any external nova/cinder volumes and purge the SRs. This differs from a normal detach in that the VM has been shutdown, so there is no need for unplugging VBDs. They do @@ -1020,7 +1020,7 @@ class VMOps(object): LOG.exception(exc) raise - def _destroy_vdis(self, instance, vm_ref, block_device_info=None): + def _destroy_vdis(self, instance, vm_ref): """Destroys all VDIs associated with a VM.""" LOG.debug(_("Destroying VDIs"), instance=instance) @@ -1102,12 +1102,14 @@ class VMOps(object): if rescue_vm_ref: self._destroy_rescue_instance(rescue_vm_ref, vm_ref) - return self._destroy(instance, vm_ref, network_info, - block_device_info=block_device_info, + # NOTE(sirp): `block_device_info` is not used, information about which + # volumes should be detached is determined by the + # VBD.other_config['osvol'] attribute + return self._destroy(instance, vm_ref, network_info=network_info, destroy_disks=destroy_disks) def _destroy(self, instance, vm_ref, network_info=None, - block_device_info=None, destroy_disks=True): + destroy_disks=True): """Destroys VM instance by performing: 1. A shutdown @@ -1123,10 +1125,9 @@ class VMOps(object): vm_utils.hard_shutdown_vm(self._session, instance, vm_ref) - # Destroy VDIs (if necessary) if destroy_disks: - self._detach_vm_vols(instance, vm_ref, block_device_info) - self._destroy_vdis(instance, vm_ref, block_device_info) + self._detach_vm_vols(instance, vm_ref) + self._destroy_vdis(instance, vm_ref) self._destroy_kernel_ramdisk(instance, vm_ref) vm_utils.destroy_vm(self._session, instance, vm_ref) |