From nobody Wed May 8 04:30:17 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; spf=none (zohomail.com: 8.43.85.245 is neither permitted nor denied by domain of lists.libvirt.org) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1707899838184974.8066900870259; Wed, 14 Feb 2024 00:37:18 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id D3E7219C1; Wed, 14 Feb 2024 03:37:16 -0500 (EST) Received: from lists.libvirt.org.85.43.8.in-addr.arpa (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id B623C1944; Wed, 14 Feb 2024 03:36:03 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id E763B1923; Wed, 14 Feb 2024 03:35:59 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 16494191F for ; Wed, 14 Feb 2024 03:35:58 -0500 (EST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-287-tecAKAb8Njij5UpPrYiLbA-1; Wed, 14 Feb 2024 03:35:56 -0500 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7E95C85A588 for ; Wed, 14 Feb 2024 08:35:56 +0000 (UTC) Received: from ajulis-thinkpadt14gen4.remote.csb (unknown [10.43.3.76]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2659C492BFA for ; Wed, 14 Feb 2024 08:35:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-MC-Unique: tecAKAb8Njij5UpPrYiLbA-1 From: Adam Julis To: devel@lists.libvirt.org Subject: [PATCH] virsh: completer for --type of commands find-storage-pool-sources and find-storage-pool-sources-as Date: Wed, 14 Feb 2024 09:35:38 +0100 Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Message-ID-Hash: K6GT4P5S52DSRYMVQD3HLGIN33N4XPJR X-Message-ID-Hash: K6GT4P5S52DSRYMVQD3HLGIN33N4XPJR X-MailFrom: ajulis@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="utf-8"; x-default="true" Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1707899838967100001 Signed-off-by: Adam Julis --- tools/virsh-completer-pool.c | 11 +++++++++++ tools/virsh-completer-pool.h | 5 +++++ tools/virsh-pool.c | 2 ++ 3 files changed, 18 insertions(+) diff --git a/tools/virsh-completer-pool.c b/tools/virsh-completer-pool.c index 0600394411..1081e5c10c 100644 --- a/tools/virsh-completer-pool.c +++ b/tools/virsh-completer-pool.c @@ -66,6 +66,17 @@ virshStoragePoolNameCompleter(vshControl *ctl, } =20 =20 +char ** +virshStoragePoolTypeCompleter(vshControl *ctl G_GNUC_UNUSED, + const vshCmd *cmd G_GNUC_UNUSED, + unsigned int flags) +{ + virCheckFlags(0, NULL); + + return virshEnumComplete(VIR_STORAGE_POOL_LAST, virStoragePoolTypeToSt= ring); +} + + char ** virshPoolEventNameCompleter(vshControl *ctl G_GNUC_UNUSED, const vshCmd *cmd G_GNUC_UNUSED, diff --git a/tools/virsh-completer-pool.h b/tools/virsh-completer-pool.h index 059b6ba9e0..5a051d2aeb 100644 --- a/tools/virsh-completer-pool.h +++ b/tools/virsh-completer-pool.h @@ -32,6 +32,11 @@ virshPoolEventNameCompleter(vshControl *ctl, const vshCmd *cmd, unsigned int flags); =20 +char ** +virshStoragePoolTypeCompleter(vshControl *ctl, + const vshCmd *cmd, + unsigned int completerflags); + char ** virshPoolTypeCompleter(vshControl *ctl, const vshCmd *cmd, diff --git a/tools/virsh-pool.c b/tools/virsh-pool.c index 36f00cf643..db5cb6306c 100644 --- a/tools/virsh-pool.c +++ b/tools/virsh-pool.c @@ -1414,6 +1414,7 @@ static const vshCmdOptDef opts_find_storage_pool_sour= ces_as[] =3D { {.name =3D "type", .type =3D VSH_OT_DATA, .flags =3D VSH_OFLAG_REQ, + .completer =3D virshStoragePoolTypeCompleter, .help =3D N_("type of storage pool sources to find") }, {.name =3D "host", @@ -1501,6 +1502,7 @@ static const vshCmdOptDef opts_find_storage_pool_sour= ces[] =3D { {.name =3D "type", .type =3D VSH_OT_DATA, .flags =3D VSH_OFLAG_REQ, + .completer =3D virshStoragePoolTypeCompleter, .help =3D N_("type of storage pool sources to discover") }, {.name =3D "srcSpec", --=20 2.43.0 _______________________________________________ Devel mailing list -- devel@lists.libvirt.org To unsubscribe send an email to devel-leave@lists.libvirt.org