From nobody Fri Dec 19 17:04:37 2025 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=1685027783; cv=none; d=zohomail.com; s=zohoarc; b=ErbBzav8rU0tg1P2UAv0eAaKUMqgxyH7yXkFumnY5Rjm+JFmVeHSrMS+oYI6jS6e3JaMqgR+6UcSj71amdbhnQ6qUNeljmZ0y+YWdRPKbqQQxHYE98BzjdNRERy4tbzla/VpQJS0th4aGELPuuUdolv8km/g5cd+SVNcara/ZRg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685027783; 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=pzfYQCBM5UAhIzh6RETt/0UKqjs99PQ/9T7GC9TyRYg=; b=ZJ+wLtfwwb4QHPsSzQBmp8XR/YIUFsJnLqfiba0zTtg0G5SENIhXI0Leax7774fygkoOfO376fGQHlhOJmCfvRKUp07PSTDPoMlu1k+d7qc+3SZNQT3ase1pPqYskBUqQtYB0Fwggyr8ZpwyX8zOFk9ynFVT1XCk3shr/70cPto= 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 1685027783941785.3187321774469; Thu, 25 May 2023 08:16:23 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-494-UpFhUMX8PPyKVg5GybOubQ-1; Thu, 25 May 2023 11:16:19 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 117B93C11C97; Thu, 25 May 2023 15:16:00 +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 F1EE3492B0C; Thu, 25 May 2023 15:15:59 +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 C9BF519465B2; Thu, 25 May 2023 15:15:59 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D50C219465B9 for ; Thu, 25 May 2023 15:13:49 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 1426B492B00; Thu, 25 May 2023 15:13:49 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id 91ECE48205E for ; Thu, 25 May 2023 15:13:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685027783; 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=pzfYQCBM5UAhIzh6RETt/0UKqjs99PQ/9T7GC9TyRYg=; b=VTx8goA6PF7Askvnbe/1Nldtcu+zuhAHQhFuYEwkv6+zsJWsArYbs9+DKgTETGVc2m0ZAp oBb8bZZyzZH//jLmxfHRTiDTsob2ei4/7AOIBrYYTb3PiBxBke+kb9j0SAaTm6Q4Gcmjyy /0zjgVfWwh/rwWCPoSGqh7OdhUNVkFM= X-MC-Unique: UpFhUMX8PPyKVg5GybOubQ-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 02/18] qemuMonitorTestAddHandler: Remove return value Date: Thu, 25 May 2023 17:13:29 +0200 Message-Id: <74f3d6a9be3ac3337e7f802ba1fa8018400b966c.1685027511.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 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 3.1 on 10.11.54.10 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: 1685027785365100003 Content-Type: text/plain; charset="utf-8" The function always returns 0. Remove the return value and fix callers. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/qemuagenttest.c | 39 ++++++++++++-------------- tests/qemumonitortestutils.c | 54 +++++++++++++++++++++--------------- tests/qemumonitortestutils.h | 2 +- 3 files changed, 49 insertions(+), 46 deletions(-) diff --git a/tests/qemuagenttest.c b/tests/qemuagenttest.c index 7724df2742..7d8c66707d 100644 --- a/tests/qemuagenttest.c +++ b/tests/qemuagenttest.c @@ -475,10 +475,9 @@ testQemuAgentShutdown(const void *data) priv.event =3D QEMU_AGENT_EVENT_SHUTDOWN; priv.mode =3D "halt"; - if (qemuMonitorTestAddHandler(test, "guest-shutdown", - qemuAgentShutdownTestMonitorHandler, - &priv, NULL) < 0) - return -1; + qemuMonitorTestAddHandler(test, "guest-shutdown", + qemuAgentShutdownTestMonitorHandler, + &priv, NULL); if (qemuAgentShutdown(qemuMonitorTestGetAgent(test), QEMU_AGENT_SHUTDOWN_HALT) < 0) @@ -487,10 +486,9 @@ testQemuAgentShutdown(const void *data) priv.event =3D QEMU_AGENT_EVENT_SHUTDOWN; priv.mode =3D "powerdown"; - if (qemuMonitorTestAddHandler(test, "guest-shutdown", - qemuAgentShutdownTestMonitorHandler, - &priv, NULL) < 0) - return -1; + qemuMonitorTestAddHandler(test, "guest-shutdown", + qemuAgentShutdownTestMonitorHandler, + &priv, NULL); if (qemuAgentShutdown(qemuMonitorTestGetAgent(test), QEMU_AGENT_SHUTDOWN_POWERDOWN) < 0) @@ -499,11 +497,10 @@ testQemuAgentShutdown(const void *data) priv.event =3D QEMU_AGENT_EVENT_RESET; priv.mode =3D "reboot"; - if (qemuMonitorTestAddHandler(test, - "guest-shutdown", - qemuAgentShutdownTestMonitorHandler, - &priv, NULL) < 0) - return -1; + qemuMonitorTestAddHandler(test, + "guest-shutdown", + qemuAgentShutdownTestMonitorHandler, + &priv, NULL); if (qemuAgentShutdown(qemuMonitorTestGetAgent(test), QEMU_AGENT_SHUTDOWN_REBOOT) < 0) @@ -691,10 +688,9 @@ testQemuAgentTimeout(const void *data) if (virTestGetExpensive() =3D=3D 0) return EXIT_AM_SKIP; - if (qemuMonitorTestAddHandler(test, NULL, - qemuAgentTimeoutTestMonitorHandler, - NULL, NULL) < 0) - return -1; + qemuMonitorTestAddHandler(test, NULL, + qemuAgentTimeoutTestMonitorHandler, + NULL, NULL); if (qemuAgentFSFreeze(qemuMonitorTestGetAgent(test), NULL, 0) !=3D -1)= { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", @@ -706,11 +702,10 @@ testQemuAgentTimeout(const void *data) if (qemuMonitorTestAddAgentSyncResponse(test) < 0) return -1; - if (qemuMonitorTestAddHandler(test, - NULL, - qemuAgentTimeoutTestMonitorHandler, - NULL, NULL) < 0) - return -1; + qemuMonitorTestAddHandler(test, + NULL, + qemuAgentTimeoutTestMonitorHandler, + NULL, NULL); if (qemuAgentArbitraryCommand(qemuMonitorTestGetAgent(test), "{\"execute\":\"ble\"}", diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c index cfe78b258a..40ef057271 100644 --- a/tests/qemumonitortestutils.c +++ b/tests/qemumonitortestutils.c @@ -441,7 +441,7 @@ qemuMonitorTestFree(qemuMonitorTest *test) } -int +void qemuMonitorTestAddHandler(qemuMonitorTest *test, const char *identifier, qemuMonitorTestResponseCallback cb, @@ -460,8 +460,6 @@ qemuMonitorTestAddHandler(qemuMonitorTest *test, VIR_WITH_MUTEX_LOCK_GUARD(&test->lock) { VIR_APPEND_ELEMENT(test->items, test->nitems, item); } - - return 0; } void * @@ -604,10 +602,12 @@ qemuMonitorTestAddItem(qemuMonitorTest *test, data->command_name =3D g_strdup(command_name); data->response =3D g_strdup(response); - return qemuMonitorTestAddHandler(test, - command_name, - qemuMonitorTestProcessCommandDefault, - data, qemuMonitorTestHandlerDataFree); + qemuMonitorTestAddHandler(test, + command_name, + qemuMonitorTestProcessCommandDefault, + data, qemuMonitorTestHandlerDataFree); + + return 0; } @@ -684,10 +684,12 @@ qemuMonitorTestAddItemVerbatim(qemuMonitorTest *test, data->cmderr =3D g_strdup(cmderr); data->command_name =3D g_steal_pointer(&reformatted); - return qemuMonitorTestAddHandler(test, - command, - qemuMonitorTestProcessCommandVerbatim, - data, qemuMonitorTestHandlerDataFree); + qemuMonitorTestAddHandler(test, + command, + qemuMonitorTestProcessCommandVerbatim, + data, qemuMonitorTestHandlerDataFree); + + return 0; } @@ -732,10 +734,12 @@ qemuMonitorTestAddAgentSyncResponse(qemuMonitorTest *= test) return -1; } - return qemuMonitorTestAddHandler(test, - "agent-sync", - qemuMonitorTestProcessGuestAgentSync, - NULL, NULL); + qemuMonitorTestAddHandler(test, + "agent-sync", + qemuMonitorTestProcessGuestAgentSync, + NULL, NULL); + + return 0; } @@ -841,10 +845,12 @@ qemuMonitorTestAddItemParams(qemuMonitorTest *test, va_end(args); - return qemuMonitorTestAddHandler(test, - cmdname, - qemuMonitorTestProcessCommandWithArgs, - data, qemuMonitorTestHandlerDataFree); + qemuMonitorTestAddHandler(test, + cmdname, + qemuMonitorTestProcessCommandWithArgs, + data, qemuMonitorTestHandlerDataFree); + + return 0; error: va_end(args); @@ -939,10 +945,12 @@ qemuMonitorTestAddItemExpect(qemuMonitorTest *test, } } - return qemuMonitorTestAddHandler(test, - cmdname, - qemuMonitorTestProcessCommandWithArgS= tr, - data, qemuMonitorTestHandlerDataFree); + qemuMonitorTestAddHandler(test, + cmdname, + qemuMonitorTestProcessCommandWithArgStr, + data, qemuMonitorTestHandlerDataFree); + + return 0; } diff --git a/tests/qemumonitortestutils.h b/tests/qemumonitortestutils.h index ffcb32a5cc..df0d544720 100644 --- a/tests/qemumonitortestutils.h +++ b/tests/qemumonitortestutils.h @@ -30,7 +30,7 @@ typedef int (*qemuMonitorTestResponseCallback)(qemuMonito= rTest *test, qemuMonitorTestItem *item, const char *message); -int +void qemuMonitorTestAddHandler(qemuMonitorTest *test, const char *identifier, qemuMonitorTestResponseCallback cb, --=20 2.40.1