From nobody Mon Feb 9 06:34:06 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1588186179; cv=none; d=zohomail.com; s=zohoarc; b=fD7pfrjzIBtO3oEhsdvtFxzFMPz+2dHPq9YUTGi9BPcLYUSMNVbp1nFVjDzPQnNHk5wPFyDe5A9oFbAz1d20+jut5eteQLbQF5CPhokl2EAeAd/Cdyhcx++4aSEO2+JmQfH99X8oDsQDZTXW92YQUkHjqcdYZ5liJWqjLWBrkno= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588186179; 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=W6dQ/jBzZ6TtvE7E6Zq8LVCC26YXUyul3Eh55XPmJXA=; b=X/vifUid2KgpvJZkHTpSvNpKHt+6DUkHDMMVoVaMg+SzfnPjfPyFhEdaOc6xL1hNvaH+0oln6VBREO+nlL8WQ8TLXWtM4+KuyfhABStogNA4KLAfvb//CIfvKBRfOvvrDHj3SdJWqQeEYu/MHF19ExK2rJjZJwoY5jUhzQErHb8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1588186179494220.4533327636144; Wed, 29 Apr 2020 11:49:39 -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-157-gviGW7cBOTyld9XUUX8_Vw-1; Wed, 29 Apr 2020 14:49:34 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C28F8835B41; Wed, 29 Apr 2020 18:49:28 +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 564F95C1BE; Wed, 29 Apr 2020 18:49:28 +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 6E3121809554; Wed, 29 Apr 2020 18:49:27 +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 03TInPur001515 for ; Wed, 29 Apr 2020 14:49:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id 4E2655C1BE; Wed, 29 Apr 2020 18:49:25 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.40.208.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id BA9455C241 for ; Wed, 29 Apr 2020 18:49:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588186178; 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=W6dQ/jBzZ6TtvE7E6Zq8LVCC26YXUyul3Eh55XPmJXA=; b=KqxXv2NVOibFnuw45vE2MGT5zdLGmK9Jj2RlL97MjXLRIIYzvOCdIoQC5HL9BFUsf1Vluw MpKc1Xpcq/a0Dt2v+txOV96qXrX6+lF5CUDVagnnvTc1jkqygDlx5+6fbd7QNJ9EXR1epz SBLwez3IhG97qSPMFzvBGSvD1xFRs6Y= X-MC-Unique: gviGW7cBOTyld9XUUX8_Vw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 03/15] qemuMonitorTestProcessCommandDefaultValidate: Use testQEMUSchemaValidateCommand Date: Wed, 29 Apr 2020 20:49:03 +0200 Message-Id: <14414cbd37c599c2e8198ccb2d4ea7cb28dbbc88.1588185999.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.79 on 10.5.11.16 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" Remove the ad-hoc command validation in favor of the new helper. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/qemumonitortestutils.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/tests/qemumonitortestutils.c b/tests/qemumonitortestutils.c index 4ca29ab061..df780643dd 100644 --- a/tests/qemumonitortestutils.c +++ b/tests/qemumonitortestutils.c @@ -537,9 +537,6 @@ qemuMonitorTestProcessCommandDefaultValidate(qemuMonito= rTestPtr test, virJSONValuePtr args) { g_auto(virBuffer) debug =3D VIR_BUFFER_INITIALIZER; - virJSONValuePtr schemaroot; - g_autoptr(virJSONValue) emptyargs =3D NULL; - g_autofree char *schemapath =3D NULL; if (!test->qapischema) return 0; @@ -555,20 +552,13 @@ qemuMonitorTestProcessCommandDefaultValidate(qemuMoni= torTestPtr test, if (STREQ(cmdname, "device_add")) return 0; - schemapath =3D g_strdup_printf("%s/arg-type", cmdname); - - if (virQEMUQAPISchemaPathGet(schemapath, test->qapischema, &schemaroot= ) < 0 || - !schemaroot) { - qemuMonitorTestError("command '%s' not found in QAPI schema", cmdn= ame); - return -1; - } + if (testQEMUSchemaValidateCommand(cmdname, args, test->qapischema, &de= bug) < 0) { + if (virTestGetDebug() =3D=3D 2) { + g_autofree char *argstr =3D NULL; - if (!args) - args =3D emptyargs =3D virJSONValueNewObject(); + if (args) + argstr =3D virJSONValueToString(args, true); - if (testQEMUSchemaValidate(args, schemaroot, test->qapischema, &debug)= < 0) { - if (virTestGetDebug() =3D=3D 2) { - g_autofree char *argstr =3D virJSONValueToString(args, true); fprintf(stderr, "\nfailed to validate arguments of '%s' against QAPI s= chema\n" "args:\n%s\nvalidator output:\n %s\n", --=20 2.26.2