From 2adf6399b43102b5998f4779e6976b2b5296de6f Mon Sep 17 00:00:00 2001 From: Yufang Zhang Date: Mon, 14 Jan 2013 21:02:40 +0800 Subject: libvirt: use tap for non-blockdevice images on Xen This patch reverts 35c4962c0b97bae5b8751d316d5822fe22c1ab6a: 'use file instead of tap for non-blockdevice images on Xen', which breaks qcow2 disk working on Xen. If the method pick_disk_driver_name() returns 'file' for qcow2 format, we would get the following disk XML snippet: which produces configuration in the xen tools like: "file:/data/instances/instance-00000081/disk,hda,w" Guest would not boot successfully, as Xen doesn't think of disk format as qcow2. Instead, 'tap' works with both raw and qcow2 disk. For LP#1084618, I think it is related with libvirt verion. In my deployment(libvirt-1.0.1), 'tap' dirver could produce correct configuration for both raw and qcow2 disk format. Change-Id: I636b2fed366474e2ae8c3b52403e3085724b24f0 --- nova/tests/test_libvirt.py | 2 +- nova/virt/libvirt/utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nova/tests/test_libvirt.py b/nova/tests/test_libvirt.py index 53bb1b984..329823d61 100644 --- a/nova/tests/test_libvirt.py +++ b/nova/tests/test_libvirt.py @@ -4092,7 +4092,7 @@ class LibvirtUtilsTestCase(test.TestCase): def test_pick_disk_driver_name(self): type_map = {'kvm': ([True, 'qemu'], [False, 'qemu'], [None, 'qemu']), 'qemu': ([True, 'qemu'], [False, 'qemu'], [None, 'qemu']), - 'xen': ([True, 'phy'], [False, 'file'], [None, 'file']), + 'xen': ([True, 'phy'], [False, 'tap'], [None, 'tap']), 'uml': ([True, None], [False, None], [None, None]), 'lxc': ([True, None], [False, None], [None, None])} diff --git a/nova/virt/libvirt/utils.py b/nova/virt/libvirt/utils.py index 9c8d192c7..0884c6260 100644 --- a/nova/virt/libvirt/utils.py +++ b/nova/virt/libvirt/utils.py @@ -272,7 +272,7 @@ def pick_disk_driver_name(is_block_dev=False): if is_block_dev: return "phy" else: - return "file" + return "tap" elif CONF.libvirt_type in ('kvm', 'qemu'): return "qemu" else: -- cgit