diff options
author | Yufang Zhang <yufang521247@gmail.com> | 2013-01-14 21:02:40 +0800 |
---|---|---|
committer | Yufang Zhang <yufang521247@gmail.com> | 2013-01-15 11:02:13 +0800 |
commit | 2adf6399b43102b5998f4779e6976b2b5296de6f (patch) | |
tree | fd237bf7585226cba06197ce3f593007669ad7e3 | |
parent | aa18fca87fd4655c47e473639a30a6b61ed88fce (diff) | |
download | nova-2adf6399b43102b5998f4779e6976b2b5296de6f.tar.gz nova-2adf6399b43102b5998f4779e6976b2b5296de6f.tar.xz nova-2adf6399b43102b5998f4779e6976b2b5296de6f.zip |
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:
<disk type="file" device="disk">
<driver name="file" type="qcow2" cache="none"/>
<source file="/data/instances/instance-00000081/disk"/>
<target bus="xen" dev="hda"/>
</disk>
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
-rw-r--r-- | nova/tests/test_libvirt.py | 2 | ||||
-rw-r--r-- | 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: |