From nobody Fri May 3 21:38:14 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 1549985314881647.0953191630696; Tue, 12 Feb 2019 07:28:34 -0800 (PST) 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 DE0CA89AC8; Tue, 12 Feb 2019 15:28:32 +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 B01BD8C689; Tue, 12 Feb 2019 15:28:32 +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 6B8581819AFB; Tue, 12 Feb 2019 15:28:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x1CFSPNk023989 for ; Tue, 12 Feb 2019 10:28:25 -0500 Received: by smtp.corp.redhat.com (Postfix) id 9DBA617A66; Tue, 12 Feb 2019 15:28:25 +0000 (UTC) Received: from unknown0050b6a41c42.attlocal.net.com (ovpn-117-20.phx2.redhat.com [10.3.117.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 59100608DC for ; Tue, 12 Feb 2019 15:28:22 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Tue, 12 Feb 2019 10:28:00 -0500 Message-Id: <20190212152816.3454-2-jferlan@redhat.com> In-Reply-To: <20190212152816.3454-1-jferlan@redhat.com> References: <20190212152816.3454-1-jferlan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 01/17] conf: Remove volOptions for VIR_STORAGE_POOL_SHEEPDOG 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 12 Feb 2019 15:28:33 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The sheepdog pool is documented as not using the volume type, so let's just remove it. Besides it would have produced bad results since the defaultType is FILE but the formatting used the Disk types. Signed-off-by: John Ferlan --- src/conf/storage_conf.c | 4 ---- tests/storagevolxml2xmlout/vol-sheepdog.xml | 1 - 2 files changed, 5 deletions(-) diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index a2ddecf0f2..703093d3b5 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -249,10 +249,6 @@ static virStoragePoolTypeInfo poolTypeInfo[] =3D { VIR_STORAGE_POOL_SOURCE_NETWORK | VIR_STORAGE_POOL_SOURCE_NAME), }, - .volOptions =3D { - .defaultFormat =3D VIR_STORAGE_FILE_RAW, - .formatToString =3D virStoragePoolFormatDiskTypeToString, - } }, {.poolType =3D VIR_STORAGE_POOL_GLUSTER, .poolOptions =3D { diff --git a/tests/storagevolxml2xmlout/vol-sheepdog.xml b/tests/storagevol= xml2xmlout/vol-sheepdog.xml index e1d6a9e27d..d6e920bb81 100644 --- a/tests/storagevolxml2xmlout/vol-sheepdog.xml +++ b/tests/storagevolxml2xmlout/vol-sheepdog.xml @@ -6,6 +6,5 @@ 0 sheepdog:test2 - --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 21:38:14 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 154998531155955.653541196370725; Tue, 12 Feb 2019 07:28:31 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DA969C0669B6; Tue, 12 Feb 2019 15:28:29 +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 A8F1ABEE53; Tue, 12 Feb 2019 15:28:29 +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 5D8E41819AF9; Tue, 12 Feb 2019 15:28:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x1CFSS7F023999 for ; Tue, 12 Feb 2019 10:28:28 -0500 Received: by smtp.corp.redhat.com (Postfix) id 29854608DC; Tue, 12 Feb 2019 15:28:28 +0000 (UTC) Received: from unknown0050b6a41c42.attlocal.net.com (ovpn-117-20.phx2.redhat.com [10.3.117.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id D7F5917ADF for ; Tue, 12 Feb 2019 15:28:25 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Tue, 12 Feb 2019 10:28:01 -0500 Message-Id: <20190212152816.3454-3-jferlan@redhat.com> In-Reply-To: <20190212152816.3454-1-jferlan@redhat.com> References: <20190212152816.3454-1-jferlan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 02/17] conf: Remove volOptions for VIR_STORAGE_POOL_RBD 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.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 12 Feb 2019 15:28:30 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The rbd pool is documented as not using the volume type, so let's just remove it. Signed-off-by: John Ferlan --- src/conf/storage_conf.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index 703093d3b5..c303898e0d 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -237,11 +237,6 @@ static virStoragePoolTypeInfo poolTypeInfo[] =3D { VIR_STORAGE_POOL_SOURCE_NETWORK | VIR_STORAGE_POOL_SOURCE_NAME), }, - .volOptions =3D { - .defaultFormat =3D VIR_STORAGE_FILE_RAW, - .formatFromString =3D virStorageVolumeFormatFromString, - .formatToString =3D virStorageFileFormatTypeToString, - } }, {.poolType =3D VIR_STORAGE_POOL_SHEEPDOG, .poolOptions =3D { --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 21:38:14 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 1549985316123872.2147707399912; Tue, 12 Feb 2019 07:28:36 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 605636697E; Tue, 12 Feb 2019 15:28:34 +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 1D68E68811; Tue, 12 Feb 2019 15:28:34 +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 C7F5C1819AFE; Tue, 12 Feb 2019 15:28:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x1CFSUUD024009 for ; Tue, 12 Feb 2019 10:28:30 -0500 Received: by smtp.corp.redhat.com (Postfix) id CF65E17CC0; Tue, 12 Feb 2019 15:28:30 +0000 (UTC) Received: from unknown0050b6a41c42.attlocal.net.com (ovpn-117-20.phx2.redhat.com [10.3.117.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 88DE917ADF for ; Tue, 12 Feb 2019 15:28:28 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Tue, 12 Feb 2019 10:28:02 -0500 Message-Id: <20190212152816.3454-4-jferlan@redhat.com> In-Reply-To: <20190212152816.3454-1-jferlan@redhat.com> References: <20190212152816.3454-1-jferlan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 03/17] conf: Remove volOptions for VIR_STORAGE_POOL_SCSI 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 12 Feb 2019 15:28:35 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The scsi pool is documented as not using the volume type, so let's just remove it. Signed-off-by: John Ferlan --- src/conf/storage_conf.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index c303898e0d..8cb0f75a91 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -227,9 +227,6 @@ static virStoragePoolTypeInfo poolTypeInfo[] =3D { .poolOptions =3D { .flags =3D (VIR_STORAGE_POOL_SOURCE_ADAPTER), }, - .volOptions =3D { - .formatToString =3D virStoragePoolFormatDiskTypeToString, - } }, {.poolType =3D VIR_STORAGE_POOL_RBD, .poolOptions =3D { --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 21:38:14 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 1549985317278534.8614695371124; Tue, 12 Feb 2019 07:28:37 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 58C11C05D41E; Tue, 12 Feb 2019 15:28:35 +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 22559C0581; Tue, 12 Feb 2019 15:28:35 +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 C9CFB3F602; Tue, 12 Feb 2019 15:28:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x1CFSXcT024019 for ; Tue, 12 Feb 2019 10:28:33 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4E1A917CE5; Tue, 12 Feb 2019 15:28:33 +0000 (UTC) Received: from unknown0050b6a41c42.attlocal.net.com (ovpn-117-20.phx2.redhat.com [10.3.117.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0505D614D0 for ; Tue, 12 Feb 2019 15:28:30 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Tue, 12 Feb 2019 10:28:03 -0500 Message-Id: <20190212152816.3454-5-jferlan@redhat.com> In-Reply-To: <20190212152816.3454-1-jferlan@redhat.com> References: <20190212152816.3454-1-jferlan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 04/17] conf: Remove volOptions for VIR_STORAGE_POOL_ISCSI[_DIRECT] 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.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 12 Feb 2019 15:28:36 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The iscsi and iscsi-direct pools are documented as not using the volume type, so let's just remove it. Besides it would have produced bad output since formatting uses the Disk types. Signed-off-by: John Ferlan --- src/conf/storage_conf.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index 8cb0f75a91..e699057fbf 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -208,9 +208,6 @@ static virStoragePoolTypeInfo poolTypeInfo[] =3D { VIR_STORAGE_POOL_SOURCE_DEVICE | VIR_STORAGE_POOL_SOURCE_INITIATOR_IQN), }, - .volOptions =3D { - .formatToString =3D virStoragePoolFormatDiskTypeToString, - } }, {.poolType =3D VIR_STORAGE_POOL_ISCSI_DIRECT, .poolOptions =3D { @@ -219,9 +216,6 @@ static virStoragePoolTypeInfo poolTypeInfo[] =3D { VIR_STORAGE_POOL_SOURCE_NETWORK | VIR_STORAGE_POOL_SOURCE_INITIATOR_IQN), }, - .volOptions =3D { - .formatToString =3D virStoragePoolFormatDiskTypeToString, - } }, {.poolType =3D VIR_STORAGE_POOL_SCSI, .poolOptions =3D { --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 21:38:14 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 1549985319207399.38251418370817; Tue, 12 Feb 2019 07:28:39 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 53B44623; Tue, 12 Feb 2019 15:28:37 +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 0FF89C059F; Tue, 12 Feb 2019 15:28:37 +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 B97B13F603; Tue, 12 Feb 2019 15:28:36 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x1CFSZAc024040 for ; Tue, 12 Feb 2019 10:28:35 -0500 Received: by smtp.corp.redhat.com (Postfix) id D6C5B17A66; Tue, 12 Feb 2019 15:28:35 +0000 (UTC) Received: from unknown0050b6a41c42.attlocal.net.com (ovpn-117-20.phx2.redhat.com [10.3.117.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8EA99614D0 for ; Tue, 12 Feb 2019 15:28:33 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Tue, 12 Feb 2019 10:28:04 -0500 Message-Id: <20190212152816.3454-6-jferlan@redhat.com> In-Reply-To: <20190212152816.3454-1-jferlan@redhat.com> References: <20190212152816.3454-1-jferlan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 05/17] conf: Remove volOptions for VIR_STORAGE_POOL_MPATH 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.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 12 Feb 2019 15:28:38 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The multipath pool is documented as not using the volume type, so let's just remove it. Signed-off-by: John Ferlan --- src/conf/storage_conf.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index e699057fbf..25556db4f8 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -250,9 +250,6 @@ static virStoragePoolTypeInfo poolTypeInfo[] =3D { } }, {.poolType =3D VIR_STORAGE_POOL_MPATH, - .volOptions =3D { - .formatToString =3D virStoragePoolFormatDiskTypeToString, - } }, {.poolType =3D VIR_STORAGE_POOL_DISK, .poolOptions =3D { --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 21:38:14 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 1549985325305334.8279883155201; Tue, 12 Feb 2019 07:28:45 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 911773DE0F; Tue, 12 Feb 2019 15:28:43 +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 52897C1D02; Tue, 12 Feb 2019 15:28: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 080131819AFF; Tue, 12 Feb 2019 15:28:43 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x1CFSfwD024053 for ; Tue, 12 Feb 2019 10:28:41 -0500 Received: by smtp.corp.redhat.com (Postfix) id 5D06E17AD3; Tue, 12 Feb 2019 15:28:41 +0000 (UTC) Received: from unknown0050b6a41c42.attlocal.net.com (ovpn-117-20.phx2.redhat.com [10.3.117.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 17F1917ADF for ; Tue, 12 Feb 2019 15:28:35 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Tue, 12 Feb 2019 10:28:05 -0500 Message-Id: <20190212152816.3454-7-jferlan@redhat.com> In-Reply-To: <20190212152816.3454-1-jferlan@redhat.com> References: <20190212152816.3454-1-jferlan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 06/17] conf: Remove defaultFormat from VIR_STORAGE_POOL_ZFS 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.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 12 Feb 2019 15:28:44 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The ZFS pool is document as not using pool format types, so remove the defaultFormat value. Signed-off-by: John Ferlan --- src/conf/storage_conf.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index 25556db4f8..be64c09d37 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -268,7 +268,6 @@ static virStoragePoolTypeInfo poolTypeInfo[] =3D { .poolOptions =3D { .flags =3D (VIR_STORAGE_POOL_SOURCE_NAME | VIR_STORAGE_POOL_SOURCE_DEVICE), - .defaultFormat =3D VIR_STORAGE_FILE_RAW, }, }, {.poolType =3D VIR_STORAGE_POOL_VSTORAGE, --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 21:38:14 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 1549985327441336.20131597880606; Tue, 12 Feb 2019 07:28:47 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 817C280F90; Tue, 12 Feb 2019 15:28:45 +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 41E46C2A86; Tue, 12 Feb 2019 15:28:45 +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 E36953F604; Tue, 12 Feb 2019 15:28:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x1CFSh9X024069 for ; Tue, 12 Feb 2019 10:28:43 -0500 Received: by smtp.corp.redhat.com (Postfix) id E5836608DC; Tue, 12 Feb 2019 15:28:43 +0000 (UTC) Received: from unknown0050b6a41c42.attlocal.net.com (ovpn-117-20.phx2.redhat.com [10.3.117.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id A065817AD3 for ; Tue, 12 Feb 2019 15:28:41 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Tue, 12 Feb 2019 10:28:06 -0500 Message-Id: <20190212152816.3454-8-jferlan@redhat.com> In-Reply-To: <20190212152816.3454-1-jferlan@redhat.com> References: <20190212152816.3454-1-jferlan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 07/17] docs: Fix a few storage.html.in typos 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.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 12 Feb 2019 15:28:46 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Fix the ZFS Valid Volume Format Types label and add the Valid pool format types for Vstorage pools. Signed-off-by: John Ferlan --- docs/storage.html.in | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/storage.html.in b/docs/storage.html.in index c8617aace5..ab1f880813 100644 --- a/docs/storage.html.in +++ b/docs/storage.html.in @@ -782,7 +782,7 @@ The ZFS volume pool does not use the pool format type element.

=20 -

Valid pool format types

+

Valid volume format types

The ZFS volume pool does not use the volume format type element.

@@ -810,6 +810,12 @@ <path>/mnt/clustername</path> </target> </pool> + +

Valid pool format types

+

+ The Vstorage volume pool does not use the pool format type element. +

+

Valid volume format types

The valid volume types are the same as for the directory pool.

--=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 21:38:14 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 1549985331116158.05264552281812; Tue, 12 Feb 2019 07:28:51 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B9723C0C2349; Tue, 12 Feb 2019 15:28:48 +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 80661C2AA7; Tue, 12 Feb 2019 15:28:48 +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 305533F606; Tue, 12 Feb 2019 15:28:48 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x1CFSkJA024091 for ; Tue, 12 Feb 2019 10:28:46 -0500 Received: by smtp.corp.redhat.com (Postfix) id BDD0B608DC; Tue, 12 Feb 2019 15:28:46 +0000 (UTC) Received: from unknown0050b6a41c42.attlocal.net.com (ovpn-117-20.phx2.redhat.com [10.3.117.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 77DC417AD3 for ; Tue, 12 Feb 2019 15:28:44 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Tue, 12 Feb 2019 10:28:07 -0500 Message-Id: <20190212152816.3454-9-jferlan@redhat.com> In-Reply-To: <20190212152816.3454-1-jferlan@redhat.com> References: <20190212152816.3454-1-jferlan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 08/17] conf: Introduce storage pool functions into 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.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 12 Feb 2019 15:28:50 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Introduce the bare bones functions to processing capability data for the storage driver. Since there will be no need for the output, we need to filter that data. Signed-off-by: John Ferlan --- src/conf/capabilities.c | 74 ++++++++++++++++++++++++++++++++++++++++ src/conf/capabilities.h | 15 ++++++++ src/libvirt_private.syms | 1 + 3 files changed, 90 insertions(+) diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c index 716ac6e2e7..47308700bb 100644 --- a/src/conf/capabilities.c +++ b/src/conf/capabilities.c @@ -28,6 +28,7 @@ #include "cpu_conf.h" #include "domain_conf.h" #include "physmem.h" +#include "storage_conf.h" #include "viralloc.h" #include "virarch.h" #include "virbuffer.h" @@ -181,6 +182,17 @@ virCapabilitiesFreeGuest(virCapsGuestPtr guest) VIR_FREE(guest); } =20 + +static void +virCapabilitiesFreeStoragePool(virCapsStoragePoolPtr pool) +{ + if (!pool) + return; + + VIR_FREE(pool); +} + + void virCapabilitiesFreeNUMAInfo(virCapsPtr caps) { @@ -222,6 +234,10 @@ virCapsDispose(void *object) virCapsPtr caps =3D object; size_t i; =20 + for (i =3D 0; i < caps->npools; i++) + virCapabilitiesFreeStoragePool(caps->pools[i]); + VIR_FREE(caps->pools); + for (i =3D 0; i < caps->nguests; i++) virCapabilitiesFreeGuest(caps->guests[i]); VIR_FREE(caps->guests); @@ -793,6 +809,30 @@ virCapabilitiesDomainDataLookup(virCapsPtr caps, emulator, machinetype); } =20 + +int +virCapabilitiesAddStoragePool(virCapsPtr caps, + int poolType) +{ + virCapsStoragePoolPtr pool; + + if (VIR_ALLOC(pool) < 0) + goto error; + + pool->type =3D poolType; + + if (VIR_RESIZE_N(caps->pools, caps->npools_max, caps->npools, 1) < 0) + goto error; + caps->pools[caps->npools++] =3D pool; + + return 0; + + error: + virCapabilitiesFreeStoragePool(pool); + return -1; +} + + static int virCapabilitiesFormatNUMATopology(virBufferPtr buf, size_t ncells, @@ -1065,6 +1105,12 @@ virCapabilitiesFormatHostXML(virCapsHostPtr host, size_t i, j; char host_uuid[VIR_UUID_STRING_BUFLEN]; =20 + /* The lack of some data means we have nothing + * minimally to format, so just return. */ + if (!virUUIDIsValid(host->host_uuid) && + !host->arch && !host->powerMgmt && !host->iommu) + return 0; + virBufferAddLit(buf, "\n"); virBufferAdjustIndent(buf, 2); if (virUUIDIsValid(host->host_uuid)) { @@ -1277,6 +1323,32 @@ virCapabilitiesFormatGuestXML(virCapsGuestPtr *guest= s, } =20 =20 +static void +virCapabilitiesFormatStoragePoolXML(virCapsStoragePoolPtr *pools, + size_t npools, + virBufferPtr buf) +{ + size_t i; + + if (npools =3D=3D 0) + return; + + virBufferAddLit(buf, "\n"); + virBufferAdjustIndent(buf, 2); + + virBufferAddLit(buf, "\n"); + virBufferAdjustIndent(buf, 2); + for (i =3D 0; i < npools; i++) + virBufferAsprintf(buf, "%s\n", + virStoragePoolTypeToString(pools[i]->type)); + virBufferAdjustIndent(buf, -2); + virBufferAddLit(buf, "\n"); + + virBufferAdjustIndent(buf, -2); + virBufferAddLit(buf, "\n\n"); +} + + /** * virCapabilitiesFormatXML: * @caps: capabilities to format @@ -1298,6 +1370,8 @@ virCapabilitiesFormatXML(virCapsPtr caps) =20 virCapabilitiesFormatGuestXML(caps->guests, caps->nguests, &buf); =20 + virCapabilitiesFormatStoragePoolXML(caps->pools, caps->npools, &buf); + virBufferAdjustIndent(&buf, -2); virBufferAddLit(&buf, "\n"); =20 diff --git a/src/conf/capabilities.h b/src/conf/capabilities.h index 31c2a07a9b..cca1a20949 100644 --- a/src/conf/capabilities.h +++ b/src/conf/capabilities.h @@ -211,6 +211,13 @@ struct _virCapsHost { bool iommu; }; =20 +typedef struct _virCapsStoragePool virCapsStoragePool; +typedef virCapsStoragePool *virCapsStoragePoolPtr; +struct _virCapsStoragePool { + int type; +}; + + typedef int (*virDomainDefNamespaceParse)(xmlDocPtr, xmlNodePtr, xmlXPathContextPtr, void **); typedef void (*virDomainDefNamespaceFree)(void *); @@ -235,6 +242,10 @@ struct _virCaps { size_t nguests; size_t nguests_max; virCapsGuestPtr *guests; + + size_t npools; + size_t npools_max; + virCapsStoragePoolPtr *pools; }; =20 typedef struct _virCapsDomainData virCapsDomainData; @@ -318,6 +329,10 @@ virCapabilitiesAddGuestFeature(virCapsGuestPtr guest, bool defaultOn, bool toggle); =20 +int +virCapabilitiesAddStoragePool(virCapsPtr caps, + int poolType); + int virCapabilitiesHostSecModelAddBaseLabel(virCapsHostSecModelPtr secmodel, const char *type, diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 67579742fd..62e37f442d 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -49,6 +49,7 @@ virCapabilitiesAddGuestFeature; virCapabilitiesAddHostFeature; virCapabilitiesAddHostMigrateTransport; virCapabilitiesAddHostNUMACell; +virCapabilitiesAddStoragePool; virCapabilitiesAllocMachines; virCapabilitiesClearHostNUMACellCPUTopology; virCapabilitiesDomainDataLookup; --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 21:38:14 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 1549985338705121.65312116658379; Tue, 12 Feb 2019 07:28:58 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1FCE8C01DDE5; Tue, 12 Feb 2019 15:28:56 +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 CFC8A97B0C; Tue, 12 Feb 2019 15:28:55 +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 8B2E21819AF8; Tue, 12 Feb 2019 15:28:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x1CFSn9p024112 for ; Tue, 12 Feb 2019 10:28:49 -0500 Received: by smtp.corp.redhat.com (Postfix) id 9346E608DC; Tue, 12 Feb 2019 15:28:49 +0000 (UTC) Received: from unknown0050b6a41c42.attlocal.net.com (ovpn-117-20.phx2.redhat.com [10.3.117.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4CBA117A66 for ; Tue, 12 Feb 2019 15:28:46 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Tue, 12 Feb 2019 10:28:08 -0500 Message-Id: <20190212152816.3454-10-jferlan@redhat.com> In-Reply-To: <20190212152816.3454-1-jferlan@redhat.com> References: <20190212152816.3454-1-jferlan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 09/17] storage: Process 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.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 12 Feb 2019 15:28:57 +0000 (UTC) Content-Type: text/plain; charset="utf-8" https://bugzilla.redhat.com/show_bug.cgi?id=3D1581670 During storage driver backend initialization, let's save which backends are available in the storage pool capabilities. In order to format those, we need add a connectGetCapabilities processor to the storageHypervisorDriver. This allows a storage connection, such as "storage:///system" to find the API and format the results, such as: virsh -c storage:///system capabilities dir fs netfs logical iscsi iscsi-direct scsi mpath disk rbd sheepdog gluster zfs Signed-off-by: John Ferlan --- src/conf/virstorageobj.h | 5 +++++ src/storage/storage_backend.c | 16 ++++++++++++++++ src/storage/storage_backend.h | 3 +++ src/storage/storage_driver.c | 20 ++++++++++++++++++++ 4 files changed, 44 insertions(+) diff --git a/src/conf/virstorageobj.h b/src/conf/virstorageobj.h index 1106aa71bd..c41d4c16ad 100644 --- a/src/conf/virstorageobj.h +++ b/src/conf/virstorageobj.h @@ -24,6 +24,8 @@ =20 # include "storage_conf.h" =20 +# include "capabilities.h" + typedef struct _virStoragePoolObj virStoragePoolObj; typedef virStoragePoolObj *virStoragePoolObjPtr; =20 @@ -45,6 +47,9 @@ struct _virStorageDriverState { =20 /* Immutable pointer, self-locking APIs */ virObjectEventStatePtr storageEventState; + + /* Immutable pointer, read only after initialized */ + virCapsPtr caps; }; =20 typedef bool diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c index a54c338cf0..df37d94831 100644 --- a/src/storage/storage_backend.c +++ b/src/storage/storage_backend.c @@ -187,3 +187,19 @@ virStorageBackendForType(int type) type, NULLSTR(virStoragePoolTypeToString(type))); return NULL; } + + +virCapsPtr +virStorageBackendGetCapabilities(void) +{ + virCapsPtr caps; + size_t i; + + if (!(caps =3D virCapabilitiesNew(VIR_ARCH_NONE, false, false))) + return NULL; + + for (i =3D 0; i < virStorageBackendsCount; i++) + virCapabilitiesAddStoragePool(caps, virStorageBackends[i]->type); + + return caps; +} diff --git a/src/storage/storage_backend.h b/src/storage/storage_backend.h index 2b178494ae..c670c66287 100644 --- a/src/storage/storage_backend.h +++ b/src/storage/storage_backend.h @@ -126,4 +126,7 @@ int virStorageBackendDriversRegister(bool allmodules); =20 int virStorageBackendRegister(virStorageBackendPtr backend); =20 +virCapsPtr +virStorageBackendGetCapabilities(void); + #endif /* LIBVIRT_STORAGE_BACKEND_H */ diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index 34634e97d9..f2bc24370d 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -296,6 +296,12 @@ storageStateInitialize(bool privileged, =20 driver->storageEventState =3D virObjectEventStateNew(); =20 + /* Only one load of storage driver plus backends exists. Unlike + * domains where new binaries could change the capabilities. A + * new/changed backend requires a reinitialization. */ + if (!(driver->caps =3D virStorageBackendGetCapabilities())) + goto error; + storageDriverUnlock(); =20 return 0; @@ -360,6 +366,7 @@ storageStateCleanup(void) =20 storageDriverLock(); =20 + virObjectUnref(driver->caps); virObjectUnref(driver->storageEventState); =20 /* free inactive pools */ @@ -569,6 +576,18 @@ storageConnectListStoragePools(virConnectPtr conn, names, maxnames); } =20 + +static char * +storageConnectGetCapabilities(virConnectPtr conn) +{ + + if (virConnectGetCapabilitiesEnsureACL(conn) < 0) + return NULL; + + return virCapabilitiesFormatXML(driver->caps); +} + + static int storageConnectNumOfDefinedStoragePools(virConnectPtr conn) { @@ -2819,6 +2838,7 @@ static virHypervisorDriver storageHypervisorDriver = =3D { .connectIsEncrypted =3D storageConnectIsEncrypted, /* 4.1.0 */ .connectIsSecure =3D storageConnectIsSecure, /* 4.1.0 */ .connectIsAlive =3D storageConnectIsAlive, /* 4.1.0 */ + .connectGetCapabilities =3D storageConnectGetCapabilities, /* 5.1.0 */ }; =20 static virConnectDriver storageConnectDriver =3D { --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 21:38:14 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 1549985342663134.26854376750146; Tue, 12 Feb 2019 07:29:02 -0800 (PST) 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 1DAA589AD1; Tue, 12 Feb 2019 15:29:00 +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 D1A52608DC; Tue, 12 Feb 2019 15:28:59 +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 85F023F607; Tue, 12 Feb 2019 15:28:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x1CFSq1q024122 for ; Tue, 12 Feb 2019 10:28:52 -0500 Received: by smtp.corp.redhat.com (Postfix) id 38B9017AD3; Tue, 12 Feb 2019 15:28:52 +0000 (UTC) Received: from unknown0050b6a41c42.attlocal.net.com (ovpn-117-20.phx2.redhat.com [10.3.117.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id E65BD17A66 for ; Tue, 12 Feb 2019 15:28:49 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Tue, 12 Feb 2019 10:28:09 -0500 Message-Id: <20190212152816.3454-11-jferlan@redhat.com> In-Reply-To: <20190212152816.3454-1-jferlan@redhat.com> References: <20190212152816.3454-1-jferlan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 10/17] docs: Add schema for 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.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.26]); Tue, 12 Feb 2019 15:29:01 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Define a schema for the storage pool capabilities along with a test to show the general format. Signed-off-by: John Ferlan --- docs/schemas/storagepoolcaps.rng | 88 ++++++ libvirt.spec.in | 1 + mingw-libvirt.spec.in | 2 + tests/Makefile.am | 1 + .../poolcaps-full.xml | 268 ++++++++++++++++++ tests/virschematest.c | 1 + 6 files changed, 361 insertions(+) create mode 100644 docs/schemas/storagepoolcaps.rng create mode 100644 tests/storagepoolcapsschemadata/poolcaps-full.xml diff --git a/docs/schemas/storagepoolcaps.rng b/docs/schemas/storagepoolcap= s.rng new file mode 100644 index 0000000000..e3bf1efcde --- /dev/null +++ b/docs/schemas/storagepoolcaps.rng @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libvirt.spec.in b/libvirt.spec.in index 9beffba203..82681eea42 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1822,6 +1822,7 @@ exit 0 %{_datadir}/libvirt/schemas/secret.rng %{_datadir}/libvirt/schemas/storagecommon.rng %{_datadir}/libvirt/schemas/storagepool.rng +%{_datadir}/libvirt/schemas/storagepoolcaps.rng %{_datadir}/libvirt/schemas/storagevol.rng =20 %{_datadir}/libvirt/cpu_map/*.xml diff --git a/mingw-libvirt.spec.in b/mingw-libvirt.spec.in index 249abb8475..bea822fd73 100644 --- a/mingw-libvirt.spec.in +++ b/mingw-libvirt.spec.in @@ -252,6 +252,7 @@ rm -rf $RPM_BUILD_ROOT%{mingw64_libexecdir}/libvirt-gue= sts.sh %{mingw32_datadir}/libvirt/schemas/secret.rng %{mingw32_datadir}/libvirt/schemas/storagecommon.rng %{mingw32_datadir}/libvirt/schemas/storagepool.rng +%{mingw32_datadir}/libvirt/schemas/storagepoolcaps.rng %{mingw32_datadir}/libvirt/schemas/storagevol.rng %dir %{mingw32_datadir}/libvirt/api/ %{mingw32_datadir}/libvirt/api/libvirt-api.xml @@ -339,6 +340,7 @@ rm -rf $RPM_BUILD_ROOT%{mingw64_libexecdir}/libvirt-gue= sts.sh %{mingw64_datadir}/libvirt/schemas/secret.rng %{mingw64_datadir}/libvirt/schemas/storagecommon.rng %{mingw64_datadir}/libvirt/schemas/storagepool.rng +%{mingw64_datadir}/libvirt/schemas/storagepoolcaps.rng %{mingw64_datadir}/libvirt/schemas/storagevol.rng %dir %{mingw64_datadir}/libvirt/api/ %{mingw64_datadir}/libvirt/api/libvirt-api.xml diff --git a/tests/Makefile.am b/tests/Makefile.am index c3f633cee0..760f600bf2 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -136,6 +136,7 @@ EXTRA_DIST =3D \ securityselinuxhelperdata \ securityselinuxlabeldata \ sexpr2xmldata \ + storagepoolcapsschemadata \ storagepoolschemadata \ storagepoolxml2xmlin \ storagepoolxml2xmlout \ diff --git a/tests/storagepoolcapsschemadata/poolcaps-full.xml b/tests/stor= agepoolcapsschemadata/poolcaps-full.xml new file mode 100644 index 0000000000..0bb3faf04e --- /dev/null +++ b/tests/storagepoolcapsschemadata/poolcaps-full.xml @@ -0,0 +1,268 @@ + + + + + + none + raw + dir + bochs + cloop + dmg + iso + vpc + vdi + fat + vhd + ploop + cow + qcow + qcow2 + qed + vmdk + + + + + + + + auto + ext2 + ext3 + ext4 + ufs + iso9660 + udf + gfs + gfs2 + vfat + hfs+ + xfs + ocfs2 + + + device + + + + + + none + raw + dir + bochs + cloop + dmg + iso + vpc + vdi + fat + vhd + ploop + cow + qcow + qcow2 + qed + vmdk + + + + + + + + auto + nfs + glusterfs + cifs + + + host + dir + + + + + + none + raw + dir + bochs + cloop + dmg + iso + vpc + vdi + fat + vhd + ploop + cow + qcow + qcow2 + qed + vmdk + + + + + + + + unknown + lvm2 + + + device + name + + + + + + + + unknown + dos + dvh + gpt + mac + bsd + pc98 + sun + lvm2 + + + device + + + + + + none + linux + fat16 + fat32 + linux-swap + linux-lvm + linux-raid + extended + + + + + + + host + device + initiator + + + + + + + host + device + initiator + network + + + + + + + adapter + + + + + + + + + host + name + network + + + + + + + host + name + network + + + + + + + host + dir + name + network + + + + + + none + raw + dir + bochs + cloop + dmg + iso + vpc + vdi + fat + vhd + ploop + cow + qcow + qcow2 + qed + vmdk + + + + + + + device + name + + + + + + + name + + + + + + none + raw + dir + bochs + cloop + dmg + iso + vpc + vdi + fat + vhd + ploop + cow + qcow + qcow2 + qed + vmdk + + + + diff --git a/tests/virschematest.c b/tests/virschematest.c index d1bcdeac9c..a89a26b918 100644 --- a/tests/virschematest.c +++ b/tests/virschematest.c @@ -231,6 +231,7 @@ mymain(void) DO_TEST_DIR("nwfilter.rng", "nwfilterxml2xmlout", "../examples/xml/nwf= ilter"); DO_TEST_DIR("nwfilterbinding.rng", "virnwfilterbindingxml2xmldata"); DO_TEST_DIR("secret.rng", "secretxml2xmlin"); + DO_TEST_DIR("storagepoolcaps.rng", "storagepoolcapsschemadata"); DO_TEST_DIR("storagepool.rng", "storagepoolxml2xmlin", "storagepoolxml= 2xmlout", "storagepoolschemadata"); DO_TEST_DIR("storagevol.rng", "storagevolxml2xmlin", "storagevolxml2xm= lout", --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 21:38:14 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 1549985339365205.22117676593996; Tue, 12 Feb 2019 07:28:59 -0800 (PST) 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 064BF7F3E7; Tue, 12 Feb 2019 15:28:57 +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 BDDB4A33A4; Tue, 12 Feb 2019 15:28:56 +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 7CCB93F605; Tue, 12 Feb 2019 15:28:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x1CFSsXa024151 for ; Tue, 12 Feb 2019 10:28:54 -0500 Received: by smtp.corp.redhat.com (Postfix) id 9D8EC17ADC; Tue, 12 Feb 2019 15:28:54 +0000 (UTC) Received: from unknown0050b6a41c42.attlocal.net.com (ovpn-117-20.phx2.redhat.com [10.3.117.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5165517A66 for ; Tue, 12 Feb 2019 15:28:52 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Tue, 12 Feb 2019 10:28:10 -0500 Message-Id: <20190212152816.3454-12-jferlan@redhat.com> In-Reply-To: <20190212152816.3454-1-jferlan@redhat.com> References: <20190212152816.3454-1-jferlan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 11/17] conf: Add storage pool capability formatting 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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 12 Feb 2019 15:28:58 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Add support to format the storage pool capabilities using the virStoragePoolTypeInfoPtr to determine what capabilities exist for the various pools and the driver capabilities to determine whether the pool is compiled in and supported. Signed-off-by: John Ferlan --- src/conf/Makefile.inc.am | 2 + src/conf/storage_capabilities.c | 135 ++++++++++++++++++++++++++++++++ src/conf/storage_capabilities.h | 41 ++++++++++ src/conf/storage_conf.c | 109 ++++++++++++++++++++++++++ src/conf/storage_conf.h | 7 ++ src/libvirt_private.syms | 7 ++ 6 files changed, 301 insertions(+) create mode 100644 src/conf/storage_capabilities.c create mode 100644 src/conf/storage_capabilities.h diff --git a/src/conf/Makefile.inc.am b/src/conf/Makefile.inc.am index 219ff350d7..fb2ec0e785 100644 --- a/src/conf/Makefile.inc.am +++ b/src/conf/Makefile.inc.am @@ -96,6 +96,8 @@ NWFILTER_CONF_SOURCES =3D \ STORAGE_CONF_SOURCES =3D \ conf/storage_adapter_conf.h \ conf/storage_adapter_conf.c \ + conf/storage_capabilities.h \ + conf/storage_capabilities.c \ conf/storage_conf.h \ conf/storage_conf.c \ conf/virstorageobj.h \ diff --git a/src/conf/storage_capabilities.c b/src/conf/storage_capabilitie= s.c new file mode 100644 index 0000000000..cf3ee488ac --- /dev/null +++ b/src/conf/storage_capabilities.c @@ -0,0 +1,135 @@ +/* + * storage_capabilities.c: storage pool capabilities XML processing + * + * Copyright (C) 2019 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see + * . + */ + +#include + +#include "virerror.h" +#include "datatypes.h" +#include "capabilities.h" +#include "storage_capabilities.h" +#include "storage_conf.h" +#include "virlog.h" + +#define VIR_FROM_THIS VIR_FROM_CAPABILITIES + +VIR_LOG_INIT("conf.storage_capabilities"); + +static virClassPtr virStoragePoolCapsClass; + + +static void +virStoragePoolCapsDispose(void *obj) +{ + virStoragePoolCapsPtr caps =3D obj; + VIR_DEBUG("obj=3D%p", caps); + + virObjectUnref(caps->driverCaps); +} + + +static int +virStoragePoolCapsOnceInit(void) +{ + if (!VIR_CLASS_NEW(virStoragePoolCaps, virClassForObjectLockable())) + return -1; + return 0; +} + +VIR_ONCE_GLOBAL_INIT(virStoragePoolCaps); + + +virStoragePoolCapsPtr +virStoragePoolCapsNew(virCapsPtr driverCaps) +{ + virStoragePoolCapsPtr caps =3D NULL; + + if (virStoragePoolCapsInitialize() < 0) + return NULL; + + if (!(caps =3D virObjectLockableNew(virStoragePoolCapsClass))) + return NULL; + + caps->driverCaps =3D virObjectRef(driverCaps); + + return caps; +} + + +static bool +virStoragePoolCapsIsLoaded(virCapsPtr driverCaps, + int poolType) +{ + size_t i; + + if (!driverCaps) + return false; + + for (i =3D 0; i < driverCaps->npools; i++) { + if (driverCaps->pools[i]->type =3D=3D poolType) + return true; + } + + return false; +} + + +static int +virStoragePoolCapsFormatPool(virBufferPtr buf, + int poolType, + virStoragePoolCapsPtr const caps) +{ + bool isLoaded =3D virStoragePoolCapsIsLoaded(caps->driverCaps, poolTyp= e); + + virBufferAsprintf(buf, "\n", + virStoragePoolTypeToString(poolType), + isLoaded ? "yes" : "no"); + virBufferAdjustIndent(buf, 2); + + if (virStoragePoolOptionsFormatPool(buf, poolType) < 0) + return -1; + + if (virStoragePoolOptionsFormatVolume(buf, poolType) < 0) + return -1; + + virBufferAdjustIndent(buf, -2); + virBufferAddLit(buf, "\n"); + return 0; +} + + +char * +virStoragePoolCapsFormat(virStoragePoolCapsPtr const caps) +{ + virBuffer buf =3D VIR_BUFFER_INITIALIZER; + size_t i; + + virBufferAddLit(&buf, "\n"); + virBufferAdjustIndent(&buf, 2); + for (i =3D 0; i < VIR_STORAGE_POOL_LAST; i++) { + if (virStoragePoolCapsFormatPool(&buf, i, caps) < 0) { + virBufferFreeAndReset(&buf); + return NULL; + } + } + virBufferAdjustIndent(&buf, -2); + virBufferAddLit(&buf, "\n"); + + return virBufferContentAndReset(&buf); +} diff --git a/src/conf/storage_capabilities.h b/src/conf/storage_capabilitie= s.h new file mode 100644 index 0000000000..daeb496909 --- /dev/null +++ b/src/conf/storage_capabilities.h @@ -0,0 +1,41 @@ +/* + * storage_capabilities.h: storage pool capabilities XML processing + * + * Copyright (C) 2019 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see + * . + */ + +#ifndef LIBVIRT_STORAGE_CAPABILITIES_H +# define LIBVIRT_STORAGE_CAPABILITIES_H + +# include "internal.h" + +typedef struct _virStoragePoolCaps virStoragePoolCaps; +typedef virStoragePoolCaps *virStoragePoolCapsPtr; +struct _virStoragePoolCaps { + virObjectLockable parent; + + virCapsPtr driverCaps; +}; + +virStoragePoolCapsPtr +virStoragePoolCapsNew(virCapsPtr driverCaps); + +char * +virStoragePoolCapsFormat(virStoragePoolCapsPtr const caps); + + +#endif /* LIBVIRT_STORAGE_CAPABILITIES_H */ diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c index be64c09d37..37c84d73ae 100644 --- a/src/conf/storage_conf.c +++ b/src/conf/storage_conf.c @@ -112,6 +112,7 @@ typedef struct _virStorageVolOptions virStorageVolOptio= ns; typedef virStorageVolOptions *virStorageVolOptionsPtr; struct _virStorageVolOptions { int defaultFormat; + int lastFormat; virStorageVolFormatToString formatToString; virStorageVolFormatFromString formatFromString; }; @@ -132,6 +133,7 @@ typedef virStoragePoolOptions *virStoragePoolOptionsPtr; struct _virStoragePoolOptions { unsigned int flags; int defaultFormat; + int lastFormat; =20 virStoragePoolXMLNamespace ns; =20 @@ -164,6 +166,7 @@ static virStoragePoolTypeInfo poolTypeInfo[] =3D { .flags =3D (VIR_STORAGE_POOL_SOURCE_NAME | VIR_STORAGE_POOL_SOURCE_DEVICE), .defaultFormat =3D VIR_STORAGE_POOL_LOGICAL_LVM2, + .lastFormat =3D VIR_STORAGE_POOL_LOGICAL_LAST, .formatFromString =3D virStoragePoolFormatLogicalTypeFromString, .formatToString =3D virStoragePoolFormatLogicalTypeToString, }, @@ -171,6 +174,7 @@ static virStoragePoolTypeInfo poolTypeInfo[] =3D { {.poolType =3D VIR_STORAGE_POOL_DIR, .volOptions =3D { .defaultFormat =3D VIR_STORAGE_FILE_RAW, + .lastFormat =3D VIR_STORAGE_FILE_LAST, .formatFromString =3D virStorageVolumeFormatFromString, .formatToString =3D virStorageFileFormatTypeToString, }, @@ -179,11 +183,13 @@ static virStoragePoolTypeInfo poolTypeInfo[] =3D { .poolOptions =3D { .flags =3D (VIR_STORAGE_POOL_SOURCE_DEVICE), .defaultFormat =3D VIR_STORAGE_POOL_FS_AUTO, + .lastFormat =3D VIR_STORAGE_POOL_FS_LAST, .formatFromString =3D virStoragePoolFormatFileSystemTypeFromStrin= g, .formatToString =3D virStoragePoolFormatFileSystemTypeToString, }, .volOptions =3D { .defaultFormat =3D VIR_STORAGE_FILE_RAW, + .lastFormat =3D VIR_STORAGE_FILE_LAST, .formatFromString =3D virStorageVolumeFormatFromString, .formatToString =3D virStorageFileFormatTypeToString, }, @@ -193,11 +199,13 @@ static virStoragePoolTypeInfo poolTypeInfo[] =3D { .flags =3D (VIR_STORAGE_POOL_SOURCE_HOST | VIR_STORAGE_POOL_SOURCE_DIR), .defaultFormat =3D VIR_STORAGE_POOL_NETFS_AUTO, + .lastFormat =3D VIR_STORAGE_POOL_NETFS_LAST, .formatFromString =3D virStoragePoolFormatFileSystemNetTypeFromSt= ring, .formatToString =3D virStoragePoolFormatFileSystemNetTypeToString, }, .volOptions =3D { .defaultFormat =3D VIR_STORAGE_FILE_RAW, + .lastFormat =3D VIR_STORAGE_FILE_LAST, .formatFromString =3D virStorageVolumeFormatFromString, .formatToString =3D virStorageFileFormatTypeToString, }, @@ -245,6 +253,7 @@ static virStoragePoolTypeInfo poolTypeInfo[] =3D { }, .volOptions =3D { .defaultFormat =3D VIR_STORAGE_FILE_RAW, + .lastFormat =3D VIR_STORAGE_FILE_LAST, .formatToString =3D virStorageFileFormatTypeToString, .formatFromString =3D virStorageVolumeFormatFromString, } @@ -255,11 +264,13 @@ static virStoragePoolTypeInfo poolTypeInfo[] =3D { .poolOptions =3D { .flags =3D (VIR_STORAGE_POOL_SOURCE_DEVICE), .defaultFormat =3D VIR_STORAGE_POOL_DISK_UNKNOWN, + .lastFormat =3D VIR_STORAGE_POOL_DISK_LAST, .formatFromString =3D virStoragePoolFormatDiskTypeFromString, .formatToString =3D virStoragePoolFormatDiskTypeToString, }, .volOptions =3D { .defaultFormat =3D VIR_STORAGE_VOL_DISK_NONE, + .lastFormat =3D VIR_STORAGE_VOL_DISK_LAST, .formatFromString =3D virStorageVolFormatDiskTypeFromString, .formatToString =3D virStorageVolFormatDiskTypeToString, }, @@ -276,6 +287,7 @@ static virStoragePoolTypeInfo poolTypeInfo[] =3D { }, .volOptions =3D { .defaultFormat =3D VIR_STORAGE_FILE_RAW, + .lastFormat =3D VIR_STORAGE_FILE_LAST, .formatFromString =3D virStorageVolumeFormatFromString, .formatToString =3D virStorageFileFormatTypeToString, }, @@ -345,6 +357,103 @@ virStorageVolOptionsForPoolType(int type) } =20 =20 +int +virStoragePoolOptionsFormatPool(virBufferPtr buf, + int type) +{ + virStoragePoolOptionsPtr poolOptions; + + if (!(poolOptions =3D virStoragePoolOptionsForPoolType(type))) + return -1; + + if (!poolOptions->formatToString && !poolOptions->flags) + return 0; + + virBufferAddLit(buf, "\n"); + virBufferAdjustIndent(buf, 2); + + if (poolOptions->formatToString) { + size_t i; + + virBufferAsprintf(buf, "\n", + (poolOptions->formatToString)(poolOptions->defau= ltFormat)); + + virBufferAddLit(buf, "\n"); + virBufferAdjustIndent(buf, 2); + + for (i =3D 0; i < poolOptions->lastFormat; i++) + virBufferAsprintf(buf, "%s\n", + (poolOptions->formatToString)(i)); + + virBufferAdjustIndent(buf, -2); + virBufferAddLit(buf, "\n"); + } + + 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; +} + + +int +virStoragePoolOptionsFormatVolume(virBufferPtr buf, + int type) +{ + size_t i; + virStorageVolOptionsPtr volOptions; + + if (!(volOptions =3D virStorageVolOptionsForPoolType(type))) + return -1; + + if (!volOptions->formatToString) + return 0; + + virBufferAddLit(buf, "\n"); + virBufferAdjustIndent(buf, 2); + + virBufferAsprintf(buf, "\n", + (volOptions->formatToString)(volOptions->defaultForm= at)); + + virBufferAddLit(buf, "\n"); + virBufferAdjustIndent(buf, 2); + + for (i =3D 0; i < volOptions->lastFormat; i++) + virBufferAsprintf(buf, "%s\n", + (volOptions->formatToString)(i)); + + virBufferAdjustIndent(buf, -2); + virBufferAddLit(buf, "\n"); + + virBufferAdjustIndent(buf, -2); + virBufferAddLit(buf, "\n"); + + return 0; +} + + void virStorageVolDefFree(virStorageVolDefPtr def) { diff --git a/src/conf/storage_conf.h b/src/conf/storage_conf.h index daf6f9b68c..bfbebd15bd 100644 --- a/src/conf/storage_conf.h +++ b/src/conf/storage_conf.h @@ -53,6 +53,13 @@ int virStoragePoolOptionsPoolTypeSetXMLNamespace(int type, virStoragePoolXMLNamespacePtr= ns); =20 +int +virStoragePoolOptionsFormatPool(virBufferPtr buf, + int type); + +int +virStoragePoolOptionsFormatVolume(virBufferPtr buf, + int type); /* * How the volume's data is stored on underlying * physical devices - can potentially span many diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 62e37f442d..0d8291411d 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -909,6 +909,11 @@ virStorageAdapterParseXML; virStorageAdapterValidate; =20 =20 +# conf/storage_capabilities.h +virStoragePoolCapsFormat; +virStoragePoolCapsNew; + + # conf/storage_conf.h virStoragePartedFsTypeToString; virStoragePoolDefFormat; @@ -922,6 +927,8 @@ virStoragePoolFormatDiskTypeToString; virStoragePoolFormatFileSystemNetTypeToString; virStoragePoolFormatFileSystemTypeToString; virStoragePoolFormatLogicalTypeToString; +virStoragePoolOptionsFormatPool; +virStoragePoolOptionsFormatVolume; virStoragePoolOptionsPoolTypeSetXMLNamespace; virStoragePoolSaveConfig; virStoragePoolSaveState; --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 21:38:14 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 1549985340334941.2987383926015; Tue, 12 Feb 2019 07:29:00 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 71FD7C4EBE; Tue, 12 Feb 2019 15:28:58 +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 533429860F; Tue, 12 Feb 2019 15:28:56 +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 0FDB01819AF8; Tue, 12 Feb 2019 15:28:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x1CFStOc024156 for ; Tue, 12 Feb 2019 10:28:55 -0500 Received: by smtp.corp.redhat.com (Postfix) id 18E3317CC0; Tue, 12 Feb 2019 15:28:55 +0000 (UTC) Received: from unknown0050b6a41c42.attlocal.net.com (ovpn-117-20.phx2.redhat.com [10.3.117.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id C63D417A66 for ; Tue, 12 Feb 2019 15:28:54 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Tue, 12 Feb 2019 10:28:11 -0500 Message-Id: <20190212152816.3454-13-jferlan@redhat.com> In-Reply-To: <20190212152816.3454-1-jferlan@redhat.com> References: <20190212152816.3454-1-jferlan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 12/17] tests: Introduce storage pool capabilites test 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 12 Feb 2019 15:28:59 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Add a new test for the storage pool capabilities. There will be one test mocked with every backend available (full) and one where only the file system pool is available. Signed-off-by: John Ferlan --- tests/Makefile.am | 6 + .../storagepoolcapsschemadata/poolcaps-fs.xml | 268 ++++++++++++++++++ tests/storagepoolcapstest.c | 124 ++++++++ 3 files changed, 398 insertions(+) create mode 100644 tests/storagepoolcapsschemadata/poolcaps-fs.xml create mode 100644 tests/storagepoolcapstest.c diff --git a/tests/Makefile.am b/tests/Makefile.am index 760f600bf2..72f0420bab 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -369,6 +369,7 @@ test_programs +=3D storagevolxml2argvtest test_programs +=3D storagepoolxml2argvtest test_programs +=3D virstorageutiltest test_programs +=3D storagepoolxml2xmltest +test_programs +=3D storagepoolcapstest endif WITH_STORAGE =20 if WITH_STORAGE_FS @@ -936,11 +937,16 @@ storagepoolxml2xmltest_LDADD =3D $(LDADDS) \ ../src/libvirt_driver_storage_impl.la \ $(GNULIB_LIBS) =20 +storagepoolcapstest_SOURCES =3D \ + storagepoolcapstest.c testutils.h testutils.c +storagepoolcapstest_LDADD =3D $(LDADDS) + else ! WITH_STORAGE EXTRA_DIST +=3D storagevolxml2argvtest.c EXTRA_DIST +=3D virstorageutiltest.c EXTRA_DIST +=3D storagepoolxml2argvtest.c EXTRA_DIST +=3D storagepoolxml2xmltest.c +EXTRA_DIST +=3D storagepoolcapstest.c endif ! WITH_STORAGE =20 storagevolxml2xmltest_SOURCES =3D \ diff --git a/tests/storagepoolcapsschemadata/poolcaps-fs.xml b/tests/storag= epoolcapsschemadata/poolcaps-fs.xml new file mode 100644 index 0000000000..0e15af0607 --- /dev/null +++ b/tests/storagepoolcapsschemadata/poolcaps-fs.xml @@ -0,0 +1,268 @@ + + + + + + none + raw + dir + bochs + cloop + dmg + iso + vpc + vdi + fat + vhd + ploop + cow + qcow + qcow2 + qed + vmdk + + + + + + + + auto + ext2 + ext3 + ext4 + ufs + iso9660 + udf + gfs + gfs2 + vfat + hfs+ + xfs + ocfs2 + + + device + + + + + + none + raw + dir + bochs + cloop + dmg + iso + vpc + vdi + fat + vhd + ploop + cow + qcow + qcow2 + qed + vmdk + + + + + + + + auto + nfs + glusterfs + cifs + + + host + dir + + + + + + none + raw + dir + bochs + cloop + dmg + iso + vpc + vdi + fat + vhd + ploop + cow + qcow + qcow2 + qed + vmdk + + + + + + + + unknown + lvm2 + + + device + name + + + + + + + + unknown + dos + dvh + gpt + mac + bsd + pc98 + sun + lvm2 + + + device + + + + + + none + linux + fat16 + fat32 + linux-swap + linux-lvm + linux-raid + extended + + + + + + + host + device + initiator + + + + + + + host + device + initiator + network + + + + + + + adapter + + + + + + + + + host + name + network + + + + + + + host + name + network + + + + + + + host + dir + name + network + + + + + + none + raw + dir + bochs + cloop + dmg + iso + vpc + vdi + fat + vhd + ploop + cow + qcow + qcow2 + qed + vmdk + + + + + + + device + name + + + + + + + name + + + + + + none + raw + dir + bochs + cloop + dmg + iso + vpc + vdi + fat + vhd + ploop + cow + qcow + qcow2 + qed + vmdk + + + + diff --git a/tests/storagepoolcapstest.c b/tests/storagepoolcapstest.c new file mode 100644 index 0000000000..d31f50c957 --- /dev/null +++ b/tests/storagepoolcapstest.c @@ -0,0 +1,124 @@ +/* + * Copyright (C) Red Hat, Inc. 2019 + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see + * . + */ + +#include + +#include "testutils.h" +#include "storage_conf.h" +#include "storage_capabilities.h" + + +#define VIR_FROM_THIS VIR_FROM_NONE + + +struct test_virStoragePoolCapsFormatData { + const char *filename; + virCapsPtr driverCaps; +}; + +static void +test_virCapabilitiesAddFullStoragePool(virCapsPtr caps) +{ + size_t i; + + for (i =3D 0; i < VIR_STORAGE_POOL_LAST; i++) + virCapabilitiesAddStoragePool(caps, i); +} + + +static void +test_virCapabilitiesAddFSStoragePool(virCapsPtr caps) +{ + virCapabilitiesAddStoragePool(caps, VIR_STORAGE_POOL_FS); +} + + +static int +test_virStoragePoolCapsFormat(const void *opaque) +{ + struct test_virStoragePoolCapsFormatData *data =3D + (struct test_virStoragePoolCapsFormatData *) opaque; + virCapsPtr driverCaps =3D data->driverCaps; + virStoragePoolCapsPtr poolCaps =3D NULL; + int ret =3D -1; + VIR_AUTOFREE(char *) path =3D NULL; + VIR_AUTOFREE(char *) poolCapsFromFile =3D NULL; + VIR_AUTOFREE(char *) poolCapsXML =3D NULL; + + + if (!(poolCaps =3D virStoragePoolCapsNew(driverCaps))) + goto cleanup; + + if (virAsprintf(&path, "%s/storagepoolcapsschemadata/poolcaps-%s.xml", + abs_srcdir, data->filename) < 0) + goto cleanup; + + if (virFileReadAll(path, 8192, &poolCapsFromFile) < 0) + goto cleanup; + + if (!(poolCapsXML =3D virStoragePoolCapsFormat(poolCaps))) + goto cleanup; + + if (STRNEQ(poolCapsFromFile, poolCapsXML)) { + virTestDifference(stderr, poolCapsFromFile, poolCapsXML); + goto cleanup; + } + + ret =3D 0; + + cleanup: + virObjectUnref(poolCaps); + return ret; +} + + +static int +mymain(void) +{ + int ret =3D -1; + virCapsPtr fullCaps =3D NULL; + virCapsPtr fsCaps =3D NULL; + +#define DO_TEST(Filename, DriverCaps) \ + do { \ + struct test_virStoragePoolCapsFormatData data =3D \ + {.filename =3D Filename, .driverCaps =3D DriverCaps }; \ + if (virTestRun(Filename, test_virStoragePoolCapsFormat, &data) < 0= ) \ + goto cleanup; \ + } while (0) + + if (!(fullCaps =3D virCapabilitiesNew(VIR_ARCH_NONE, false, false)) || + !(fsCaps =3D virCapabilitiesNew(VIR_ARCH_NONE, false, false))) + goto cleanup; + + test_virCapabilitiesAddFullStoragePool(fullCaps); + test_virCapabilitiesAddFSStoragePool(fsCaps); + + DO_TEST("full", fullCaps); + DO_TEST("fs", fsCaps); + + ret =3D 0; + + cleanup: + virObjectUnref(fullCaps); + virObjectUnref(fsCaps); + + return ret; +} + +VIR_TEST_MAIN(mymain) --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 21:38:14 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 1549985344797683.0017753292518; Tue, 12 Feb 2019 07:29:04 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6C98989AD5; Tue, 12 Feb 2019 15:29:01 +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 F20D05E81C; Tue, 12 Feb 2019 15:29: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 AF07B3F60A; Tue, 12 Feb 2019 15:29:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x1CFSt6L024167 for ; Tue, 12 Feb 2019 10:28:55 -0500 Received: by smtp.corp.redhat.com (Postfix) id 946DF17997; Tue, 12 Feb 2019 15:28:55 +0000 (UTC) Received: from unknown0050b6a41c42.attlocal.net.com (ovpn-117-20.phx2.redhat.com [10.3.117.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4C3BF2CFAA for ; Tue, 12 Feb 2019 15:28:55 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Tue, 12 Feb 2019 10:28:12 -0500 Message-Id: <20190212152816.3454-14-jferlan@redhat.com> In-Reply-To: <20190212152816.3454-1-jferlan@redhat.com> References: <20190212152816.3454-1-jferlan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 13/17] docs: Add description for 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.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 12 Feb 2019 15:29:03 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: John Ferlan --- docs/docs.html.in | 1 + docs/format.html.in | 1 + docs/formatstoragecaps.html.in | 108 +++++++++++++++++++++++++++++++++ docs/index.html.in | 1 + 4 files changed, 111 insertions(+) create mode 100644 docs/formatstoragecaps.html.in diff --git a/docs/docs.html.in b/docs/docs.html.in index 40e0e3b82e..d0ff844d0c 100644 --- a/docs/docs.html.in +++ b/docs/docs.html.in @@ -77,6 +77,7 @@ storage encryption, capabilities, domain capabilities, + storage pool capabilities, node devices, secrets, snapshots diff --git a/docs/format.html.in b/docs/format.html.in index 22b23e3fc7..640a9957ee 100644 --- a/docs/format.html.in +++ b/docs/format.html.in @@ -21,6 +21,7 @@
  • Storage encryption<= /li>
  • Capabilities
  • Domain capabilities
  • +
  • Storage Pool capabilities=
  • Node devices
  • Secrets
  • Snapshots
  • diff --git a/docs/formatstoragecaps.html.in b/docs/formatstoragecaps.html.in new file mode 100644 index 0000000000..7f0641a3a8 --- /dev/null +++ b/docs/formatstoragecaps.html.in @@ -0,0 +1,108 @@ + + + + +

    Storage Pool Capabilities XML format

    + +
      + +

      Overview

      + +

      The Storage Pool Capabilities XML will provide the information + to determine what types of Storage Pools exist, whether the pool is + supported, and if relevant the source format types, the required + source elements, and the target volume format types.

      + +

      The Storage Pool Capabilities XML provides more information than the + + virConnectGetCapabilities + + which only provides an enumerated list of supported pool types.

      + +

      Element and attribute overview

      + +

      A query interface was added to the virConnect API's to retrieve the + XML listing of the set of Storage Pool Capabilities + (Since 5.1.0):

      + +
      +virConnectGetStoragePoolCapabilities
      +
      + +

      The root element that emulator capability XML document starts with = is + named storagepoolCapabilities. There will be any number of + pool child elements with two attributes type + and supported. Each pool element may have + a poolOptions or volOptions subelements to + describe the available features. Sample XML output is:

      + +
      +<storagepoolCapabilities>
      +  <pool type=3D'dir' supported=3D'yes'>
      +    <volOptions>
      +      <defaultFormat type=3D'raw'</>
      +      <enum name=3D'targetFormatType'>
      +        <value>none</value>
      +        <value>raw</value>
      +        ...
      +      </enum>
      +    </volOptions>
      +  </pool>
      +  <pool type=3D'fs' supported=3D'yes'>
      +    <poolOptions>
      +      <defaultFormat type=3D'auto'</>
      +      <enum name=3D'sourceFormatType'>
      +        <value>auto</value>
      +        <value>ext2</value>
      +        ...
      +      </enum>
      +      <enum name=3D'requiredSourceElements'>
      +        <value>device</value>
      +      </enum>
      +    </poolOptions>
      +    <volOptions>
      +      <defaultFormat type=3D'raw'</>
      +      <enum name=3D'targetFormatType'>
      +        <value>none</value>
      +        <value>raw</value>
      +        ...
      +      </enum>
      +    </volOptions>
      +  </pool>
      +  ...
      +</storagepoolCapabilities>
      +
      + +

      The following section decribes subelements of the + poolOptions and volOptions subelements

      : + +
      +
      defaultFormat
      +
      For the poolOptions, the type attribute + describes the default format name used for the pool source. For the + volOptions, the type attribute describes + the default volume name used for each volume. +
      +
      +
      enum
      +
      Each enum uses a name from the list below with any number of + value value subelements describing the valid values. +
      +
      sourceFormatType
      +
      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/docs/index.html.in b/docs/index.html.in index 1f9f448399..f593445d06 100644 --- a/docs/index.html.in +++ b/docs/index.html.in @@ -66,6 +66,7 @@ storage encryption, capabilities, domain capabilities, + storage pool capabilities, node devices, secrets, snapshots --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 21:38:14 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 1549985346800651.9677475568751; Tue, 12 Feb 2019 07:29:06 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5481088E69; Tue, 12 Feb 2019 15:29:04 +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 279079E25A; Tue, 12 Feb 2019 15:29:04 +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 D4E1E181A006; Tue, 12 Feb 2019 15:29:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x1CFSugS024175 for ; Tue, 12 Feb 2019 10:28:56 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1556B608DC; Tue, 12 Feb 2019 15:28:56 +0000 (UTC) Received: from unknown0050b6a41c42.attlocal.net.com (ovpn-117-20.phx2.redhat.com [10.3.117.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id C136C17A66 for ; Tue, 12 Feb 2019 15:28:55 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Tue, 12 Feb 2019 10:28:13 -0500 Message-Id: <20190212152816.3454-15-jferlan@redhat.com> In-Reply-To: <20190212152816.3454-1-jferlan@redhat.com> References: <20190212152816.3454-1-jferlan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 14/17] libvirt: Introduce virConnectGetStoragePoolCapabilities 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 12 Feb 2019 15:29:05 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Introduce the API to expose the storage pool capabilities along with all the remote munglement required to hook up the client. Signed-off-by: John Ferlan --- include/libvirt/libvirt-storage.h | 4 ++++ src/driver-storage.h | 5 ++++ src/libvirt-storage.c | 40 +++++++++++++++++++++++++++++++ src/libvirt_public.syms | 5 ++++ src/remote/remote_driver.c | 1 + src/remote/remote_protocol.x | 15 +++++++++++- src/remote_protocol-structs | 7 ++++++ 7 files changed, 76 insertions(+), 1 deletion(-) diff --git a/include/libvirt/libvirt-storage.h b/include/libvirt/libvirt-st= orage.h index 4bf2b5f1dd..5a95b2b139 100644 --- a/include/libvirt/libvirt-storage.h +++ b/include/libvirt/libvirt-storage.h @@ -193,6 +193,10 @@ typedef enum { */ virConnectPtr virStoragePoolGetConnect (virStoragePoolPtr= pool); =20 +/* Storage Pool capabilities */ +char *virConnectGetStoragePoolCapabilities(virConnectPtr conn, + unsigned int flags); + /* * List active storage pools */ diff --git a/src/driver-storage.h b/src/driver-storage.h index 35bd99a20c..2a855c34d8 100644 --- a/src/driver-storage.h +++ b/src/driver-storage.h @@ -52,6 +52,10 @@ typedef char * const char *srcSpec, unsigned int flags); =20 +typedef char * +(*virDrvConnectGetStoragePoolCapabilities)(virConnectPtr conn, + unsigned int flags); + typedef virStoragePoolPtr (*virDrvStoragePoolLookupByName)(virConnectPtr conn, const char *name); @@ -237,6 +241,7 @@ struct _virStorageDriver { virDrvConnectFindStoragePoolSources connectFindStoragePoolSources; virDrvConnectStoragePoolEventRegisterAny connectStoragePoolEventRegist= erAny; virDrvConnectStoragePoolEventDeregisterAny connectStoragePoolEventDere= gisterAny; + virDrvConnectGetStoragePoolCapabilities connectGetStoragePoolCapabilit= ies; virDrvStoragePoolLookupByName storagePoolLookupByName; virDrvStoragePoolLookupByUUID storagePoolLookupByUUID; virDrvStoragePoolLookupByVolume storagePoolLookupByVolume; diff --git a/src/libvirt-storage.c b/src/libvirt-storage.c index 2ea3e94e45..3bd61dc986 100644 --- a/src/libvirt-storage.c +++ b/src/libvirt-storage.c @@ -2351,3 +2351,43 @@ virConnectStoragePoolEventDeregisterAny(virConnectPt= r conn, virDispatchError(conn); return -1; } + + +/** + * virConnectGetStoragePoolCapabilities: + * @conn: pointer to the hypervisor connection + * @flags: extra flags; not used yet, so callers should always pass 0 + * + * Prior creating a storage pool (for instance via virStoragePoolCreateXML + * or virStoragePoolDefineXML) it may be suitable to know what pool types + * are supported along with the file/disk formats for each pool. + * + * Returns NULL in case of error or an XML string defining the capabilitie= s. + */ +char * +virConnectGetStoragePoolCapabilities(virConnectPtr conn, + unsigned int flags) +{ + VIR_DEBUG("conn=3D%p, flags=3D0x%x", conn, flags); + + virResetLastError(); + + virCheckConnectReturn(conn, NULL); + + if (conn->storageDriver && + conn->storageDriver->connectGetStoragePoolCapabilities) { + char *ret; + ret =3D conn->storageDriver->connectGetStoragePoolCapabilities(con= n, + flags= ); + if (!ret) + goto error; + VIR_DEBUG("conn=3D%p, ret=3D%s", conn, ret); + return ret; + } + + virReportUnsupportedError(); + + error: + virDispatchError(conn); + return NULL; +} diff --git a/src/libvirt_public.syms b/src/libvirt_public.syms index 042b4df043..9d3a53b638 100644 --- a/src/libvirt_public.syms +++ b/src/libvirt_public.syms @@ -814,4 +814,9 @@ LIBVIRT_4.10.0 { virDomainSetIOThreadParams; } LIBVIRT_4.5.0; =20 +LIBVIRT_5.1.0 { + global: + virConnectGetStoragePoolCapabilities; +} LIBVIRT_4.10.0; + # .... define new API here using predicted next version number .... diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 2861ee68e2..83966f73c0 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -8572,6 +8572,7 @@ static virStorageDriver storage_driver =3D { .connectFindStoragePoolSources =3D remoteConnectFindStoragePoolSources= , /* 0.4.5 */ .connectStoragePoolEventDeregisterAny =3D remoteConnectStoragePoolEven= tDeregisterAny, /* 2.0.0 */ .connectStoragePoolEventRegisterAny =3D remoteConnectStoragePoolEventR= egisterAny, /* 2.0.0 */ + .connectGetStoragePoolCapabilities =3D remoteConnectGetStoragePoolCapa= bilities, /* 5.1.0 */ .storagePoolLookupByName =3D remoteStoragePoolLookupByName, /* 0.4.1 */ .storagePoolLookupByUUID =3D remoteStoragePoolLookupByUUID, /* 0.4.1 */ .storagePoolLookupByVolume =3D remoteStoragePoolLookupByVolume, /* 0.4= .1 */ diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x index b9d26b1849..500c173d34 100644 --- a/src/remote/remote_protocol.x +++ b/src/remote/remote_protocol.x @@ -3565,6 +3565,14 @@ struct remote_connect_list_all_nwfilter_bindings_ret= { /* insert@1 */ unsigned int ret; }; =20 +struct remote_connect_get_storage_pool_capabilities_args { + unsigned int flags; +}; + +struct remote_connect_get_storage_pool_capabilities_ret { + remote_nonnull_string capabilities; +}; + /*----- Protocol. -----*/ =20 /* Define the program number, protocol version and procedure numbers here.= */ @@ -6328,6 +6336,11 @@ enum remote_procedure { * @acl: domain:save:!VIR_DOMAIN_AFFECT_CONFIG|VIR_DOMAIN_AFFECT_LIVE * @acl: domain:save:VIR_DOMAIN_AFFECT_CONFIG */ - REMOTE_PROC_DOMAIN_SET_IOTHREAD_PARAMS =3D 402 + REMOTE_PROC_DOMAIN_SET_IOTHREAD_PARAMS =3D 402, =20 + /** + * @generate: both + * @acl: connect:read + */ + REMOTE_PROC_CONNECT_GET_STORAGE_POOL_CAPABILITIES =3D 403 }; diff --git a/src/remote_protocol-structs b/src/remote_protocol-structs index 7c27c63542..768189c573 100644 --- a/src/remote_protocol-structs +++ b/src/remote_protocol-structs @@ -2975,6 +2975,12 @@ struct remote_connect_list_all_nwfilter_bindings_ret= { } bindings; u_int ret; }; +struct remote_connect_get_storage_pool_capabilities_args { + u_int flags; +}; +struct remote_connect_get_storage_pool_capabilities_ret { + remote_nonnull_string capabilities; +}; enum remote_procedure { REMOTE_PROC_CONNECT_OPEN =3D 1, REMOTE_PROC_CONNECT_CLOSE =3D 2, @@ -3378,4 +3384,5 @@ enum remote_procedure { REMOTE_PROC_NWFILTER_BINDING_DELETE =3D 400, REMOTE_PROC_CONNECT_LIST_ALL_NWFILTER_BINDINGS =3D 401, REMOTE_PROC_DOMAIN_SET_IOTHREAD_PARAMS =3D 402, + REMOTE_PROC_CONNECT_GET_STORAGE_POOL_CAPABILITIES =3D 403, }; --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 21:38:14 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 1549985350632926.1681420831469; Tue, 12 Feb 2019 07:29:10 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5BB2584DC; Tue, 12 Feb 2019 15:29:08 +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 2903A6298B; Tue, 12 Feb 2019 15:29:08 +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 D0719181A00C; Tue, 12 Feb 2019 15:29:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x1CFSuDa024183 for ; Tue, 12 Feb 2019 10:28:56 -0500 Received: by smtp.corp.redhat.com (Postfix) id 883AC17997; Tue, 12 Feb 2019 15:28:56 +0000 (UTC) Received: from unknown0050b6a41c42.attlocal.net.com (ovpn-117-20.phx2.redhat.com [10.3.117.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4168B17ADC for ; Tue, 12 Feb 2019 15:28:56 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Tue, 12 Feb 2019 10:28:14 -0500 Message-Id: <20190212152816.3454-16-jferlan@redhat.com> In-Reply-To: <20190212152816.3454-1-jferlan@redhat.com> References: <20190212152816.3454-1-jferlan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 15/17] storage: Introduce storageConnectGetStoragePoolCapabilities 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 12 Feb 2019 15:29:09 +0000 (UTC) Content-Type: text/plain; charset="utf-8" https://bugzilla.redhat.com/show_bug.cgi?id=3D1581670 Create the storage driver code to generate the output for the storage pool capabilities XML. Signed-off-by: John Ferlan --- src/storage/storage_driver.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index f2bc24370d..acdc31f76c 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -35,6 +35,7 @@ #include "datatypes.h" #include "driver.h" #include "storage_driver.h" +#include "storage_capabilities.h" #include "storage_conf.h" #include "storage_event.h" #include "viralloc.h" @@ -652,6 +653,28 @@ storageConnectFindStoragePoolSources(virConnectPtr con= n, } =20 =20 +static char * +storageConnectGetStoragePoolCapabilities(virConnectPtr conn, + unsigned int flags) +{ + virStoragePoolCapsPtr caps =3D NULL; + char *ret; + + virCheckFlags(0, NULL); + + if (virConnectGetStoragePoolCapabilitiesEnsureACL(conn) < 0) + return NULL; + + if (!(caps =3D virStoragePoolCapsNew(driver->caps))) + return NULL; + + ret =3D virStoragePoolCapsFormat(caps); + + virObjectUnref(caps); + return ret; +} + + static int storagePoolIsActive(virStoragePoolPtr pool) { @@ -2790,6 +2813,7 @@ static virStorageDriver storageDriver =3D { .connectStoragePoolEventRegisterAny =3D storageConnectStoragePoolEvent= RegisterAny, /* 2.0.0 */ .connectStoragePoolEventDeregisterAny =3D storageConnectStoragePoolEve= ntDeregisterAny, /* 2.0.0 */ .connectFindStoragePoolSources =3D storageConnectFindStoragePoolSource= s, /* 0.4.0 */ + .connectGetStoragePoolCapabilities =3D storageConnectGetStoragePoolCap= abilities, /* 5.1.0 */ .storagePoolLookupByName =3D storagePoolLookupByName, /* 0.4.0 */ .storagePoolLookupByUUID =3D storagePoolLookupByUUID, /* 0.4.0 */ .storagePoolLookupByVolume =3D storagePoolLookupByVolume, /* 0.4.0 */ --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 21:38:14 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 1549985347549177.9939004185719; Tue, 12 Feb 2019 07:29:07 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 78C6589AE5; Tue, 12 Feb 2019 15:29:05 +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 3D9699EF10; Tue, 12 Feb 2019 15:29:05 +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 E9A04181A008; Tue, 12 Feb 2019 15:29:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x1CFSvk7024199 for ; Tue, 12 Feb 2019 10:28:57 -0500 Received: by smtp.corp.redhat.com (Postfix) id 084E817997; Tue, 12 Feb 2019 15:28:57 +0000 (UTC) Received: from unknown0050b6a41c42.attlocal.net.com (ovpn-117-20.phx2.redhat.com [10.3.117.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id B498117ADF for ; Tue, 12 Feb 2019 15:28:56 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Tue, 12 Feb 2019 10:28:15 -0500 Message-Id: <20190212152816.3454-17-jferlan@redhat.com> In-Reply-To: <20190212152816.3454-1-jferlan@redhat.com> References: <20190212152816.3454-1-jferlan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 16/17] virsh: Expose virConnectGetStoragePoolCapabilities 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 12 Feb 2019 15:29:06 +0000 (UTC) Content-Type: text/plain; charset="utf-8" https://bugzilla.redhat.com/show_bug.cgi?id=3D1581670 Add a new storage pool command "poolcapabilities" to output the storage pool capabilities. This mimics the "domcapabilities" command with respect to naming. Signed-off-by: John Ferlan --- tools/virsh-pool.c | 42 ++++++++++++++++++++++++++++++++++++++++++ tools/virsh.pod | 7 +++++++ 2 files changed, 49 insertions(+) diff --git a/tools/virsh-pool.c b/tools/virsh-pool.c index d98fd80330..378bf0de21 100644 --- a/tools/virsh-pool.c +++ b/tools/virsh-pool.c @@ -2105,6 +2105,42 @@ cmdPoolEvent(vshControl *ctl, const vshCmd *cmd) } =20 =20 +/* + * "poolcapabilities" command + */ +static const vshCmdInfo info_poolcapabilities[] =3D { + {.name =3D "help", + .data =3D N_("storage pool capabilities") + }, + {.name =3D "desc", + .data =3D N_("Returns capabilities of storage pool support.") + }, + {.name =3D NULL} +}; + +static const vshCmdOptDef opts_poolcapabilities[] =3D { + {.name =3D NULL} +}; + +static bool +cmdPoolCapabilities(vshControl *ctl, + const vshCmd *cmd ATTRIBUTE_UNUSED) +{ + const unsigned int flags =3D 0; /* No flags so far */ + virshControlPtr priv =3D ctl->privData; + VIR_AUTOFREE(char *) caps =3D NULL; + + caps =3D virConnectGetStoragePoolCapabilities(priv->conn, flags); + if (!caps) { + vshError(ctl, "%s", _("failed to get storage pool capabilities")); + return false; + } + + vshPrint(ctl, "%s\n", caps); + return true; +} + + const vshCmdDef storagePoolCmds[] =3D { {.name =3D "find-storage-pool-sources-as", .handler =3D cmdPoolDiscoverSourcesAs, @@ -2226,5 +2262,11 @@ const vshCmdDef storagePoolCmds[] =3D { .info =3D info_pool_event, .flags =3D 0 }, + {.name =3D "poolcapabilities", + .handler =3D cmdPoolCapabilities, + .opts =3D opts_poolcapabilities, + .info =3D info_poolcapabilities, + .flags =3D 0 + }, {.name =3D NULL} }; diff --git a/tools/virsh.pod b/tools/virsh.pod index 67edb57b14..f517d4aa24 100644 --- a/tools/virsh.pod +++ b/tools/virsh.pod @@ -388,6 +388,13 @@ supplied along with either the I or I in order to generate output for the default I. Supplying a I value will generate output for the specific machine. =20 +=3Ditem B +Print an XML document describing the storage pool capabilities for the +connected storage driver. This may be useful if you intend to create a +new storage pool and need to know the available pool types and supported +storage pool source and target volume formats as well as the required +source elements to create the pool. + =3Ditem B I =20 Inject NMI to the guest. --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Fri May 3 21:38:14 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 1549985345463838.3016757507098; Tue, 12 Feb 2019 07:29:05 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 14ABBC05093A; Tue, 12 Feb 2019 15:29:03 +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 CB60C62989; Tue, 12 Feb 2019 15:29:02 +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 800C83F607; Tue, 12 Feb 2019 15:29:02 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x1CFT0nu024254 for ; Tue, 12 Feb 2019 10:29:00 -0500 Received: by smtp.corp.redhat.com (Postfix) id 778D217DD3; Tue, 12 Feb 2019 15:29:00 +0000 (UTC) Received: from unknown0050b6a41c42.attlocal.net.com (ovpn-117-20.phx2.redhat.com [10.3.117.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2FFC617CD0 for ; Tue, 12 Feb 2019 15:28:57 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Tue, 12 Feb 2019 10:28:16 -0500 Message-Id: <20190212152816.3454-18-jferlan@redhat.com> In-Reply-To: <20190212152816.3454-1-jferlan@redhat.com> References: <20190212152816.3454-1-jferlan@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 17/17] docs: Add news article 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 12 Feb 2019 15:29:04 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Signed-off-by: John Ferlan --- docs/news.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index 8d6d58ae6a..074b0f2b02 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -59,6 +59,18 @@ of the network's bridge element. + + + Add Storage Pool Capabilities output + + + Add support to list an enumerated list of supported Storage + Pools via the virConnectGetCapabilities API when connected + via a Storage Driver. Add support to get a more detailed + list XML output Storage Pool Capabilities vis the + virConnectGetStoragePoolCapabilites API. + +
      --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list