From nobody Mon Feb 9 10:57:44 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.74 as permitted sender) client-ip=63.128.21.74; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-74.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.74 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=1584987251; cv=none; d=zohomail.com; s=zohoarc; b=erPrMpJxvvjm8N6W+vxQbmSXJM0PBdg8XRJWeknw94ttRbygL9iSK+bwDKI0i/AH9B6grDNRAVlNHJmZXuIwdNgiVp/xkPd7riX3rob8QrO93b2Ltsb6vWHOpDvtIgXZRNNd4ghLkazNdzyTV1qfTWBfsEIET/hX3uhs9qCeDZg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584987251; 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=gJaanq6dTifUJ8SNehMbJ17cR1bj4DdNh+HyAt8BeEg=; b=maJx/HR/5rD9/Tz25ygQxA8Jv+rii4ykFm6LbjgHl3pEI6nNdxPG4dVrXjmeW8MtEIcpW50JC3Lco0PKSQ1XEcUKI3fvejDx2BSSI1q9pLpF2wvpKoLVEH4PHn2ZJndJgxMOFc6mL+HxzX651rVwwS6/wYPkWQMPmN4e+1R1XYY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.74 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-74.mimecast.com (us-smtp-delivery-74.mimecast.com [63.128.21.74]) by mx.zohomail.com with SMTPS id 1584987251833837.1414629762519; Mon, 23 Mar 2020 11:14:11 -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-452-9iw1PrDOMZiXgEjlZpR_fA-1; Mon, 23 Mar 2020 14:12:29 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4960A107ACCA; Mon, 23 Mar 2020 18:12:24 +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 181A119C4F; Mon, 23 Mar 2020 18:12:24 +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 B979B18089D6; Mon, 23 Mar 2020 18:12:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 02NICD3k009467 for ; Mon, 23 Mar 2020 14:12:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id 23CA08D574; Mon, 23 Mar 2020 18:12:13 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9F3349B93C for ; Mon, 23 Mar 2020 18:12:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584987250; 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=gJaanq6dTifUJ8SNehMbJ17cR1bj4DdNh+HyAt8BeEg=; b=hhEoQOKRiJGMKcxWoWA5WKb5Yk4NbksYFhQUliKzaaIMonsuIj97OU5RHkrFSJSiZ9S//B ZlkCSG/mmAy0oMTCTTOEDOzIEBZLcQAGWSrxSmaB6LEFfSqW3KY+nDYw0AjRau+H07wnMT ehXFExqGdHJU+2GMKjB6CcxhKo98m8w= X-MC-Unique: 9iw1PrDOMZiXgEjlZpR_fA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 05/14] testQemuDiskXMLToPropsValidateFileSrcOnly: Move together with rest of xml->json code Date: Mon, 23 Mar 2020 19:11:55 +0100 Message-Id: <1d015915a1a8423d42b6fa2973771db8e5b1a236.1584986997.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.84 on 10.5.11.23 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" The function was misplaced. Group it together with other helper functions for testing disk XML to qemu JSON props conversion. Signed-off-by: Peter Krempa --- tests/qemublocktest.c | 61 ++++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/tests/qemublocktest.c b/tests/qemublocktest.c index dfcf7552c1..312af0d962 100644 --- a/tests/qemublocktest.c +++ b/tests/qemublocktest.c @@ -387,6 +387,37 @@ testQemuDiskXMLToPropsValidateFile(const void *opaque) } +static int +testQemuDiskXMLToPropsValidateFileSrcOnly(const void *opaque) +{ + struct testQemuDiskXMLToJSONData *data =3D (void *) opaque; + g_auto(virBuffer) buf =3D VIR_BUFFER_INITIALIZER; + g_autofree char *jsonpath =3D NULL; + g_autofree char *actual =3D NULL; + size_t i; + + if (data->fail) + return EXIT_AM_SKIP; + + jsonpath =3D g_strdup_printf("%s%s-srconly.json", testQemuDiskXMLToJSO= NPath, + data->name); + + for (i =3D 0; i < data->npropssrc; i++) { + g_autofree char *jsonstr =3D NULL; + + if (!(jsonstr =3D virJSONValueToString(data->propssrc[i], true))) + return -1; + + virBufferAdd(&buf, jsonstr, -1); + } + + actual =3D virBufferContentAndReset(&buf); + + return virTestCompareToFile(actual, jsonpath); +} + + + struct testQemuImageCreateData { const char *name; const char *backingname; @@ -515,36 +546,6 @@ testQemuImageCreate(const void *opaque) } -static int -testQemuDiskXMLToPropsValidateFileSrcOnly(const void *opaque) -{ - struct testQemuDiskXMLToJSONData *data =3D (void *) opaque; - g_auto(virBuffer) buf =3D VIR_BUFFER_INITIALIZER; - g_autofree char *jsonpath =3D NULL; - g_autofree char *actual =3D NULL; - size_t i; - - if (data->fail) - return EXIT_AM_SKIP; - - jsonpath =3D g_strdup_printf("%s%s-srconly.json", testQemuDiskXMLToJSO= NPath, - data->name); - - for (i =3D 0; i < data->npropssrc; i++) { - g_autofree char *jsonstr =3D NULL; - - if (!(jsonstr =3D virJSONValueToString(data->propssrc[i], true))) - return -1; - - virBufferAdd(&buf, jsonstr, -1); - } - - actual =3D virBufferContentAndReset(&buf); - - return virTestCompareToFile(actual, jsonpath); -} - - static const char *bitmapDetectPrefix =3D "qemublocktestdata/bitmap/"; static void --=20 2.24.1