From nobody Mon Feb 9 08:31:37 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=1583771106; cv=none; d=zohomail.com; s=zohoarc; b=fORAcFLVNADO4dl8ok5o+XoovbveuSfGRgQAjZTwjAvENFGtI1CYMFPV5zxOaYZjd4yt9b6q/ABY0eLivwNzgXDQF5UGA0w5ETixQzJJxVX6Q1ocrwaIzCc7lFKL39R3ZmQjF/C1N4GeaBMB+JO7MDkRUGF8RaUc2iqS+oI8T+A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583771106; 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=ktastaghQuWORQ7nhCMaTKPnlqYXi2NDqTMgrpN8emo=; b=ZXMGMGgZ02t02XLkcBSTt9zPsMIqf6A4zIdPlf4fiBiTnlsW9hq2dSUYLE+eFmj2I5AbFsruhZZzNz1khU4Yle2rOJP1sfYfpE25BwjHlbupW66p5WawLfw2LEAf7nYJ3ddbhMH4EY526Mj1UZcfCmhFzklY9a6CMRL7DTE97N4= 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 1583771106929691.6044684959458; Mon, 9 Mar 2020 09:25:06 -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-176-feDROLQ2PPy_rlTYWzK9sw-1; Mon, 09 Mar 2020 12:24:18 -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 B3CBC8010EF; Mon, 9 Mar 2020 16:24:12 +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 890578D569; Mon, 9 Mar 2020 16:24:12 +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 3AC8B18034FF; Mon, 9 Mar 2020 16:24:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 029GNhiZ020944 for ; Mon, 9 Mar 2020 12:23:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id F2FDF90A03; Mon, 9 Mar 2020 16:23:42 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 79F5190779 for ; Mon, 9 Mar 2020 16:23:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583771105; 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=ktastaghQuWORQ7nhCMaTKPnlqYXi2NDqTMgrpN8emo=; b=Te9UBjQZW34WBjSFd+f1vOVyq0Zsu76xuyY3MUrpVa/yt5JzymSTp/sW1kIS7rNyZTph9J FG58bwgWmdEGxkaAPtgiLR3GLn70RgpKGkNWRxP3HcYH7eGESWrp5h7jQiYCJ/V/tzxTB+ wkM9eBhU+2HnbXi8oXYoBGNUA7PJJ/M= X-MC-Unique: feDROLQ2PPy_rlTYWzK9sw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 27/30] qemublocktest: Extract schema root for blockdev-add validation Date: Mon, 9 Mar 2020 17:23:07 +0100 Message-Id: <0d026c23c69c145917a73f22fa197d58152de022.1583770683.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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" Move lookup of the schema root earlier so that multiple functions can use it for validation. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/qemublocktest.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index 735ba5cdde..f803c9c6b3 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -868,6 +868,7 @@ mymain(void) char *capslatest_x86_64 =3D NULL; virQEMUCapsPtr caps_x86_64 =3D NULL; g_autoptr(virHashTable) qmp_schema_x86_64 =3D NULL; + virJSONValuePtr qmp_schemaroot_x86_64_blockdev_add =3D NULL; g_autoptr(virStorageSource) bitmapSourceChain =3D NULL; if (qemuTestDriverInit(&driver) < 0) @@ -895,6 +896,15 @@ mymain(void) goto cleanup; } + if (virQEMUQAPISchemaPathGet("blockdev-add/arg-type", + qmp_schema_x86_64, + &qmp_schemaroot_x86_64_blockdev_add) < 0 = || + !qmp_schemaroot_x86_64_blockdev_add) { + VIR_TEST_VERBOSE("failed to find schema entry for blockdev-add"); + ret =3D -1; + goto cleanup; + } + virTestCounterReset("qemu storage source xml->json->xml "); #define TEST_JSON_FORMAT(tpe, xmlstr) \ @@ -994,15 +1004,7 @@ mymain(void) #define TEST_DISK_TO_JSON(nme) TEST_DISK_TO_JSON_FULL(nme, false) diskxmljsondata.schema =3D qmp_schema_x86_64; - - if (virQEMUQAPISchemaPathGet("blockdev-add/arg-type", - diskxmljsondata.schema, - &diskxmljsondata.schemaroot) < 0 || - !diskxmljsondata.schemaroot) { - VIR_TEST_VERBOSE("failed to find schema entry for blockdev-add"); - ret =3D -1; - goto cleanup; - } + diskxmljsondata.schemaroot =3D qmp_schemaroot_x86_64_blockdev_add; TEST_DISK_TO_JSON_FULL("nodename-long-format", true); TEST_DISK_TO_JSON_FULL("nodename-long-protocol", true); --=20 2.24.1