From nobody Sat Feb 7 07:11:21 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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 170.10.129.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=1638282845; cv=none; d=zohomail.com; s=zohoarc; b=gOmPGDa9EgoFGqlXcukDO0WzVCsIY4ZyC4EuIBUv4yfaltmeoXbF5ACnw9sGxHVMr6Fi5EO1+K7JeqajQVuXJ+k5vKun57YsGwgf2wEzb3WsqJCyFa4Lr98jPWlVsYBdtP9VVyFcQbrNwLzv7GxTZoUmHSuz9O0IgX6CO6CYmSg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1638282845; 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=42BQVCq0b/1BnIKUxu3jRxT8LdLp+bjXg2clOft+0do=; b=A2Kj7CzsbAp352fFYS/hlJai4uYHYPaClBkQgNc9eUXqyNEev7rNzXJeHviQwZqrp8HphylOxwtyIYitlwPHY//zi9f9z2g8PZi5olzwLeft0iCaEzFoZaLj8Hy8qbTBgLrScVNjdm20HHLn19golcqhSJgxlAZirw45iJOuf8s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1638282845823795.157675364251; Tue, 30 Nov 2021 06:34:05 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-36-kNDMxSvdPee-B_Mbklv1DA-1; Tue, 30 Nov 2021 09:33:34 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6B2541015DC1; Tue, 30 Nov 2021 14:33:25 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4F04760854; Tue, 30 Nov 2021 14:33:25 +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 E87C04A70B; Tue, 30 Nov 2021 14:33:24 +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 1AUEXKQR022897 for ; Tue, 30 Nov 2021 09:33:20 -0500 Received: by smtp.corp.redhat.com (Postfix) id E7EB860C13; Tue, 30 Nov 2021 14:33:20 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5351D78C34 for ; Tue, 30 Nov 2021 14:33:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1638282844; 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=42BQVCq0b/1BnIKUxu3jRxT8LdLp+bjXg2clOft+0do=; b=NOAYKdjQ1bM+AmmGtyx+Blj0OW8rDolfpPbt8+vytQN0FMN/1gri+CnqwUoMGDk+pACNsh YNU/DC1OB2Nq+rG+ruZODZFiAFD6kwe5TPq49ToSlXv+Bnep5wdjYmmUllXedXwcXc8fp3 5T7p8PFvcoqJ9+MUn1Zc81HbC10hvDk= X-MC-Unique: kNDMxSvdPee-B_Mbklv1DA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 19/23] qemumonitorjsontest: mymain: Automatically free GHashTable Date: Tue, 30 Nov 2021 15:32:03 +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.13 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) X-ZM-MESSAGEID: 1638282847798100001 Content-Type: text/plain; charset="utf-8" Use separate automatically cleared variables for the x86_64 and s390 versions of the QAPI schema. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- tests/qemumonitorjsontest.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c index 91a9193f2a..4c882fa5d3 100644 --- a/tests/qemumonitorjsontest.c +++ b/tests/qemumonitorjsontest.c @@ -2890,6 +2890,8 @@ mymain(void) int ret =3D 0; virQEMUDriver driver; testQemuMonitorJSONSimpleFuncData simpleFunc; + g_autoptr(GHashTable) qapischema_x86_64 =3D NULL; + g_autoptr(GHashTable) qapischema_s390x =3D NULL; struct testQAPISchemaData qapiData; g_autoptr(virJSONValue) metaschema =3D NULL; g_autofree char *metaschemastr =3D NULL; @@ -2899,12 +2901,14 @@ mymain(void) virEventRegisterDefaultImpl(); - if (!(qapiData.schema =3D testQEMUSchemaLoadLatest("x86_64"))) { - VIR_TEST_VERBOSE("failed to load qapi schema"); + if (!(qapischema_x86_64 =3D testQEMUSchemaLoadLatest("x86_64"))) { + VIR_TEST_VERBOSE("failed to load x86_64 qapi schema"); ret =3D -1; goto cleanup; } + qapiData.schema =3D qapischema_x86_64; + #define DO_TEST(name) \ do { \ testGenericData data =3D { driver.xmlopt, qapiData.schema }; \ @@ -3171,18 +3175,18 @@ mymain(void) #undef DO_TEST_QUERY_JOBS - virHashFree(qapiData.schema); - if (!(qapiData.schema =3D testQEMUSchemaLoadLatest("s390x"))) { + if (!(qapischema_s390x =3D testQEMUSchemaLoadLatest("s390x"))) { VIR_TEST_VERBOSE("failed to load qapi schema for s390x"); ret =3D -1; goto cleanup; } + qapiData.schema =3D qapischema_s390x; + DO_TEST(qemuMonitorJSONGetCPUModelComparison); DO_TEST(qemuMonitorJSONGetCPUModelBaseline); cleanup: - virHashFree(qapiData.schema); qemuTestDriverFree(&driver); return (ret =3D=3D 0) ? EXIT_SUCCESS : EXIT_FAILURE; } --=20 2.31.1