From patchwork Mon Apr 1 16:47:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 161551 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp687907jan; Mon, 1 Apr 2019 09:47:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqxCBrBxn+zruxLMBFSmaE3UsXISeVsDEAg45gCsLr0oK95YRLXckfuyiKKm+MlCxoSVDl4B X-Received: by 2002:ac8:3fa8:: with SMTP id d37mr53865187qtk.206.1554137279697; Mon, 01 Apr 2019 09:47:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554137279; cv=none; d=google.com; s=arc-20160816; b=UWYuv3uON9oI3PDexd+EaCIzX9pOI7kTMjZkgfC9U3LKmkGW4UMV8j/EV+WPrIEwSr gUQ1y2sgn85LrEDBbLZkGk0ipTrVLM7E5K4DBzXtOxs6dO2Rsx3O+36kqDxNCl6tFDSE Iz1YFKJwnXa6NumYv1h9jPQlri1z9VBNGbCNRLxIkNSVOg5lLuz9JseHtXw1IlVwP2TB YaqiwYw5040t1gJddVQRPhKHMaMDEWR8KBXODycRanImbZda9AThtc6EhL2yos9pFvIV v23DwtpmJmp2DwcJoMYgJmsCvHyS2o/LpDqGh09eBwg8Uc/B85gFcbx+rtBrmUnNuRDP PRQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :delivered-to; bh=S2gn6HpnuJfUqX/l+nPQZODM+z54R2CU4c0mP/sm9sI=; b=gq1X9HfdzkEsWrp4yb4fP7ZStTRz2PU4nqpRH6iJOcWkPrjgMpW8Fr7e6kFlueqT6R Je+Wymy7m1PjD1+RRwLyZ6e93jd9/uITeJAZPq36W4ZouGsuGQx8MygAa1KilJi6hX6Z KEgT4XtKsU1OkU1NWkE2FPtN//9J6zR6vqyTrb49PKrAVT4sRPNepy2sAqsFvuslJN3j nu1yOEuAoL9EYHIMzaZmnCSTzZcR2HyeYZcSgU4ipWFwOz5Fgytz8wYvadcYxtXUPehp uKZT9FRg4rJ4BKQHbtXuZKQXDFo715X5GlG/doFxacJ2r01M945H5EtjoAXy7ju5nOZd h5pQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id d4si384281qkk.210.2019.04.01.09.47.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Apr 2019 09:47:59 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 mx1.redhat.com (Postfix) with ESMTPS id 2FA0D6697B; Mon, 1 Apr 2019 16:47:58 +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 0615828540; Mon, 1 Apr 2019 16:47:58 +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 B39D4181A000; Mon, 1 Apr 2019 16:47:57 +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 x31GldA5026744 for ; Mon, 1 Apr 2019 12:47:39 -0400 Received: by smtp.corp.redhat.com (Postfix) id B33F35C27C; Mon, 1 Apr 2019 16:47:39 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.redhat.com (ovpn-124-128.rdu2.redhat.com [10.10.124.128]) by smtp.corp.redhat.com (Postfix) with ESMTP id 49AE05C206; Mon, 1 Apr 2019 16:47:39 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Mon, 1 Apr 2019 12:47:25 -0400 Message-Id: <277ec917f362a5185bb1603ff98aed3e9f54a138.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 09/12] tests: qemuxml2xml: Use struct testQemuInfo 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-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 01 Apr 2019 16:47:58 +0000 (UTC) The qemuxml2xml testInfo is now just a subset of testQemuInfo, so it's a drop in replacement Signed-off-by: Cole Robinson --- tests/qemuxml2xmltest.c | 41 ++++++++++++----------------------------- 1 file changed, 12 insertions(+), 29 deletions(-) -- 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list Reviewed-by: Andrea Bolognani diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 538ccae8fd..ba622a3d2f 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -25,18 +25,11 @@ enum { WHEN_BOTH = 3, }; -struct testInfo { - char *infile; - char *outfile; - - virQEMUCapsPtr qemuCaps; -}; - static int testXML2XMLActive(const void *opaque) { - const struct testInfo *info = opaque; + const struct testQemuInfo *info = opaque; return testCompareDomXML2XMLFiles(driver.caps, driver.xmlopt, info->infile, info->outfile, true, 0, @@ -47,7 +40,7 @@ testXML2XMLActive(const void *opaque) static int testXML2XMLInactive(const void *opaque) { - const struct testInfo *info = opaque; + const struct testQemuInfo *info = opaque; return testCompareDomXML2XMLFiles(driver.caps, driver.xmlopt, info->infile, info->outfile, false, 0, @@ -58,7 +51,7 @@ testXML2XMLInactive(const void *opaque) static int testCompareStatusXMLToXMLFiles(const void *opaque) { - const struct testInfo *data = opaque; + const struct testQemuInfo *data = opaque; virDomainObjPtr obj = NULL; char *actual = NULL; int ret = -1; @@ -95,18 +88,8 @@ testCompareStatusXMLToXMLFiles(const void *opaque) } -static void -testInfoClear(struct testInfo *info) -{ - VIR_FREE(info->infile); - VIR_FREE(info->outfile); - - virObjectUnref(info->qemuCaps); -} - - static int -testInfoSetCommon(struct testInfo *info, +testInfoSetCommon(struct testQemuInfo *info, int gic) { if (!(info->qemuCaps = virQEMUCapsNew())) @@ -121,12 +104,12 @@ testInfoSetCommon(struct testInfo *info, return 0; error: - testInfoClear(info); + testQemuInfoClear(info); return -1; } static int -testInfoSetPaths(struct testInfo *info, +testInfoSetPaths(struct testQemuInfo *info, const char *name, int when) { @@ -155,7 +138,7 @@ testInfoSetPaths(struct testInfo *info, return 0; error: - testInfoClear(info); + testQemuInfoClear(info); return -1; } @@ -163,7 +146,7 @@ testInfoSetPaths(struct testInfo *info, static const char *statusPath = abs_srcdir "/qemustatusxml2xmldata/"; static int -testInfoSetStatusPaths(struct testInfo *info, +testInfoSetStatusPaths(struct testQemuInfo *info, const char *name) { if (virAsprintf(&info->infile, "%s%s-in.xml", statusPath, name) < 0 || @@ -173,7 +156,7 @@ testInfoSetStatusPaths(struct testInfo *info, return 0; error: - testInfoClear(info); + testQemuInfoClear(info); return -1; } @@ -185,7 +168,7 @@ mymain(void) { int ret = 0; char *fakerootdir; - struct testInfo info; + struct testQemuInfo info; virQEMUDriverConfigPtr cfg = NULL; if (VIR_STRDUP_QUIET(fakerootdir, FAKEROOTDIRTEMPLATE) < 0) { @@ -234,7 +217,7 @@ mymain(void) testXML2XMLActive, &info) < 0) \ ret = -1; \ } \ - testInfoClear(&info); \ + testQemuInfoClear(&info); \ } while (0) # define NONE QEMU_CAPS_LAST @@ -1232,7 +1215,7 @@ mymain(void) testCompareStatusXMLToXMLFiles, &info) < 0) \ ret = -1; \ \ - testInfoClear(&info); \ + testQemuInfoClear(&info); \ } while (0)