diff options
author | MORITA Kazutaka <morita.kazutaka@gmail.com> | 2011-01-13 20:59:02 +0900 |
---|---|---|
committer | MORITA Kazutaka <morita.kazutaka@gmail.com> | 2011-01-13 20:59:02 +0900 |
commit | 1c694e9093c627bd50b35e9fb0ae11adf315a154 (patch) | |
tree | 0899e9d459506e7f725b484223f56f3bde29949b | |
parent | b4600b088b61a5653be9a93a0497c9d80916c8c0 (diff) | |
download | nova-1c694e9093c627bd50b35e9fb0ae11adf315a154.tar.gz nova-1c694e9093c627bd50b35e9fb0ae11adf315a154.tar.xz nova-1c694e9093c627bd50b35e9fb0ae11adf315a154.zip |
Revert r510 and r512 because Josh had already done the same work
-rw-r--r-- | nova/virt/libvirt_conn.py | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/nova/virt/libvirt_conn.py b/nova/virt/libvirt_conn.py index 1ea3b0aa4..00edfbdc8 100644 --- a/nova/virt/libvirt_conn.py +++ b/nova/virt/libvirt_conn.py @@ -223,26 +223,11 @@ class LibvirtConnection(object): def attach_volume(self, instance_name, device_path, mountpoint): virt_dom = self._conn.lookupByName(instance_name) mount_device = mountpoint.rpartition("/")[2] - xml = '' - if device_path.startswith('/dev/'): - xml = """<disk type='block' device='disk'> - <driver name='qemu' type='raw'/> - <source dev='%s'/> - <target dev='%s' bus='virtio'/> - </disk>""" % (device_path, mount_device) - elif device_path.find(':') >= 0: - (protocol, vol_name) = device_path.split(':', 1) - xml = """<disk type='network' device='disk'> - <driver name='qemu' type='raw'/> - <source protocol='%s' name='%s'/> - <target dev='%s' bus='virtio'/> - </disk>""" % (protocol, vol_name, mount_device) - else: - xml = """<disk type='file' device='disk'> - <driver name='qemu' type='raw'/> - <source file='%s'/> - <target dev='%s' bus='virtio'/> - </disk>""" % (device_path, mount_device) + xml = """<disk type='block'> + <driver name='qemu' type='raw'/> + <source dev='%s'/> + <target dev='%s' bus='virtio'/> + </disk>""" % (device_path, mount_device) virt_dom.attachDevice(xml) def _get_disk_xml(self, xml, device): |