From nobody Mon Apr 29 04:59:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1631876898; cv=none; d=zohomail.com; s=zohoarc; b=HW+dmK/aVK/10i2SrL6R0E/NwVtZpNu40T8V0iFgRJP181qh6Q+SZCVar9yWGVIQR3aSoCX0lTXFuUuMU3chh31tZHYs78IcSV7sS1e5SczpbiD/KI63QYuX3JIe3NukdgZhKfv1HbxNIygkKI3gOJNvcDPjsDYqpZSnS3a+1Xw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631876898; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=5e1sDnNwNgwUoteGk1PomAWKxh5Dl9Bp83YILqv8JVI=; b=D25UfBnRXswjMMN196efqhaeJU8vHj0bySsbbIzbFwCSi3klwMRO/64u4UVlE4XehTegWknyGs6NA8Qd9IJZ/37i5ikXiIjC4VZn/oAB9rXOKYrTgdh+p7RLpJsVXJJpHSdYrYxSyOQaL6+wDK9Cl1M/XqBksRl5wtKS6bR12pM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1631876898529379.07968398574724; Fri, 17 Sep 2021 04:08:18 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-26-NZl93Fp7OFmULI8pCsZKyA-1; Fri, 17 Sep 2021 07:08:16 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 32D2F824FA6; Fri, 17 Sep 2021 11:08:11 +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 85D9660BF1; Fri, 17 Sep 2021 11:08:09 +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 519114E590; Fri, 17 Sep 2021 11:08:08 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 18H8DFud018333 for ; Fri, 17 Sep 2021 04:13:15 -0400 Received: by smtp.corp.redhat.com (Postfix) id 465DB12D4A; Fri, 17 Sep 2021 08:13:15 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.93]) by smtp.corp.redhat.com (Postfix) with ESMTP id B328560583 for ; Fri, 17 Sep 2021 08:13:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631876897; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=5e1sDnNwNgwUoteGk1PomAWKxh5Dl9Bp83YILqv8JVI=; b=Bq0jpxWOV7Dz/uKQQR4zfFE9thdhnHTjnECv1QztDGw/LyMfXHrClHFLKdbWftyo7UT3AO ZDuXTkmKzjEq3Kted6BZoJ0H5672Nm181QjQQxrvc6EOt8RToFpdGCHinlesVaBKTstyUZ KzEaPSBNUlsYUDkzxkNvLon853lR/JU= X-MC-Unique: NZl93Fp7OFmULI8pCsZKyA-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 1/4] virsh: Provide local path completer for screenshot --file Date: Fri, 17 Sep 2021 10:13:07 +0200 Message-Id: <881410ab48db39abcb54f76075e08236f3079af3.1631866345.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1631876899524100003 Content-Type: text/plain; charset="utf-8" The screenshot command takes optional --file argument which can point to an existing local path (in which case the file is overwritten). Set the argument's completer so that self-test doesn't report it as missing. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- tools/virsh-domain.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 70aa4167c2..f876f30cc5 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -5520,6 +5520,7 @@ static const vshCmdOptDef opts_screenshot[] =3D { VIRSH_COMMON_OPT_DOMAIN_FULL(VIR_CONNECT_LIST_DOMAINS_ACTIVE), {.name =3D "file", .type =3D VSH_OT_STRING, + .completer =3D virshCompletePathLocalExisting, .help =3D N_("where to store the screenshot") }, {.name =3D "screen", --=20 2.32.0 From nobody Mon Apr 29 04:59:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1631877024; cv=none; d=zohomail.com; s=zohoarc; b=C4H9RNeTegx+77+8WUPTgZMAt90t4sM5XzbtlaZxcWldvByx4GS55hHAiIHYoffUW/tJm8MAtCBARchbi86Mp6e1ybRMqNS9xe680d7mJnEX8OoXLYHdSAXkuZv3R8kyH0csJOgRZc1AS5M7Twc1c5AcaKRliYRh+GUrx094guY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631877024; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=YmUAe6yf/13C4cI9bU8kcP8k90RW8h1kIi/Yb6jJLu8=; b=WywqPTEd80rt5iOoh+njJfX04m4Id8DO+GdKQZHFGaDf9I8NzYLZFptbbJLiFFX7IQfyamuITHu0UCfEW6+rmCvIGsWSBjSmF+D+NE9/UNEfgFw7mJt+KPKfJsLKAe0EeJgMnBGV5wM5aXFUcQyw+4FRZuuISX+BQHVzHzJERvk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1631877024721876.2520511889082; Fri, 17 Sep 2021 04:10:24 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-509-wO4P37_2O8ObKt99HAVM7g-1; Fri, 17 Sep 2021 07:10:22 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BD4A28145EF; Fri, 17 Sep 2021 11:10:16 +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 9EDE11850E; Fri, 17 Sep 2021 11:10:16 +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 7057D4EA38; Fri, 17 Sep 2021 11:10:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 18H8DGCR018343 for ; Fri, 17 Sep 2021 04:13:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1413312D4A; Fri, 17 Sep 2021 08:13:16 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.93]) by smtp.corp.redhat.com (Postfix) with ESMTP id 936FF60583 for ; Fri, 17 Sep 2021 08:13:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631877023; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=YmUAe6yf/13C4cI9bU8kcP8k90RW8h1kIi/Yb6jJLu8=; b=QuNd4X8hnWF2vyWICx9O+LnadPfky2m4pIkBeNq/H4nRr1ap1rzW/E6JGit/veUV6GNvZ4 uhQDUrLSRuO5fDIR/XUHj+ccPdBDckQTceUl7nqxqsaNHA7NS94YHgyrjw2jpibu+tFZCi zQfYJMFCPmLfi15Qt2QcVD/AjLSnvs0= X-MC-Unique: wO4P37_2O8ObKt99HAVM7g-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 2/4] virsh: Provide local path completer for vol-download --file Date: Fri, 17 Sep 2021 10:13:08 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1631877025637100001 Content-Type: text/plain; charset="utf-8" The vol-download command takes mandatory --file argument which points to a local (possibly non-existent) path. If the file exists then it's overwritten. Set the argument's completer so that self-test doesn't report it as missing. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- tools/virsh-volume.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tools/virsh-volume.c b/tools/virsh-volume.c index 103a9b9237..152f5b0dbe 100644 --- a/tools/virsh-volume.c +++ b/tools/virsh-volume.c @@ -779,11 +779,7 @@ static const vshCmdInfo info_vol_download[] =3D { =20 static const vshCmdOptDef opts_vol_download[] =3D { VIRSH_COMMON_OPT_VOL_FULL, - {.name =3D "file", - .type =3D VSH_OT_DATA, - .flags =3D VSH_OFLAG_REQ, - .help =3D N_("file") - }, + VIRSH_COMMON_OPT_FILE(N_("file")), VIRSH_COMMON_OPT_POOL_OPTIONAL, {.name =3D "offset", .type =3D VSH_OT_INT, --=20 2.32.0 From nobody Mon Apr 29 04:59:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1631877026; cv=none; d=zohomail.com; s=zohoarc; b=kFW97F9a/HjlXb2d4b2NlsT5v4fAzWyeAJi/pB2H9IxarBO9Qh75yobguG2NkJuZ6/nKoAJAphbXVaazM7GSPVu6pw9qug7ShlWeAzsASe7AejNdRc7ZonFoQTZPPilsjkMqswMEglUGtzleeEWQ21BiQcn5RSaMkm8D+4DuWI8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631877026; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=h9FS+aCq4VAc8Bik+oLowZLlQQ5IWNFaGFFqockgWng=; b=ncsNgMoxfDi1/vTLMzipw2H5I6HfjVe6O92RtLwm+B6M559Bm954hANhUn+ELfGon1ygEjVWPM3qO9/liMu8I/5Cq6hvtOmkJ6DlUM8NHPMntrSXL2xxtIn0mGw2O2/AvUp+Ubm0lCbFJag4yKVY6VXslwFLpbdE5bJSgv50FTQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1631877026506912.0735818457069; Fri, 17 Sep 2021 04:10:26 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-595-0qUMn0dxMgqnNw2HNTL8YQ-1; Fri, 17 Sep 2021 07:10:24 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3A539BBEED; Fri, 17 Sep 2021 11:10:19 +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 20FD681F69; Fri, 17 Sep 2021 11:10:19 +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 E55094EA37; Fri, 17 Sep 2021 11:10:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 18H8DH1u018351 for ; Fri, 17 Sep 2021 04:13:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1ABE22C00F; Fri, 17 Sep 2021 08:13:17 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.93]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5FD8060583 for ; Fri, 17 Sep 2021 08:13:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631877025; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=h9FS+aCq4VAc8Bik+oLowZLlQQ5IWNFaGFFqockgWng=; b=HVIQBdB6YT4ynlU5gMOhFONIR28gaeVyeM+YmpOsRPa/DbJteZgFs9fziwbSuOBhwuJShe CWqtgpEIIEfE64615IaUJevcLpAvvHvcBFD6QjD16cQui/XEv/M7a/cpPfGzY1u09CNkF3 JkCY8EAL2qas/a8/S9FlV3J9mLFoJHU= X-MC-Unique: 0qUMn0dxMgqnNw2HNTL8YQ-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 3/4] vsh: Extend checks for aliased commands Date: Fri, 17 Sep 2021 10:13:09 +0200 Message-Id: <004479747247e06e36cd5bdb37e81a89cea636f0.1631866345.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1631877027742100001 Content-Type: text/plain; charset="utf-8" If a command is an alias, then it can only have .name, .flags and .alias set and .flags should contain just VSH_CMD_FLAG_ALIAS. Check if that's the case in self-test. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- tools/vsh.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tools/vsh.c b/tools/vsh.c index cf24586b25..3d5fef84f0 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -290,6 +290,26 @@ vshCmddefCheckInternals(vshControl *ctl, return -1; } =20 + if (cmd->handler) { + vshError(ctl, _("command '%s' has handler set"), cmd->name); + return -1; + } + + if (cmd->opts) { + vshError(ctl, _("command '%s' has options set"), cmd->name); + return -1; + } + + if (cmd->info) { + vshError(ctl, _("command '%s' has info set"), cmd->name); + return -1; + } + + if (cmd->flags & ~VSH_CMD_FLAG_ALIAS) { + vshError(ctl, _("command '%s' has multiple flags set"), cmd->n= ame); + return -1; + } + /* we don't need to continue as the real command will be checked s= eparately */ return 0; } --=20 2.32.0 From nobody Mon Apr 29 04:59:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1631866425; cv=none; d=zohomail.com; s=zohoarc; b=S8Q3nSjKaXmD6yc5AGGz2cDlYPhI2sb5QgkWwdkRE5sRV3QVOgAevMhdCVZDf9F7FH5fSwwS8R/lMGtGTlFyVnePaTAVTxLNzdsC8xkVKy7MA029dtchdjYOgNJfuC0VUqutkxUH28Mqy49nF2Gql6YescaCMkArKNYKaNMtI4E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1631866425; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=a5RaSF2L6Mc5XDHeXcmlH7TUmGKQRm0zLA9nwvDBuXc=; b=dRn3mp3WdC6YjO2d0dDhIW2AL8cD969GeqeuFXpF52kJ97gX/kUayd/YhLKto4TGhf0HAQpQ9RkWAh9gIO1Fb3xXhbdNYYZMPFWTn3e2qyFCJRgd/iou2MHt9B33o7ladk+0axB6H7biyBRK5Jt2hRdblVg7KHdFzlfz/0rFLro= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1631866425507763.8915520101906; Fri, 17 Sep 2021 01:13:45 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-31-NFtoAj8LPO--l5F4e_kSNQ-1; Fri, 17 Sep 2021 04:13:28 -0400 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2889A1006AA4; Fri, 17 Sep 2021 08:13:23 +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 A112D60583; Fri, 17 Sep 2021 08:13:22 +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 2E38F180142F; Fri, 17 Sep 2021 08:13:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 18H8DHOH018361 for ; Fri, 17 Sep 2021 04:13:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id D913512D4A; Fri, 17 Sep 2021 08:13:17 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.93]) by smtp.corp.redhat.com (Postfix) with ESMTP id 649C32C175 for ; Fri, 17 Sep 2021 08:13:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631866424; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=a5RaSF2L6Mc5XDHeXcmlH7TUmGKQRm0zLA9nwvDBuXc=; b=gr4VszfUUXkQ9csRo1/xVCJDBJAlguRaF5Qo73MkkGcE7YJKfD1o6jk0VIput8qAVrKLMr rWLJibJigUi5fjR+o9jDujxC0Hxx3MSVZqD6fAvfYPzSzigtuSCXp9ijdK8D0op4Cdjs2A 8NhUmjI+AWC3KufKea4Kc00/u2s/Kaw= X-MC-Unique: NFtoAj8LPO--l5F4e_kSNQ-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 4/4] vsh: Ensure that bool --options don't have completer Date: Fri, 17 Sep 2021 10:13:10 +0200 Message-Id: <4f97daddefb182bd1979b53ffd5ea1fda4d7e439.1631866345.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1631866426890100001 Content-Type: text/plain; charset="utf-8" Let's check whether a boolean --option doesn't have completer or completer_flags set. These options are just flags and don't accept any value, thus they can't have any completer. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- tools/vsh.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/vsh.c b/tools/vsh.c index 3d5fef84f0..7343387842 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -337,8 +337,16 @@ vshCmddefCheckInternals(vshControl *ctl, virBufferStrcat(&complbuf, opt->name, ", ", NULL); =20 switch (opt->type) { - case VSH_OT_STRING: case VSH_OT_BOOL: + if (opt->completer || opt->completer_flags) { + vshError(ctl, _("bool parameter '%s' of command '%s' has c= ompleter set"), + opt->name, cmd->name); + return -1; + } + + G_GNUC_FALLTHROUGH; + + case VSH_OT_STRING: if (opt->flags & VSH_OFLAG_REQ) { vshError(ctl, _("parameter '%s' of command '%s' misused VS= H_OFLAG_REQ"), opt->name, cmd->name); --=20 2.32.0