From nobody Mon Feb 9 03:46:27 2026 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=1644422595; cv=none; d=zohomail.com; s=zohoarc; b=eK5qSMcEpw8Edw/1zR2Mx4nUILiJTS6T/MVnSr3Gha2pCNb4sQGu/JFYteOD7iCnU5V8sVDhNAtNbwWEUHTNvAT/O1howhikuuxRDh2VMI3hfCNBREujATQ1R2fyUdYW8AlmBShJgLO6j40N8OvvAM0mfw5RM/fdPac0JuK7h3M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1644422595; 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=7I8Peg9LPt/S3ZLsn5BnQ0/iHWLev2BEktVa6WgIbGo=; b=me31qIuJVnQgpoUO/rnWJN4qRSCarGnuR0kdsXxuG00iU1OwKyOKLLuy+f5oBIuz7Nf9Q1dnziNS2+CVdjF1gwo5nahS3eg4+T7YvqDm/aJ0Muwcpr3A5GOgX8QbgCi1TqjZpKhw/J7utGSn6cE8f9ez9+siSNg7tcHnq1z3eAU= 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 1644422595729978.2925644969736; Wed, 9 Feb 2022 08:03:15 -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-498-wtgF9MbJP_m5U557x0Fqdg-1; Wed, 09 Feb 2022 11:03:08 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 04636193249A; Wed, 9 Feb 2022 16:03:00 +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 D58B42BCC0; Wed, 9 Feb 2022 16:02:59 +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 2C67F1806D1D; Wed, 9 Feb 2022 16:02:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 219G2cQo012247 for ; Wed, 9 Feb 2022 11:02:38 -0500 Received: by smtp.corp.redhat.com (Postfix) id B42F77DE49; Wed, 9 Feb 2022 16:02:38 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1777F7DE42 for ; Wed, 9 Feb 2022 16:02:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644422591; 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=7I8Peg9LPt/S3ZLsn5BnQ0/iHWLev2BEktVa6WgIbGo=; b=I9WrCOxf8W8LsZ2XnhD9pYD78EHoU4TtjxAcOAYUUUS9OK8BRlzF6fVock0kz+bIzxt2vA tprv4i73s1FnISXhwZAiDONffc+zXqNuQ5iCNjJgKKXA/bc4ADCTNFjQBdvbXsVgkr7mP7 1u1mB+NgJn+zuyL01s9o/bJ3baaCwbE= X-MC-Unique: wtgF9MbJP_m5U557x0Fqdg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 05/27] qemuMonitorRemoveFdset: Convert @fdset to unsigned int to avoid error Date: Wed, 9 Feb 2022 17:01:57 +0100 Message-Id: <6a1a5a317819637db7a2024a7e2d2f9fca1482b6.1644422239.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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.84 on 10.5.11.23 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: 1644422598337100002 Content-Type: text/plain; charset="utf-8" 'qemuMonitorRemoveFdset' validatest that the 'fdset' argument isn't less than 0. We can turn it to unsigned and thus avoid the error message completely. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_monitor.c | 14 ++++---------- src/qemu/qemu_monitor.h | 2 +- src/qemu/qemu_monitor_json.c | 4 ++-- src/qemu/qemu_monitor_json.h | 2 +- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index fcd39b80c6..7915729cbb 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -2556,24 +2556,18 @@ qemuMonitorAddFileHandleToSet(qemuMonitor *mon, /** * qemuMonitorRemoveFdset: * @mon: monitor object - * @fdset: the fdset to remove + * @fdset: id of the fdset to remove * - * Attempts to remove a fdset from qemu and close associated file descript= ors + * Attempts to remove @fdset from qemu and close associated file descripto= rs * Returns 0 if ok, and -1 on failure */ int qemuMonitorRemoveFdset(qemuMonitor *mon, - int fdset) + unsigned int fdset) { - VIR_DEBUG("fdset=3D%d", fdset); + VIR_DEBUG("fdset=3D%u", fdset); QEMU_CHECK_MONITOR(mon); - if (fdset < 0) { - virReportError(VIR_ERR_INVALID_ARG, "%s", - _("fdset must be valid")); - return -1; - } - return qemuMonitorJSONRemoveFdset(mon, fdset); } diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index efc4721ea9..27e288c724 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -974,7 +974,7 @@ qemuMonitorAddFileHandleToSet(qemuMonitor *mon, int qemuMonitorRemoveFdset(qemuMonitor *mon, - int fdset); + unsigned int fdset); typedef struct _qemuMonitorFdsetFdInfo qemuMonitorFdsetFdInfo; struct _qemuMonitorFdsetFdInfo { diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 69ecc8a2d1..acecdc3943 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -3766,11 +3766,11 @@ int qemuMonitorJSONQueryFdsets(qemuMonitor *mon, int qemuMonitorJSONRemoveFdset(qemuMonitor *mon, - int fdset) + unsigned int fdset) { g_autoptr(virJSONValue) reply =3D NULL; g_autoptr(virJSONValue) cmd =3D qemuMonitorJSONMakeCommand("remove-fd", - "i:fdset-id",= fdset, + "u:fdset-id",= fdset, NULL); if (!cmd) diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h index 309d1fb409..eea3478af0 100644 --- a/src/qemu/qemu_monitor_json.h +++ b/src/qemu/qemu_monitor_json.h @@ -257,7 +257,7 @@ qemuMonitorJSONAddFileHandleToSet(qemuMonitor *mon, int qemuMonitorJSONRemoveFdset(qemuMonitor *mon, - int fdset); + unsigned int fdset); int qemuMonitorJSONQueryFdsets(qemuMonitor *mon, --=20 2.34.1