From 2ea3cab1ec16c732a628b90ef42ebff3c10940ab Mon Sep 17 00:00:00 2001 From: Michael Still Date: Wed, 6 Nov 2013 15:27:37 +1100 Subject: [PATCH] Move flag in libvirt's utils to the libvirt group This change continues moving libvirt specific flags into a libvirt specific configuration group. Progresses blueprint libvirt-opts-group. DocImpact: the following flag is now in the libvirt group: snapshot_compression (formerly libvirt_snapshot_compression) Change-Id: I9eddec5cdb72a1313e044a3c7c6d75e8ad34533a --- etc/nova/nova.conf.sample | 18 +++++++++--------- nova/virt/libvirt/utils.py | 10 ++++++---- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/etc/nova/nova.conf.sample b/etc/nova/nova.conf.sample index a867bc3e50e7..bc0794c7d269 100644 --- a/etc/nova/nova.conf.sample +++ b/etc/nova/nova.conf.sample @@ -1939,15 +1939,6 @@ #force_raw_images=true -# -# Options defined in nova.virt.libvirt.utils -# - -# Compress snapshot images when possible. This currently -# applies exclusively to qcow2 images (boolean value) -#libvirt_snapshot_compression=false - - # # Options defined in nova.virt.libvirt.vif # @@ -2674,6 +2665,15 @@ #checksum_interval_seconds=3600 +# +# Options defined in nova.virt.libvirt.utils +# + +# Compress snapshot images when possible. This currently +# applies exclusively to qcow2 images (boolean value) +#snapshot_compression=false + + [baremetal] # diff --git a/nova/virt/libvirt/utils.py b/nova/virt/libvirt/utils.py index c7b9e2bb2d18..04b189c20bde 100644 --- a/nova/virt/libvirt/utils.py +++ b/nova/virt/libvirt/utils.py @@ -35,14 +35,16 @@ from nova import utils from nova.virt import images libvirt_opts = [ - cfg.BoolOpt('libvirt_snapshot_compression', + cfg.BoolOpt('snapshot_compression', default=False, help='Compress snapshot images when possible. This ' - 'currently applies exclusively to qcow2 images'), + 'currently applies exclusively to qcow2 images', + deprecated_group='DEFAULT', + deprecated_name='libvirt_snashot_compression'), ] CONF = cfg.CONF -CONF.register_opts(libvirt_opts) +CONF.register_opts(libvirt_opts, 'libvirt') CONF.import_opt('instances_path', 'nova.compute.manager') LOG = logging.getLogger(__name__) @@ -519,7 +521,7 @@ def extract_snapshot(disk_path, source_fmt, out_path, dest_fmt): qemu_img_cmd = ('qemu-img', 'convert', '-f', source_fmt, '-O', dest_fmt) # Conditionally enable compression of snapshots. - if CONF.libvirt_snapshot_compression and dest_fmt == "qcow2": + if CONF.libvirt.snapshot_compression and dest_fmt == "qcow2": qemu_img_cmd += ('-c',) qemu_img_cmd += (disk_path, out_path)