From nobody Mon Apr 29 15:13:45 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 1551896289086321.6502599665222; Wed, 6 Mar 2019 10:18:09 -0800 (PST) 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 03AE58765E; Wed, 6 Mar 2019 18:18:07 +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 D205019028; Wed, 6 Mar 2019 18:18:06 +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 8D198181A12C; Wed, 6 Mar 2019 18:18:06 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x26IGqB4014773 for ; Wed, 6 Mar 2019 13:16:52 -0500 Received: by smtp.corp.redhat.com (Postfix) id 916C25D786; Wed, 6 Mar 2019 18:16:52 +0000 (UTC) Received: from antique-work.brq.redhat.com (unknown [10.43.2.63]) by smtp.corp.redhat.com (Postfix) with ESMTP id 15B485D783 for ; Wed, 6 Mar 2019 18:16:51 +0000 (UTC) From: Pavel Hrdina To: libvir-list@redhat.com Date: Wed, 6 Mar 2019 19:16:46 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/3] tests: use virTestCompareToFile in storagepoolcapstest 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-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.26]); Wed, 06 Mar 2019 18:18:07 +0000 (UTC) Content-Type: text/plain; charset="utf-8" This will allow to use VIR_TEST_REGENERATE_OUTPUT. Signed-off-by: Pavel Hrdina --- tests/storagepoolcapstest.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tests/storagepoolcapstest.c b/tests/storagepoolcapstest.c index d31f50c957..ade586bcdd 100644 --- a/tests/storagepoolcapstest.c +++ b/tests/storagepoolcapstest.c @@ -68,16 +68,11 @@ test_virStoragePoolCapsFormat(const void *opaque) abs_srcdir, data->filename) < 0) goto cleanup; =20 - if (virFileReadAll(path, 8192, &poolCapsFromFile) < 0) - goto cleanup; - if (!(poolCapsXML =3D virStoragePoolCapsFormat(poolCaps))) goto cleanup; =20 - if (STRNEQ(poolCapsFromFile, poolCapsXML)) { - virTestDifference(stderr, poolCapsFromFile, poolCapsXML); + if (virTestCompareToFile(poolCapsXML, path) < 0) goto cleanup; - } =20 ret =3D 0; =20 --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 15:13:45 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 1551896294326470.34348845715226; Wed, 6 Mar 2019 10:18:14 -0800 (PST) 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 0E0D3308404C; Wed, 6 Mar 2019 18:18:12 +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 D804C19025; Wed, 6 Mar 2019 18:18:11 +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 897C93FA46; Wed, 6 Mar 2019 18:18:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x26IGrbF014781 for ; Wed, 6 Mar 2019 13:16:53 -0500 Received: by smtp.corp.redhat.com (Postfix) id 693BF5D78D; Wed, 6 Mar 2019 18:16:53 +0000 (UTC) Received: from antique-work.brq.redhat.com (unknown [10.43.2.63]) by smtp.corp.redhat.com (Postfix) with ESMTP id E068C5D787 for ; Wed, 6 Mar 2019 18:16:52 +0000 (UTC) From: Pavel Hrdina To: libvir-list@redhat.com Date: Wed, 6 Mar 2019 19:16:47 +0100 Message-Id: <03775b3f8d6b016533aa509ccfebfe80a735f37d.1551896168.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/3] tests: invert the return logic in storagepoolcapstest 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-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.40]); Wed, 06 Mar 2019 18:18:12 +0000 (UTC) Content-Type: text/plain; charset="utf-8" This way if the first test "full" fails we will run the second test as well. Signed-off-by: Pavel Hrdina --- tests/storagepoolcapstest.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/storagepoolcapstest.c b/tests/storagepoolcapstest.c index ade586bcdd..da21bca546 100644 --- a/tests/storagepoolcapstest.c +++ b/tests/storagepoolcapstest.c @@ -85,7 +85,7 @@ test_virStoragePoolCapsFormat(const void *opaque) static int mymain(void) { - int ret =3D -1; + int ret =3D 0; virCapsPtr fullCaps =3D NULL; virCapsPtr fsCaps =3D NULL; =20 @@ -94,12 +94,14 @@ mymain(void) struct test_virStoragePoolCapsFormatData data =3D \ {.filename =3D Filename, .driverCaps =3D DriverCaps }; \ if (virTestRun(Filename, test_virStoragePoolCapsFormat, &data) < 0= ) \ - goto cleanup; \ + ret =3D -1; \ } while (0) =20 if (!(fullCaps =3D virCapabilitiesNew(VIR_ARCH_NONE, false, false)) || - !(fsCaps =3D virCapabilitiesNew(VIR_ARCH_NONE, false, false))) + !(fsCaps =3D virCapabilitiesNew(VIR_ARCH_NONE, false, false))) { + ret =3D -1; goto cleanup; + } =20 test_virCapabilitiesAddFullStoragePool(fullCaps); test_virCapabilitiesAddFSStoragePool(fsCaps); @@ -107,8 +109,6 @@ mymain(void) DO_TEST("full", fullCaps); DO_TEST("fs", fsCaps); =20 - ret =3D 0; - cleanup: virObjectUnref(fullCaps); virObjectUnref(fsCaps); --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 15:13:45 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 1551896219351772.609440332308; Wed, 6 Mar 2019 10:16:59 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8CB287EBAE; Wed, 6 Mar 2019 18:16:57 +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 666301001DF0; Wed, 6 Mar 2019 18:16:57 +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 21C56181A12C; Wed, 6 Mar 2019 18:16:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x26IGsCu014791 for ; Wed, 6 Mar 2019 13:16:54 -0500 Received: by smtp.corp.redhat.com (Postfix) id 40BB45D787; Wed, 6 Mar 2019 18:16:54 +0000 (UTC) Received: from antique-work.brq.redhat.com (unknown [10.43.2.63]) by smtp.corp.redhat.com (Postfix) with ESMTP id B87CC5D783 for ; Wed, 6 Mar 2019 18:16:53 +0000 (UTC) From: Pavel Hrdina To: libvir-list@redhat.com Date: Wed, 6 Mar 2019 19:16:48 +0100 Message-Id: <900506406680d16df95d8dc04cac66ba7897ccc7.1551896168.git.phrdina@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 3/3] caps: drop requiredSourceElements from storage pool capabilities 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-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 06 Mar 2019 18:16:58 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Capabilities should not duplicate data that are obvious from our documentation and will not change with different QEMU binaries or the way how we compile libvirt. Signed-off-by: Pavel Hrdina --- docs/formatstoragecaps.html.in | 7 -- src/conf/storage_conf.c | 25 +------ .../storagepoolcapsschemadata/poolcaps-fs.xml | 67 ------------------- .../poolcaps-full.xml | 67 ------------------- 4 files changed, 1 insertion(+), 165 deletions(-) diff --git a/docs/formatstoragecaps.html.in b/docs/formatstoragecaps.html.in index 2813d061b0..ee3888f44d 100644 --- a/docs/formatstoragecaps.html.in +++ b/docs/formatstoragecaps.html.in @@ -56,9 +56,6 @@ <value>ext2</value> ... </enum> - <enum name=3D'requiredSourceElements'> - <value>device</value> - </enum> </poolOptions> <volOptions> <defaultFormat type=3D'raw'</> @@ -92,10 +89,6 @@
Lists all the possible poolOptions source pool format types.
-
requiredSourceElements
-
Lists all the required poolOptions source - subelements required for a valid source pool element. -
targetFormatType
Lists all the possible volOptions target volu= me format types. diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index 751a00aaf0..c7ab5b8802 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -366,7 +366,7 @@ virStoragePoolOptionsFormatPool(virBufferPtr buf, if (!(poolOptions =3D virStoragePoolOptionsForPoolType(type))) return -1; =20 - if (!poolOptions->formatToString && !poolOptions->flags) + if (!poolOptions->formatToString) return 0; =20 virBufferAddLit(buf, "\n"); @@ -389,29 +389,6 @@ virStoragePoolOptionsFormatPool(virBufferPtr buf, virBufferAddLit(buf, "\n"); } =20 - if (poolOptions->flags) { - virBufferAddLit(buf, "\n"); - virBufferAdjustIndent(buf, 2); - - if (poolOptions->flags & VIR_STORAGE_POOL_SOURCE_HOST) - virBufferAddLit(buf, "host\n"); - if (poolOptions->flags & VIR_STORAGE_POOL_SOURCE_DEVICE) - virBufferAddLit(buf, "device\n"); - if (poolOptions->flags & VIR_STORAGE_POOL_SOURCE_DIR) - virBufferAddLit(buf, "dir\n"); - if (poolOptions->flags & VIR_STORAGE_POOL_SOURCE_ADAPTER) - virBufferAddLit(buf, "adapter\n"); - if (poolOptions->flags & VIR_STORAGE_POOL_SOURCE_NAME) - virBufferAddLit(buf, "name\n"); - if (poolOptions->flags & VIR_STORAGE_POOL_SOURCE_INITIATOR_IQN) - virBufferAddLit(buf, "initiator\n"); - if (poolOptions->flags & VIR_STORAGE_POOL_SOURCE_NETWORK) - virBufferAddLit(buf, "network\n"); - - virBufferAdjustIndent(buf, -2); - virBufferAddLit(buf, "\n"); - } - virBufferAdjustIndent(buf, -2); virBufferAddLit(buf, "\n"); return 0; diff --git a/tests/storagepoolcapsschemadata/poolcaps-fs.xml b/tests/storag= epoolcapsschemadata/poolcaps-fs.xml index 0e15af0607..6513ea621a 100644 --- a/tests/storagepoolcapsschemadata/poolcaps-fs.xml +++ b/tests/storagepoolcapsschemadata/poolcaps-fs.xml @@ -41,9 +41,6 @@ xfs ocfs2 - - device - @@ -77,10 +74,6 @@ glusterfs cifs - - host - dir - @@ -112,10 +105,6 @@ unknown lvm2 - - device - name - @@ -132,9 +121,6 @@ sun lvm2 - - device - @@ -151,60 +137,18 @@ - - - host - device - initiator - - - - - host - device - initiator - network - - - - - adapter - - - - - host - name - network - - - - - host - name - network - - - - - host - dir - name - network - - @@ -229,19 +173,8 @@ - - - device - name - - - - - name - - diff --git a/tests/storagepoolcapsschemadata/poolcaps-full.xml b/tests/stor= agepoolcapsschemadata/poolcaps-full.xml index 0bb3faf04e..32003dd608 100644 --- a/tests/storagepoolcapsschemadata/poolcaps-full.xml +++ b/tests/storagepoolcapsschemadata/poolcaps-full.xml @@ -41,9 +41,6 @@ xfs ocfs2 - - device - @@ -77,10 +74,6 @@ glusterfs cifs - - host - dir - @@ -112,10 +105,6 @@ unknown lvm2 - - device - name - @@ -132,9 +121,6 @@ sun lvm2 - - device - @@ -151,60 +137,18 @@ - - - host - device - initiator - - - - - host - device - initiator - network - - - - - adapter - - - - - host - name - network - - - - - host - name - network - - - - - host - dir - name - network - - @@ -229,19 +173,8 @@ - - - device - name - - - - - name - - --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list