From nobody Mon Feb 9 08:29:58 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1588186190; cv=none; d=zohomail.com; s=zohoarc; b=l7IfDO05t6W+cpwmLQQQJKaM788+w4+/GiYDkV/SQZR0ucEbwGF4vgjRhoINRBYgE+xhiZQabpM6P4hXo2emIS76LwnubAvsYqCPz1OBnuL+nlaCUIoq+bjdBKoDjexzlqba1WXsJeM+1494dnplqnncerb4evvvk4McnhR7vJ4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588186190; 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=eMOoTmEjedurLw5rTRECzNq9d6Y+4sXX7H/9QKHwaHk=; b=nWq4Rhq8BBuHceADiZEJdzlpS7jed0MhfNO56pgh7GDwdfMMlEpigupikCul95pu3cCoU03uR/0ecrIQChTzY5+dD45heCOh0EmWP3VLV61W1Kszry33vKxSUDH15GI8LpA0/Qz5co+ccm3oT5YeHgAaxgk7kvYY4A8OeYbPCQc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1588186190514781.7413274790307; Wed, 29 Apr 2020 11:49:50 -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-388-XMtbtjOiPZ2ddYwMfzfvOA-1; Wed, 29 Apr 2020 14:49:46 -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 31F681800D4A; Wed, 29 Apr 2020 18:49:41 +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 07A2C600E5; Wed, 29 Apr 2020 18:49:41 +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 BAA541809542; Wed, 29 Apr 2020 18:49:40 +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 03TInQEk001525 for ; Wed, 29 Apr 2020 14:49:26 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3A6C75C241; Wed, 29 Apr 2020 18:49:26 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.40.208.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id A6CCE5C1BE for ; Wed, 29 Apr 2020 18:49:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588186189; 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=eMOoTmEjedurLw5rTRECzNq9d6Y+4sXX7H/9QKHwaHk=; b=YJwZnuOssFv4yFkUwZCU93DoThFVFhAIwVUan0A5WSVt1l5y8ToMnm5eY4T5x0vlAVTMh0 02VV1oXX2H6HHV2GZkbob/N8G9+3PbEYUkX+B32SbGmPcXTdzjpX9IyRYyjGJMKuWy0qeP ToB2ef06OBt0usMlmjFawE6bupQfuDc= X-MC-Unique: XMtbtjOiPZ2ddYwMfzfvOA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 04/15] qemuMonitorTestProcessCommandDefaultValidate: Clean up return value use Date: Wed, 29 Apr 2020 20:49:04 +0200 Message-Id: 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.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" We no longer return the error via the monitor, so the function no longer returns '1'. Remove the mention from comment and fix callers to stop looking for the return value of '1'. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/qemumonitortestutils.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c index df780643dd..3dc4b674f3 100644 --- a/tests/qemumonitortestutils.c +++ b/tests/qemumonitortestutils.c @@ -529,8 +529,7 @@ qemuMonitorTestHandlerDataFree(void *opaque) } -/* Returns -1 on error, 0 if validation was successful/not necessary, 1 if - * the validation has failed, and the reply was properly constructed */ +/* Returns -1 on error, 0 if validation was successful/not necessary */ static int qemuMonitorTestProcessCommandDefaultValidate(qemuMonitorTestPtr test, const char *cmdname, @@ -585,7 +584,6 @@ qemuMonitorTestProcessCommandDefault(qemuMonitorTestPtr= test, g_autoptr(virJSONValue) val =3D NULL; virJSONValuePtr cmdargs =3D NULL; const char *cmdname; - int rc; if (!(val =3D virJSONValueFromString(cmdstr))) return -1; @@ -596,10 +594,8 @@ qemuMonitorTestProcessCommandDefault(qemuMonitorTestPt= r test, } cmdargs =3D virJSONValueObjectGet(val, "arguments"); - if ((rc =3D qemuMonitorTestProcessCommandDefaultValidate(test, cmdname= , cmdargs)) < 0) + if (qemuMonitorTestProcessCommandDefaultValidate(test, cmdname, cmdarg= s) < 0) return -1; - if (rc =3D=3D 1) - return 0; if (data->command_name && STRNEQ(data->command_name, cmdname)) { qemuMonitorTestErrorInvalidCommand(data->command_name, cmdname); @@ -641,7 +637,6 @@ qemuMonitorTestProcessCommandVerbatim(qemuMonitorTestPt= r test, virJSONValuePtr cmdargs; const char *cmdname; int ret =3D -1; - int rc; /* JSON strings will be reformatted to simplify checking */ if (!(json =3D virJSONValueFromString(cmdstr)) || @@ -653,12 +648,8 @@ qemuMonitorTestProcessCommandVerbatim(qemuMonitorTestP= tr test, /* in this case we do a best-effort schema check if we can find the co= mmand */ if ((cmdname =3D virJSONValueObjectGetString(json, "execute"))) { cmdargs =3D virJSONValueObjectGet(json, "arguments"); - - if ((rc =3D qemuMonitorTestProcessCommandDefaultValidate(test, cmd= name, cmdargs)) < 0) + if (qemuMonitorTestProcessCommandDefaultValidate(test, cmdname, cm= dargs) < 0) return -1; - - if (rc =3D=3D 1) - return 0; } if (STREQ(data->command_name, cmdstr)) { --=20 2.26.2