libvirt: fix missing block device mapping parameter

This change caused a regression:

  commit 024ac74ffb
  Author: Daniel P. Berrange <berrange@redhat.com>
  Date:   Tue Dec 16 14:24:23 2014 +0000

    libvirt: always pass image meta when getting disk info from bdm

A merge rebase mistake there caused the block device mapping
parameter to get dropped when when get_root_info calls
get_info_from_bdm. For added fun the test case had the same
mistake so everything looked fine. The result was that boot from
volume was broken

Closes-bug: #1416321
Change-Id: Ieaf2d6c456f8bcc4bc7a0ffe7dc912c7cc8b3dc6
This commit is contained in:
Daniel P. Berrange 2015-01-30 14:55:50 +00:00
parent d59dd36015
commit 0ba9132436
2 changed files with 4 additions and 4 deletions

View File

@ -787,13 +787,13 @@ class LibvirtBlockInfoTest(test.NoDBTestCase):
# No root_device_name
blockinfo.get_root_info('kvm', image_meta, root_bdm, 'virtio', 'ide')
mock_get_info.assert_called_once_with('kvm', image_meta,
root_bdm, 'virtio')
root_bdm, {}, 'virtio')
mock_get_info.reset_mock()
# Both device names
blockinfo.get_root_info('kvm', image_meta, root_bdm, 'virtio', 'ide',
root_device_name='sda')
mock_get_info.assert_called_once_with('kvm', image_meta,
root_bdm, 'virtio')
root_bdm, {}, 'virtio')
mock_get_info.reset_mock()
# Missing device names
del root_bdm['mount_device']
@ -804,7 +804,7 @@ class LibvirtBlockInfoTest(test.NoDBTestCase):
{'device_name': 'sda',
'disk_bus': 'scsi',
'device_type': 'disk'},
'virtio')
{}, 'virtio')
def test_get_boot_order_simple(self):
disk_info = {

View File

@ -429,7 +429,7 @@ def get_root_info(virt_type, image_meta, root_bdm, disk_bus, cdrom_bus,
root_bdm = root_bdm.copy()
root_bdm['device_name'] = root_device_name
return get_info_from_bdm(virt_type, image_meta,
root_bdm, disk_bus)
root_bdm, {}, disk_bus)
def default_device_names(virt_type, context, instance, root_device_name,