]> xenbits.xensource.com Git - osstest/openstack-nova.git/commitdiff
Merge "libvirt: Combine injection info in InjectionInfo"
authorJenkins <jenkins@review.openstack.org>
Wed, 7 Dec 2016 13:32:37 +0000 (13:32 +0000)
committerGerrit Code Review <review@openstack.org>
Wed, 7 Dec 2016 13:32:37 +0000 (13:32 +0000)
1  2 
nova/tests/unit/virt/libvirt/test_driver.py
nova/virt/libvirt/driver.py

index 892cd044311fdc5a73cefd93333b5a2838872877,353bfb3aef4ae77847064b257de7f67553412694..b666718362c96542a787af54d9a6fe2d0c79171a
@@@ -2939,18 -2935,16 +2935,17 @@@ class LibvirtDriver(driver.ComputeDrive
          return 'rbd' if CONF.libvirt.images_type == 'rbd' else 'raw'
  
      @staticmethod
 -    def _is_booted_from_volume(instance, disk_mapping):
 +    def _is_booted_from_volume(block_device_info):
          """Determines whether the VM is booting from volume
  
 -        Determines whether the disk mapping indicates that the VM
 +        Determines whether the block device info indicates that the VM
          is booting from a volume.
          """
 -        return ((not bool(instance.get('image_ref')))
 -                or 'disk' not in disk_mapping)
 +        block_device_mapping = driver.block_device_info_get_mapping(
 +            block_device_info)
 +        return bool(block_device.get_root_bdm(block_device_mapping))
  
-     def _inject_data(self, injection_image, instance, network_info,
-                      admin_pass, files):
+     def _inject_data(self, disk, instance, injection_info):
          """Injects data in a disk image
  
          Helper used for injecting data in a disk image file system.
      # method doesn't fail if an image already exists but instead
      # think that it will be reused (ie: (live)-migration/resize)
      def _create_image(self, context, instance,
-                       disk_mapping, suffix='',
-                       disk_images=None, network_info=None,
-                       block_device_info=None, files=None,
-                       admin_pass=None, inject_files=True,
+                       disk_mapping, injection_info=None, suffix='',
+                       disk_images=None, block_device_info=None,
                        fallback_from_host=None,
                        ignore_bdi_for_swap=False):
 -        booted_from_volume = self._is_booted_from_volume(
 -            instance, disk_mapping)
 +        booted_from_volume = self._is_booted_from_volume(block_device_info)
  
          def image(fname, image_type=CONF.libvirt.images_type):
              return self.image_backend.by_name(instance,