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
This commit is contained in:
Michael Still 2013-11-06 15:27:37 +11:00
parent 25a7de2054
commit 2ea3cab1ec
2 changed files with 15 additions and 13 deletions

View File

@ -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]
#

View File

@ -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)