From nobody Fri May 3 16:42:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1524001484857912.7579951101101; Tue, 17 Apr 2018 14:44:44 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4CA9B30043F2; Tue, 17 Apr 2018 21:44:43 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 16A042D324; Tue, 17 Apr 2018 21:44:43 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 94F894CA9D; Tue, 17 Apr 2018 21:44:42 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3HLheQ8005300 for ; Tue, 17 Apr 2018 17:43:40 -0400 Received: by smtp.corp.redhat.com (Postfix) id A6F921102E2C; Tue, 17 Apr 2018 21:43:40 +0000 (UTC) Received: from localhost.localdomain (ovpn-204-41.brq.redhat.com [10.40.204.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3C6961102E28 for ; Tue, 17 Apr 2018 21:43:40 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Tue, 17 Apr 2018 23:43:33 +0200 Message-Id: <7f5074e13d54e9bd37ef571d0f149490da7b1068.1524001354.git.jtomko@redhat.com> In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/3] tests: delete most qemu-img test cases assuming FMT_OPTIONS X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Tue, 17 Apr 2018 21:44:43 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 We have two leftover "capabilites" for qemu-img: QEMU_IMG_BACKING_FORMAT_OPTIONS QEMU_IMG_BACKING_FORMAT_OPTIONS_COMPAT The former says we are able to specify the backing format via -o (which has been the case for a long time now) and the second one says we can use -o compat to specify the qcow2 version. Since we require QEMU 1.5.0, we can always assume -o compat, which was introduced in QEMU 1.1. Drop the test cases using FMT_OPTIONS which have a FMT_COMPAT counterpart to prepare for deprecating FMT_OPTIONS (and these flags) completely. Signed-off-by: J=C3=A1n Tomko Reviewed-by: John Ferlan --- .../qcow2-convert-nobacking.argv | 2 -- .../storagevolxml2argvdata/qcow2-from-logical.argv | 2 -- .../qcow2-nobacking-convert-prealloc.argv | 2 -- .../qcow2-nobacking-prealloc.argv | 2 -- tests/storagevolxml2argvdata/qcow2.argv | 2 -- tests/storagevolxml2argvtest.c | 37 ------------------= ---- 6 files changed, 47 deletions(-) delete mode 100644 tests/storagevolxml2argvdata/qcow2-convert-nobacking.ar= gv delete mode 100644 tests/storagevolxml2argvdata/qcow2-from-logical.argv delete mode 100644 tests/storagevolxml2argvdata/qcow2-nobacking-convert-pr= ealloc.argv delete mode 100644 tests/storagevolxml2argvdata/qcow2-nobacking-prealloc.a= rgv delete mode 100644 tests/storagevolxml2argvdata/qcow2.argv diff --git a/tests/storagevolxml2argvdata/qcow2-convert-nobacking.argv b/te= sts/storagevolxml2argvdata/qcow2-convert-nobacking.argv deleted file mode 100644 index fd1f4c078..000000000 --- a/tests/storagevolxml2argvdata/qcow2-convert-nobacking.argv +++ /dev/null @@ -1,2 +0,0 @@ -qemu-img convert -f raw -O qcow2 -o encryption=3Don \ -/var/lib/libvirt/images/sparse.img /var/lib/libvirt/images/OtherDemo.img diff --git a/tests/storagevolxml2argvdata/qcow2-from-logical.argv b/tests/s= toragevolxml2argvdata/qcow2-from-logical.argv deleted file mode 100644 index 6a7581564..000000000 --- a/tests/storagevolxml2argvdata/qcow2-from-logical.argv +++ /dev/null @@ -1,2 +0,0 @@ -qemu-img convert -f raw -O qcow2 -o encryption=3Don /dev/HostVG/Swap \ -/var/lib/libvirt/images/OtherDemo.img diff --git a/tests/storagevolxml2argvdata/qcow2-nobacking-convert-prealloc.= argv b/tests/storagevolxml2argvdata/qcow2-nobacking-convert-prealloc.argv deleted file mode 100644 index a49285f89..000000000 --- a/tests/storagevolxml2argvdata/qcow2-nobacking-convert-prealloc.argv +++ /dev/null @@ -1,2 +0,0 @@ -qemu-img convert -f raw -O qcow2 -o encryption=3Don,preallocation=3Dmetada= ta \ -/var/lib/libvirt/images/sparse.img /var/lib/libvirt/images/OtherDemo.img diff --git a/tests/storagevolxml2argvdata/qcow2-nobacking-prealloc.argv b/t= ests/storagevolxml2argvdata/qcow2-nobacking-prealloc.argv deleted file mode 100644 index c74258882..000000000 --- a/tests/storagevolxml2argvdata/qcow2-nobacking-prealloc.argv +++ /dev/null @@ -1,2 +0,0 @@ -qemu-img create -f qcow2 -o encryption=3Don,preallocation=3Dmetadata \ -/var/lib/libvirt/images/OtherDemo.img 5242880K diff --git a/tests/storagevolxml2argvdata/qcow2.argv b/tests/storagevolxml2= argvdata/qcow2.argv deleted file mode 100644 index 6ca9a45f0..000000000 --- a/tests/storagevolxml2argvdata/qcow2.argv +++ /dev/null @@ -1,2 +0,0 @@ -qemu-img create -f qcow2 -b /dev/null -o backing_fmt=3Draw,encryption=3Don= \ -/var/lib/libvirt/images/OtherDemo.img 5242880K diff --git a/tests/storagevolxml2argvtest.c b/tests/storagevolxml2argvtest.c index 5857d5e35..4353ad467 100644 --- a/tests/storagevolxml2argvtest.c +++ b/tests/storagevolxml2argvtest.c @@ -198,40 +198,6 @@ mymain(void) =20 DO_TEST("pool-dir", "vol-qcow2", NULL, NULL, - "qcow2", 0, FMT_OPTIONS); - DO_TEST_FAIL("pool-dir", "vol-qcow2", - NULL, NULL, - "qcow2-prealloc", flags, FMT_OPTIONS); - DO_TEST("pool-dir", "vol-qcow2-nobacking", - NULL, NULL, - "qcow2-nobacking-prealloc", flags, FMT_OPTIONS); - DO_TEST("pool-dir", "vol-qcow2-nobacking", - "pool-dir", "vol-file", - "qcow2-nobacking-convert-prealloc", flags, FMT_OPTIONS); - DO_TEST_FAIL("pool-dir", "vol-qcow2", - "pool-dir", "vol-file", - "qcow2-convert-nobacking", 0, FMT_OPTIONS); - DO_TEST_FAIL("pool-dir", "vol-qcow2", - "pool-dir", "vol-file", - "qcow2-convert-prealloc", flags, FMT_OPTIONS); - DO_TEST("pool-dir", "vol-qcow2-lazy", - NULL, NULL, - "qcow2-lazy", 0, FMT_OPTIONS); - DO_TEST("pool-dir", "vol-qcow2-1.1", - NULL, NULL, - "qcow2-1.1", 0, FMT_OPTIONS); - DO_TEST_FAIL("pool-dir", "vol-qcow2-0.10-lazy", - NULL, NULL, - "qcow2-0.10-lazy", 0, FMT_OPTIONS); - DO_TEST("pool-dir", "vol-qcow2-nobacking", - "pool-logical", "vol-logical", - "qcow2-from-logical", 0, FMT_OPTIONS); - DO_TEST("pool-logical", "vol-logical", - "pool-dir", "vol-qcow2-nobacking", - "logical-from-qcow2", 0, FMT_OPTIONS); - - DO_TEST("pool-dir", "vol-qcow2", - NULL, NULL, "qcow2-compat", 0, FMT_COMPAT); DO_TEST("pool-dir", "vol-qcow2-nobacking", NULL, NULL, @@ -256,9 +222,6 @@ mymain(void) "logical-from-qcow2", 0, FMT_COMPAT); DO_TEST("pool-dir", "vol-qcow2-nocow", NULL, NULL, - "qcow2-nocow", 0, FMT_OPTIONS); - DO_TEST("pool-dir", "vol-qcow2-nocow", - NULL, NULL, "qcow2-nocow-compat", 0, FMT_COMPAT); DO_TEST("pool-dir", "vol-qcow2-nocapacity", "pool-dir", "vol-file", --=20 2.13.6 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 16:42:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1524001501635117.41493589004995; Tue, 17 Apr 2018 14:45:01 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 39A693182F41; Tue, 17 Apr 2018 21:45:00 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 01EDC87B1E; Tue, 17 Apr 2018 21:45:00 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id AAC4E180215F; Tue, 17 Apr 2018 21:44:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3HLhfKI005308 for ; Tue, 17 Apr 2018 17:43:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id 67B1C1102E2C; Tue, 17 Apr 2018 21:43:41 +0000 (UTC) Received: from localhost.localdomain (ovpn-204-41.brq.redhat.com [10.40.204.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id EC4DA1102E28 for ; Tue, 17 Apr 2018 21:43:40 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Tue, 17 Apr 2018 23:43:34 +0200 Message-Id: In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/3] tests: assume FMT_COMPAT for qemu-img tests X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Tue, 17 Apr 2018 21:45:00 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 No point in testing outdated command lines. Signed-off-by: J=C3=A1n Tomko Reviewed-by: John Ferlan --- .../qcow2-nocapacity-convert-prealloc.argv | 2 +- tests/storagevolxml2argvdata/qcow2-nocapacity.argv | 2 +- tests/storagevolxml2argvtest.c | 32 +++++++++++-------= ---- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/tests/storagevolxml2argvdata/qcow2-nocapacity-convert-prealloc= .argv b/tests/storagevolxml2argvdata/qcow2-nocapacity-convert-prealloc.argv index b151b9401..73499178e 100644 --- a/tests/storagevolxml2argvdata/qcow2-nocapacity-convert-prealloc.argv +++ b/tests/storagevolxml2argvdata/qcow2-nocapacity-convert-prealloc.argv @@ -1,4 +1,4 @@ qemu-img convert -f raw -O qcow2 \ --o encryption=3Don,preallocation=3Dfalloc \ +-o encryption=3Don,preallocation=3Dfalloc,compat=3D0.10 \ /var/lib/libvirt/images/sparse.img \ /var/lib/libvirt/images/OtherDemo.img diff --git a/tests/storagevolxml2argvdata/qcow2-nocapacity.argv b/tests/sto= ragevolxml2argvdata/qcow2-nocapacity.argv index 1198cbaf2..fd8805589 100644 --- a/tests/storagevolxml2argvdata/qcow2-nocapacity.argv +++ b/tests/storagevolxml2argvdata/qcow2-nocapacity.argv @@ -1,5 +1,5 @@ qemu-img create \ -f qcow2 \ -b /dev/null \ --o backing_fmt=3Draw,encryption=3Don \ +-o backing_fmt=3Draw,encryption=3Don,compat=3D0.10 \ /var/lib/libvirt/images/OtherDemo.img diff --git a/tests/storagevolxml2argvtest.c b/tests/storagevolxml2argvtest.c index 4353ad467..68ee9c3d8 100644 --- a/tests/storagevolxml2argvtest.c +++ b/tests/storagevolxml2argvtest.c @@ -180,10 +180,10 @@ mymain(void) unsigned int flags =3D VIR_STORAGE_VOL_CREATE_PREALLOC_METADATA; =20 #define DO_TEST_FULL(shouldFail, parseflags, pool, vol, inputpool, inputvo= l, \ - cmdline, flags, imgformat) \ + cmdline, flags) \ do { \ struct testInfo info =3D { shouldFail, pool, vol, inputpool, input= vol, \ - cmdline, flags, imgformat, parseflags }; \ + cmdline, flags, FMT_COMPAT, parseflags };= \ if (virTestRun("Storage Vol XML-2-argv " cmdline, \ testCompareXMLToArgvHelper, &info) < 0) \ ret =3D -1; \ @@ -198,47 +198,47 @@ mymain(void) =20 DO_TEST("pool-dir", "vol-qcow2", NULL, NULL, - "qcow2-compat", 0, FMT_COMPAT); + "qcow2-compat", 0); DO_TEST("pool-dir", "vol-qcow2-nobacking", NULL, NULL, - "qcow2-nobacking-prealloc-compat", flags, FMT_COMPAT); + "qcow2-nobacking-prealloc-compat", flags); DO_TEST("pool-dir", "vol-qcow2-nobacking", "pool-dir", "vol-file", - "qcow2-nobacking-convert-prealloc-compat", flags, FMT_COMPAT); + "qcow2-nobacking-convert-prealloc-compat", flags); DO_TEST("pool-dir", "vol-qcow2-lazy", NULL, NULL, - "qcow2-lazy", 0, FMT_COMPAT); + "qcow2-lazy", 0); DO_TEST("pool-dir", "vol-qcow2-1.1", NULL, NULL, - "qcow2-1.1", 0, FMT_COMPAT); + "qcow2-1.1", 0); DO_TEST_FAIL("pool-dir", "vol-qcow2-0.10-lazy", NULL, NULL, - "qcow2-0.10-lazy", 0, FMT_COMPAT); + "qcow2-0.10-lazy", 0); DO_TEST("pool-dir", "vol-qcow2-nobacking", "pool-logical", "vol-logical", - "qcow2-from-logical-compat", 0, FMT_COMPAT); + "qcow2-from-logical-compat", 0); DO_TEST("pool-logical", "vol-logical", "pool-dir", "vol-qcow2-nobacking", - "logical-from-qcow2", 0, FMT_COMPAT); + "logical-from-qcow2", 0); DO_TEST("pool-dir", "vol-qcow2-nocow", NULL, NULL, - "qcow2-nocow-compat", 0, FMT_COMPAT); + "qcow2-nocow-compat", 0); DO_TEST("pool-dir", "vol-qcow2-nocapacity", "pool-dir", "vol-file", - "qcow2-nocapacity-convert-prealloc", flags, FMT_OPTIONS); + "qcow2-nocapacity-convert-prealloc", flags); DO_TEST("pool-dir", "vol-qcow2-zerocapacity", NULL, NULL, - "qcow2-zerocapacity", 0, FMT_COMPAT); + "qcow2-zerocapacity", 0); DO_TEST_FULL(false, VIR_VOL_XML_PARSE_OPT_CAPACITY, "pool-dir", "vol-qcow2-nocapacity-backing", NULL, NULL, - "qcow2-nocapacity", 0, FMT_OPTIONS); + "qcow2-nocapacity", 0); =20 DO_TEST("pool-dir", "vol-file-iso", NULL, NULL, - "iso", 0, FMT_OPTIONS); + "iso", 0); DO_TEST("pool-dir", "vol-file", "pool-dir", "vol-file-iso", - "iso-input", 0, FMT_OPTIONS); + "iso-input", 0); =20 return ret =3D=3D 0 ? EXIT_SUCCESS : EXIT_FAILURE; } --=20 2.13.6 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 16:42:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1524001565582744.306357945888; Tue, 17 Apr 2018 14:46:05 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 18FFC3182F42; Tue, 17 Apr 2018 21:46:04 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E1E3B5F71A; Tue, 17 Apr 2018 21:46:03 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 7788D4CA9E; Tue, 17 Apr 2018 21:46:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w3HLhgDC005316 for ; Tue, 17 Apr 2018 17:43:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2C3991102E2C; Tue, 17 Apr 2018 21:43:42 +0000 (UTC) Received: from localhost.localdomain (ovpn-204-41.brq.redhat.com [10.40.204.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id B5E1F1102E28 for ; Tue, 17 Apr 2018 21:43:41 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Tue, 17 Apr 2018 23:43:35 +0200 Message-Id: <34ba19e669713bf360fb304bf60c0e27e1432484.1524001354.git.jtomko@redhat.com> In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/3] storage: remove qemu-img help scraping X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Tue, 17 Apr 2018 21:46:04 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 We have been checking whether qemu-img supports the -o compat option by scraping the -help output. Since we require QEMU 1.5.0 now and this option was introduced in 1.1, assume we support it and ditch the help parsing code along with the extra qemu-img invocation. Signed-off-by: J=C3=A1n Tomko Reviewed-by: John Ferlan --- src/storage/storage_util.c | 73 +++-----------------------------------= ---- src/storage/storage_util.h | 1 - tests/storagevolxml2argvtest.c | 5 ++- 3 files changed, 6 insertions(+), 73 deletions(-) diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c index 897dfdaae..f7a4231e2 100644 --- a/src/storage/storage_util.c +++ b/src/storage/storage_util.c @@ -787,61 +787,6 @@ storagePloopResize(virStorageVolDefPtr vol, return ret; } =20 -/* Flag values shared w/ storagevolxml2argvtest.c. - * - * QEMU_IMG_BACKING_FORMAT_OPTIONS (added in qemu 0.11) - * QEMU_IMG_BACKING_FORMAT_OPTIONS_COMPAT - * was made necessary due to 2.0 change to change the default - * qcow2 file format from 0.10 to 1.1. - */ -enum { - QEMU_IMG_BACKING_FORMAT_OPTIONS =3D 0, - QEMU_IMG_BACKING_FORMAT_OPTIONS_COMPAT, -}; - -static bool -virStorageBackendQemuImgSupportsCompat(const char *qemuimg) -{ - bool ret =3D false; - char *output; - virCommandPtr cmd =3D NULL; - - cmd =3D virCommandNewArgList(qemuimg, "create", "-o", "?", "-f", "qcow= 2", - "/dev/null", NULL); - - virCommandAddEnvString(cmd, "LC_ALL=3DC"); - virCommandSetOutputBuffer(cmd, &output); - - if (virCommandRun(cmd, NULL) < 0) - goto cleanup; - - if (strstr(output, "\ncompat ")) - ret =3D true; - - cleanup: - virCommandFree(cmd); - VIR_FREE(output); - return ret; -} - - -static int -virStorageBackendQEMUImgBackingFormat(const char *qemuimg) -{ - /* As of QEMU 0.11 the [-o options] support was added via qemu - * commit id '9ea2ea71', so we start with that base and figure - * out what else we have */ - int ret =3D QEMU_IMG_BACKING_FORMAT_OPTIONS; - - /* QEMU 2.0 changed to using a format that only QEMU 1.1 and newer - * understands. Since we still support QEMU 0.12 and newer, we need - * to be able to handle the previous format as can be set via a - * compat=3D0.10 option. */ - if (virStorageBackendQemuImgSupportsCompat(qemuimg)) - ret =3D QEMU_IMG_BACKING_FORMAT_OPTIONS_COMPAT; - - return ret; -} =20 /* The _virStorageBackendQemuImgInfo separates the command line building f= rom * the volume definition so that qemuDomainSnapshotCreateInactiveExternal = can @@ -1089,14 +1034,12 @@ storageBackendCreateQemuImgSetBacking(virStoragePoo= lObjPtr pool, =20 static int storageBackendCreateQemuImgSetOptions(virCommandPtr cmd, - int imgformat, virStorageEncryptionInfoDefPtr enc, struct _virStorageBackendQemuImgInfo= info) { char *opts =3D NULL; =20 - if (info.format =3D=3D VIR_STORAGE_FILE_QCOW2 && !info.compat && - imgformat >=3D QEMU_IMG_BACKING_FORMAT_OPTIONS_COMPAT) + if (info.format =3D=3D VIR_STORAGE_FILE_QCOW2 && !info.compat) info.compat =3D "0.10"; =20 if (storageBackendCreateQemuImgOpts(enc, &opts, info) < 0) @@ -1170,16 +1113,13 @@ storageBackendResizeQemuImgImageOpts(virCommandPtr = cmd, } =20 =20 -/* Create a qemu-img virCommand from the supplied binary path, - * volume definitions and imgformat - */ +/* Create a qemu-img virCommand from the supplied arguments */ virCommandPtr virStorageBackendCreateQemuImgCmdFromVol(virStoragePoolObjPtr pool, virStorageVolDefPtr vol, virStorageVolDefPtr inputvol, unsigned int flags, const char *create_tool, - int imgformat, const char *secretPath) { virCommandPtr cmd =3D NULL; @@ -1293,7 +1233,7 @@ virStorageBackendCreateQemuImgCmdFromVol(virStoragePo= olObjPtr pool, enc =3D &vol->target.encryption->encinfo; } =20 - if (storageBackendCreateQemuImgSetOptions(cmd, imgformat, enc, info) <= 0) + if (storageBackendCreateQemuImgSetOptions(cmd, enc, info) < 0) goto error; VIR_FREE(info.secretAlias); =20 @@ -1386,7 +1326,6 @@ storageBackendCreateQemuImg(virStoragePoolObjPtr pool, { int ret =3D -1; char *create_tool; - int imgformat; virCommandPtr cmd; char *secretPath =3D NULL; =20 @@ -1400,10 +1339,6 @@ storageBackendCreateQemuImg(virStoragePoolObjPtr poo= l, return -1; } =20 - imgformat =3D virStorageBackendQEMUImgBackingFormat(create_tool); - if (imgformat < 0) - goto cleanup; - if (vol->target.format =3D=3D VIR_STORAGE_FILE_RAW && vol->target.encryption && vol->target.encryption->format =3D=3D VIR_STORAGE_ENCRYPTION_FORMA= T_LUKS) { @@ -1414,7 +1349,7 @@ storageBackendCreateQemuImg(virStoragePoolObjPtr pool, =20 cmd =3D virStorageBackendCreateQemuImgCmdFromVol(pool, vol, inputvol, flags, create_tool, - imgformat, secretPath); + secretPath); if (!cmd) goto cleanup; =20 diff --git a/src/storage/storage_util.h b/src/storage/storage_util.h index e9cb98211..930770275 100644 --- a/src/storage/storage_util.h +++ b/src/storage/storage_util.h @@ -159,7 +159,6 @@ virStorageBackendCreateQemuImgCmdFromVol(virStoragePool= ObjPtr pool, virStorageVolDefPtr inputvol, unsigned int flags, const char *create_tool, - int imgformat, const char *secretPath); =20 int virStorageBackendSCSIFindLUs(virStoragePoolObjPtr pool, diff --git a/tests/storagevolxml2argvtest.c b/tests/storagevolxml2argvtest.c index 68ee9c3d8..ca44ccd48 100644 --- a/tests/storagevolxml2argvtest.c +++ b/tests/storagevolxml2argvtest.c @@ -40,7 +40,6 @@ testCompareXMLToArgvFiles(bool shouldFail, const char *inputvolxml, const char *cmdline, unsigned int flags, - int imgformat, unsigned long parse_flags) { char *actualCmdline =3D NULL; @@ -82,7 +81,7 @@ testCompareXMLToArgvFiles(bool shouldFail, =20 cmd =3D virStorageBackendCreateQemuImgCmdFromVol(obj, vol, inputvol, flags, - create_tool, imgformat, + create_tool, NULL); if (!cmd) { if (shouldFail) { @@ -154,7 +153,7 @@ testCompareXMLToArgvHelper(const void *data) result =3D testCompareXMLToArgvFiles(info->shouldFail, poolxml, volxml, inputpoolxml, inputvolxml, cmdline, info->flags, - info->imgformat, info->parseflags); + info->parseflags); =20 cleanup: VIR_FREE(poolxml); --=20 2.13.6 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list