From nobody Mon Feb 9 12:10:16 2026 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 --- 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