From nobody Sun Feb 8 22:43:42 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=1654694752; cv=none; d=zohomail.com; s=zohoarc; b=eNsJG2x+Vy4Y1ckEv+nz2s67sUJ39quedus7kKSHV89h4uv3ythVMaUUo8M+oTRQgiVtF3cCkqzbODs8+iMJz+LT2WRxb8cj+rYGlBxWj2tDphfk6JKT+9tfwWgw7Nn30yHShTKitVXgO+KqNtXF5u3p67AclZFBZDzNsBEuOwo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654694752; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=fl1u72iDSdVcV36azQMkptutlJlCMMFXo4FEZ0m/7PM=; b=c1oedGoI7eZnYzgozJU+THTb36RTMi4vSzex1/udUlrcy9XXIg2I5kakC5wTguduJPsKtSRnRzWlkKu3XeAnB4B/H+vgyp2AVxhy1KtjeDSAS92qDW+VCd4VZXNGfERJUyp1IDGCWARqHYDVRBs5oX9OAfygwfYgX5IvOXKjSNU= 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 1654694752503833.151833209079; Wed, 8 Jun 2022 06:25:52 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-511-VcCItlxBP_2PHAtUOPgA6g-1; Wed, 08 Jun 2022 09:25:44 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5DD0385A588; Wed, 8 Jun 2022 13:25:42 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id DE2A218EA5; Wed, 8 Jun 2022 13:25:41 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id AEC821947041; Wed, 8 Jun 2022 13:25:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 8AD041947040 for ; Wed, 8 Jun 2022 13:25:18 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 6E4D71121315; Wed, 8 Jun 2022 13:25:18 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id 16E901121314 for ; Wed, 8 Jun 2022 13:25:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654694751; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=fl1u72iDSdVcV36azQMkptutlJlCMMFXo4FEZ0m/7PM=; b=CPW0wobi9NHBEJfy+UBlRzEJMhCd8PvCSpP4uji6At5xqHnSWvrQnUqDxd3prS7JwKWDoX olJDu31pWnxGBuafWgevLJPlRCnJwrNgbtJ5qiwOGJEe1dDQzoRaupxFHZ7v5Kxx92jP/d XEG0Sv5Y0P8eCGwVi8TDJNTqY7QA6GI= X-MC-Unique: VcCItlxBP_2PHAtUOPgA6g-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH] virsh: Check whether enough arguments was passed to iothreadset Date: Wed, 8 Jun 2022 15:25:13 +0200 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 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: 1654694754589100001 Content-Type: text/plain; charset="utf-8"; x-default="true" Virsh has iothreadset command which allows setting various attributes of IOThreads. However, when the command is called without any arguments (besides domain and IOThread IDs), then @params stays NULL and is passed to virDomainSetIOThreadParams() which produces rather user unfriendly error message: error: params in virDomainSetIOThreadParams must not be NULL Introduce a check and produce better error message. Signed-off-by: Michal Privoznik Reviewed-by: Claudio Fontana Reviewed-by: Peter Krempa --- tools/virsh-domain.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 5c4a7d7b8d..cfdaac1942 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -7853,6 +7853,11 @@ cmdIOThreadSet(vshControl *ctl, const vshCmd *cmd) =20 #undef VSH_IOTHREAD_SET_UINT_PARAMS =20 + if (nparams =3D=3D 0) { + vshError(ctl, _("Not enough arguments passed, nothing to set")); + goto cleanup; + } + if (virDomainSetIOThreadParams(dom, id, params, nparams, flags) < 0) goto cleanup; =20 --=20 2.35.1