image_utils: Assume qemu-img supports --force-share
This has been present in qemu-img since 2.10.0,
released in 2017.
@@ -92,7 +92,6 @@ QEMU_IMG_FORMAT_MAP = {
QEMU_IMG_FORMAT_MAP_INV = {v: k for k, v in QEMU_IMG_FORMAT_MAP.items()}
QEMU_IMG_VERSION = None
-QEMU_IMG_MIN_FORCE_SHARE_VERSION = [2, 10, 0]
QEMU_IMG_MIN_CONVERT_LUKS_VERSION = '2.10'
COMPRESSIBLE_IMAGE_FORMATS = ('qcow2',)
@@ -130,12 +129,7 @@ def qemu_img_info(path: str,
"""Return an object containing the parsed output from qemu-img info."""
cmd = ['env', 'LC_ALL=C', 'qemu-img', 'info']
if force_share:
- if qemu_img_supports_force_share():
cmd.append('--force-share')
- else:
- msg = _("qemu-img --force-share requested, but "
- "qemu-img does not support this parameter")
- LOG.warning(msg)
cmd.append(path)
if os.name == 'nt':
@@ -169,14 +163,6 @@ def get_qemu_img_version() -> Optional[List[int]]:
return QEMU_IMG_VERSION
-def qemu_img_supports_force_share() -> bool:
- ver = get_qemu_img_version()
- if ver is None:
- return False
- else:
- return ver >= QEMU_IMG_MIN_FORCE_SHARE_VERSION
-
-
def _get_qemu_convert_luks_cmd(src: str,
dest: str,
out_format: str,
