From nobody Sun Feb 8 18:31:15 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1606762584; cv=none; d=zohomail.com; s=zohoarc; b=lPcoG1PGacJytlDVE7VIASLmQg6rqvzgLjl4mYnRHfJHPmCC+og0RF8cV/O+5z3enEEVekzRa7ydeqozz7yvtN+sSX7Vl/AMq1DtjLhf3GoTvvt/OcGZ3r6lNMlRYxE7PoagY6sEVc047X5huA3OBRu4bCiE5Gf13DmVFAN0868= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606762584; 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=avlqPZXKLyl6MVVCxpPj1DK+SGIzW6bCTWme9cQ6qs8=; b=N6FbJ/dZNmGAJ/+9sW9CCilxwzHDH+mbT6bWj7q+FmzlDqCrEltLpvro9JHZIsrbo04xuKhixV1JKdjIkA90JhrXVJNJudQeSTQiDP8M0vTtly022NWo7FYD/b2rBgHKs/rTnOBNScmvUcS1fq/e5n/neIBJsYxwM+0pn+WTknU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 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-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1606762584463548.0039566338826; Mon, 30 Nov 2020 10:56:24 -0800 (PST) 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-322-zdU-62-lNEmCoxjyJLfWjA-1; Mon, 30 Nov 2020 13:56:20 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6BCDC107464F; Mon, 30 Nov 2020 18:56:13 +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 47B9560C6A; Mon, 30 Nov 2020 18:56:13 +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 106AA1809CB1; Mon, 30 Nov 2020 18:56:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0AUIttFN014272 for ; Mon, 30 Nov 2020 13:55:55 -0500 Received: by smtp.corp.redhat.com (Postfix) id 6252D60C69; Mon, 30 Nov 2020 18:55:55 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id AF38E60C67 for ; Mon, 30 Nov 2020 18:55:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606762583; 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=avlqPZXKLyl6MVVCxpPj1DK+SGIzW6bCTWme9cQ6qs8=; b=FK2ylSJkHD5+vt+n7Q3MOyLq0sMFHDyZZ9fTtNUcNpRF1nq1+QZ+uz3c6NYk/PLdr0V+5Q 01QlOhK6ykppkdjnQ1o2QEtZXv4KE0G6GgZMB7qlCzhG7XCUwlk0Isn7lWRnwfFMg8saye kUP0QEp/1EyLFO+qJkJsxE0hKM13NKY= X-MC-Unique: zdU-62-lNEmCoxjyJLfWjA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 10/24] tests: qemuxml2argv: Don't check whether -netdev was QAPIfied repeatedly Date: Mon, 30 Nov 2020 19:55:23 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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.12 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) Content-Type: text/plain; charset="utf-8" Check once before looping through the args. Signed-off-by: Peter Krempa --- tests/qemuxml2argvtest.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 42d147243e..ae8eaa7768 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -524,6 +524,7 @@ testCompareXMLToArgvValidateSchema(virQEMUDriverPtr drv, g_autoptr(GHashTable) schema =3D NULL; g_autoptr(virCommand) cmd =3D NULL; unsigned int parseFlags =3D info->parseFlags; + bool netdevQAPIfied =3D false; if (info->schemafile) schema =3D testQEMUSchemaLoad(info->schemafile); @@ -552,6 +553,8 @@ testCompareXMLToArgvValidateSchema(virQEMUDriverPtr drv, if (virCommandGetArgList(cmd, &args, &nargs) < 0) return -1; + netdevQAPIfied =3D !virQEMUQAPISchemaPathExists("netdev_add/arg-type/t= ype/!string", schema); + for (i =3D 0; i < nargs; i++) { g_auto(virBuffer) debug =3D VIR_BUFFER_INITIALIZER; g_autoptr(virJSONValue) jsonargs =3D NULL; @@ -569,13 +572,14 @@ testCompareXMLToArgvValidateSchema(virQEMUDriverPtr d= rv, i++; } else if (STREQ(args[i], "-netdev")) { + if (!netdevQAPIfied) { + i++; + continue; + } + if (!(jsonargs =3D virJSONValueFromString(args[i + 1]))) return -1; - /* skip the validation for pre-QAPIfication cases */ - if (virQEMUQAPISchemaPathExists("netdev_add/arg-type/type/!str= ing", schema)) - continue; - if (testQEMUSchemaValidateCommand("netdev_add", jsonargs, schema, false, false, &debug= ) < 0) { VIR_TEST_VERBOSE("failed to validate -netdev '%s' against = QAPI schema: %s", --=20 2.28.0