From nobody Sun Feb 8 18:39:27 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=1643309132; cv=none; d=zohomail.com; s=zohoarc; b=BUiGYXIqJui4MjJmS1ZYR0ziDet8fYcmzLoYHZf2OFKp/FcMtAJbyGmeOR5WGevf3k/SkvQwcRNPHNXyvLHsz+tZRNEbTCb2kflYlUeqQxZxrwo5WJ2axCtumV2uV/QnCdIuAUej8+vBegnZ0kLg+qtVReZLkRFs6HcOGNVRh4w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1643309132; 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=hL/5nQk6Uv1wXP/Mv3Heg2p4ASlnhe8G0oppJzAUqIY=; b=bB8eUVO7LfKysoSmgI9ujUnEew+sfIkvnToy8ajS7vjzc71/fC2eGETA7iMeWrpnwktdVRMvQDc/zF68G87TRmymNigj+fNr7OBysIEya7k42Iofr9H/NujxhljlKQd6IaSIbKpyqJ+J9+kPEIXAxEYERk/NpK+KXzfX57+vqSQ= 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 1643309129806411.3847963414722; Thu, 27 Jan 2022 10:45:29 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-119-dPs_BbMaM7OBXiBELh1aNQ-1; Thu, 27 Jan 2022 13:45:25 -0500 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 A50421091DB6; Thu, 27 Jan 2022 18:45:19 +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 3534E7D5B4; Thu, 27 Jan 2022 18:45: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 853B71809CB8; Thu, 27 Jan 2022 18:45:18 +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 20RIjH4e002677 for ; Thu, 27 Jan 2022 13:45:17 -0500 Received: by smtp.corp.redhat.com (Postfix) id B6ACD85898; Thu, 27 Jan 2022 18:45:17 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.40.192.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1D8A8858B8 for ; Thu, 27 Jan 2022 18:45:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643309129; 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=hL/5nQk6Uv1wXP/Mv3Heg2p4ASlnhe8G0oppJzAUqIY=; b=SKCxnZGtRwv2oSeDMu+dVo8RBNwRJrEYB6aYoN3+juN/Y6dAhONPXkS2ADJdlHkV7kEnS0 04QoR8Icm4DUfxY7mPp+j0n5Y54a16WdUONMl8hiEA2OS2M2KJZXt+xEDaj9fLdAWAeXhQ M0mfPlmW9lH5Bv+NZV9ZlFpnkDtxDAA= X-MC-Unique: dPs_BbMaM7OBXiBELh1aNQ-1 From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCHv2 1/2] virsh: domsetlaunchsecstate: report error if no options are passed Date: Thu, 27 Jan 2022 19:44:55 +0100 Message-Id: <141c5a3321215c49110e10213cd51dfddd014427.1643309033.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1643309134150100003 We already exit if they are not present. Report an error, but do not mark them as required in case a future version of this command will want to accept a different set of parameters. https://bugzilla.redhat.com/show_bug.cgi?id=3D2046024 Signed-off-by: J=C3=A1n Tomko --- tools/virsh-domain.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index b56f6a90f5..43d310f2af 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -9627,8 +9627,10 @@ cmdDomSetLaunchSecState(vshControl * ctl, const vshC= md * cmd) if (vshCommandOptStringReq(ctl, cmd, "secret", &secfile) < 0) return false; =20 - if (sechdrfile =3D=3D NULL || secfile =3D=3D NULL) + if (sechdrfile =3D=3D NULL || secfile =3D=3D NULL) { + vshError(ctl, "%s", _("Both secret and the secret header are requi= red")); return false; + } =20 if (virFileReadAll(sechdrfile, 1024*64, &sechdr) < 0) { vshSaveLibvirtError(); --=20 2.31.1