diff options
| author | Masanori Itoh <itoumsn@nttdata.co.jp> | 2011-04-19 00:01:45 +0900 |
|---|---|---|
| committer | Masanori Itoh <itoumsn@nttdata.co.jp> | 2011-04-19 00:01:45 +0900 |
| commit | 16da09697daa69c9e90b457ee13b31b6f258b3fb (patch) | |
| tree | 3323d39c37d0ba781c857e5cf6d808c6f19376aa /nova/virt | |
| parent | a4071098f0da6f23f53135b007bb74ec1a3d9166 (diff) | |
| parent | 03840792687b915d9ffdced12f415b3d093b40b2 (diff) | |
Rebased to trunk rev 995.
Diffstat (limited to 'nova/virt')
| -rw-r--r-- | nova/virt/libvirt_conn.py | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/nova/virt/libvirt_conn.py b/nova/virt/libvirt_conn.py index be765bb70..011bf3306 100644 --- a/nova/virt/libvirt_conn.py +++ b/nova/virt/libvirt_conn.py @@ -58,7 +58,6 @@ from nova import db from nova import exception from nova import flags from nova import log as logging -#from nova import test from nova import utils from nova import vnc from nova.auth import manager @@ -211,7 +210,6 @@ class LibvirtConnection(driver.ComputeDriver): self.libvirt_uri = self.get_uri() self.libvirt_xml = open(FLAGS.libvirt_xml_template).read() - self.interfaces_xml = open(FLAGS.injected_network_template).read() self.cpuinfo_xml = open(FLAGS.cpuinfo_xml_template).read() self._wrapped_conn = None self.read_only = read_only @@ -472,8 +470,8 @@ class LibvirtConnection(driver.ComputeDriver): metadata = {'disk_format': base['disk_format'], 'container_format': base['container_format'], 'is_public': False, + 'name': '%s.%s' % (base['name'], image_id), 'properties': {'architecture': base['architecture'], - 'name': '%s.%s' % (base['name'], image_id), 'kernel_id': instance['kernel_id'], 'image_location': 'snapshot', 'image_state': 'available', @@ -500,12 +498,17 @@ class LibvirtConnection(driver.ComputeDriver): # Export the snapshot to a raw image temp_dir = tempfile.mkdtemp() out_path = os.path.join(temp_dir, snapshot_name) - qemu_img_cmd = '%s convert -f qcow2 -O raw -s %s %s %s' % ( - FLAGS.qemu_img, - snapshot_name, - disk_path, - out_path) - utils.execute(qemu_img_cmd) + qemu_img_cmd = (FLAGS.qemu_img, + 'convert', + '-f', + 'qcow2', + '-O', + 'raw', + '-s', + snapshot_name, + disk_path, + out_path) + utils.execute(*qemu_img_cmd) # Upload that image to the image service with open(out_path) as image_file: @@ -613,7 +616,7 @@ class LibvirtConnection(driver.ComputeDriver): # for xenapi(tr3buchet) @exception.wrap_exception def spawn(self, instance, network_info=None): - xml = self.to_xml(instance, network_info) + xml = self.to_xml(instance, False, network_info) db.instance_set_state(context.get_admin_context(), instance['id'], power_state.NOSTATE, |
