From nobody Sun Feb 8 11:40:34 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1554137277466768.0660276780193; Mon, 1 Apr 2019 09:47:57 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 1997F5944D; Mon, 1 Apr 2019 16:47:56 +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 DE14187B9; Mon, 1 Apr 2019 16:47:55 +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 9CE281819AFF; Mon, 1 Apr 2019 16:47:55 +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 x31Glamh026682 for ; Mon, 1 Apr 2019 12:47:36 -0400 Received: by smtp.corp.redhat.com (Postfix) id A247D5C27C; Mon, 1 Apr 2019 16:47:36 +0000 (UTC) Received: from worklaptop.redhat.com (ovpn-124-128.rdu2.redhat.com [10.10.124.128]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3D1985C28C; Mon, 1 Apr 2019 16:47:35 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Mon, 1 Apr 2019 12:47:20 -0400 Message-Id: <30eaad11068f933f64ac07af35495bb5b2953377.1554137098.git.crobinso@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 Subject: [libvirt] [PATCH 04/12] tests: qemuxml2argv: Add info->{in, out}file 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: , Content-Transfer-Encoding: quoted-printable 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-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 01 Apr 2019 16:47:56 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Track infile and outfile in testInfo. This is step towards moving path creation out of the test case, which will eventually help sharing more code with qemuxml2xmltest.c Signed-off-by: Cole Robinson Reviewed-by: Andrea Bolognani --- tests/qemuxml2argvtest.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 0c0dcae197..ff7bacf8db 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -299,6 +299,8 @@ typedef enum { struct testInfo { const char *name; const char *suffix; + char *infile; + char *outfile; virQEMUCapsPtr qemuCaps; const char *migrateFrom; int migrateFd; @@ -427,8 +429,6 @@ static int testCompareXMLToArgv(const void *data) { struct testInfo *info =3D (void *) data; - char *xml =3D NULL; - char *args =3D NULL; char *migrateURI =3D NULL; char *actualargv =3D NULL; const char *suffix =3D info->suffix; @@ -471,9 +471,9 @@ testCompareXMLToArgv(const void *data) if (qemuTestCapsCacheInsert(driver.qemuCapsCache, info->qemuCaps) < 0) goto cleanup; =20 - if (virAsprintf(&xml, "%s/qemuxml2argvdata/%s.xml", + if (virAsprintf(&info->infile, "%s/qemuxml2argvdata/%s.xml", abs_srcdir, info->name) < 0 || - virAsprintf(&args, "%s/qemuxml2argvdata/%s%s.args", + virAsprintf(&info->outfile, "%s/qemuxml2argvdata/%s%s.args", abs_srcdir, info->name, suffix) < 0) goto cleanup; =20 @@ -486,7 +486,8 @@ testCompareXMLToArgv(const void *data) goto cleanup; =20 parseFlags |=3D VIR_DOMAIN_DEF_PARSE_INACTIVE; - if (!(vm->def =3D virDomainDefParseFile(xml, driver.caps, driver.xmlop= t, + if (!(vm->def =3D virDomainDefParseFile(info->infile, + driver.caps, driver.xmlopt, NULL, parseFlags))) { if (flags & FLAG_EXPECT_PARSE_ERROR) goto ok; @@ -502,7 +503,7 @@ testCompareXMLToArgv(const void *data) goto cleanup; =20 if (!virDomainDefCheckABIStability(vm->def, vm->def, driver.xmlopt)) { - VIR_TEST_DEBUG("ABI stability check failed on %s", xml); + VIR_TEST_DEBUG("ABI stability check failed on %s", info->infile); goto cleanup; } =20 @@ -570,7 +571,7 @@ testCompareXMLToArgv(const void *data) if (!(actualargv =3D virCommandToString(cmd, false))) goto cleanup; =20 - if (virTestCompareToFile(actualargv, args) < 0) + if (virTestCompareToFile(actualargv, info->outfile) < 0) goto cleanup; =20 ret =3D 0; @@ -600,8 +601,6 @@ testCompareXMLToArgv(const void *data) virSetConnectStorage(NULL); virObjectUnref(conn); VIR_FREE(migrateURI); - VIR_FREE(xml); - VIR_FREE(args); return ret; } =20 @@ -754,6 +753,8 @@ testInfoSetArgs(struct testInfo *info, static void testInfoClear(struct testInfo *info) { + VIR_FREE(info->infile); + VIR_FREE(info->outfile); virObjectUnref(info->qemuCaps); } =20 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list