From patchwork Mon Apr 1 16:47:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 161545 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp687608jan; Mon, 1 Apr 2019 09:47:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqyb/ZBLR0Hty5ThTsbiAZuLgc6xpFklPQ6GQ9LSJC/GdfUHrHPSzQ68K8HJ0pYF1nWXBY/L X-Received: by 2002:ac8:2d56:: with SMTP id o22mr55886914qta.321.1554137261550; Mon, 01 Apr 2019 09:47:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554137261; cv=none; d=google.com; s=arc-20160816; b=vtRAZ1j6ni2peK2l8FnWpGagzbnSijWjVUvUSkDjvzEef1q8MTbuBAnVvg1V0rih8+ FZibxBhUtssf5K2G0tUIzgVmR4mN3DSCAc9vn4zq9adEEvnKYvTZCVc77OagRQB2tcme tjkRmqq0jpKbdl0Hw6VEj1JFLtrBfjakVGdSprrcYl+PK46GT9Egqjs/mgmyj55Fgk2p 312t0N0GElZYKfSIBq6CUI/28M0kv3VvoceNt+xoTK9IGmTUUoKL3sI5+wF03BpllweA yc/a7M/BVwvAzlZt/Ue33T7qZLVJbKI2anA894g0uAOhw53grVSmxWiKmdnhs0+Ah1Uc ap+Q== 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=+4NGX0ovBMSYF9KWkhTHRVXXugsxcQHFdrnNH98RhCM=; b=oClG12bt1Em4MRpaNyrpMNClJt92/rjvF0vvA4JQRWSvT5nLVK/BB7+yYlnrUDUKxC qLCfJyVYc+86P6szlpYcAFbhwihh9h4LUbDVF3mr6x+KR2QfGwAetKUC/jktOLad8eTD GS2E+tR/mEqFzfB7OryQluUqRRXQ3mkyEmWQlWnvKKXIPDqVFFFgCWG10gF1FxZoLivv 6KTcUC5KMHSGtPsR+qChxrTNUD6ZiTwywToaT7wY/enMDpM5TjldSQ5l166LFAIf9g+/ OAmyESfQq0mg4Fs7LyvTf4xK43wrAPe0tS3FEZaA8tgcltltUVdo2XgO2ZS7AAefrKLV FX9w== 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 u189si1171444qkc.88.2019.04.01.09.47.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Apr 2019 09:47:41 -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-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 1E7C459447; Mon, 1 Apr 2019 16:47:40 +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 41726601A5; Mon, 1 Apr 2019 16:47:39 +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 D2BE741F3D; Mon, 1 Apr 2019 16:47:36 +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 x31GlZsS026661 for ; Mon, 1 Apr 2019 12:47:35 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1E05D5C28C; Mon, 1 Apr 2019 16:47:35 +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 ABC1E5C25A; Mon, 1 Apr 2019 16:47:34 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Mon, 1 Apr 2019 12:47:18 -0400 Message-Id: <31040eaf236a6e468dc9e88cebaff6bada2a9b58.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 02/12] tests: qemuxml2xml: 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: , 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:40 +0000 (UTC) Just renamed from existing inName and outActiveName Signed-off-by: Cole Robinson --- tests/qemuxml2xmltest.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 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 2dfa9e628b..0ced565fbc 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -26,8 +26,8 @@ enum { }; struct testInfo { - char *inName; - char *outActiveName; + char *infile; + char *outfile; char *outInactiveName; virQEMUCapsPtr qemuCaps; @@ -40,7 +40,7 @@ testXML2XMLActive(const void *opaque) const struct testInfo *info = opaque; return testCompareDomXML2XMLFiles(driver.caps, driver.xmlopt, - info->inName, info->outActiveName, true, + info->infile, info->outfile, true, 0, TEST_COMPARE_DOM_XML2XML_RESULT_SUCCESS); } @@ -51,7 +51,7 @@ testXML2XMLInactive(const void *opaque) { const struct testInfo *info = opaque; - return testCompareDomXML2XMLFiles(driver.caps, driver.xmlopt, info->inName, + return testCompareDomXML2XMLFiles(driver.caps, driver.xmlopt, info->infile, info->outInactiveName, false, 0, TEST_COMPARE_DOM_XML2XML_RESULT_SUCCESS); @@ -66,13 +66,13 @@ testCompareStatusXMLToXMLFiles(const void *opaque) char *actual = NULL; int ret = -1; - if (!(obj = virDomainObjParseFile(data->inName, driver.caps, driver.xmlopt, + if (!(obj = virDomainObjParseFile(data->infile, driver.caps, driver.xmlopt, VIR_DOMAIN_DEF_PARSE_STATUS | VIR_DOMAIN_DEF_PARSE_ACTUAL_NET | VIR_DOMAIN_DEF_PARSE_PCI_ORIG_STATES | VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE | VIR_DOMAIN_DEF_PARSE_ALLOW_POST_PARSE_FAIL))) { - VIR_TEST_DEBUG("\nfailed to parse '%s'\n", data->inName); + VIR_TEST_DEBUG("\nfailed to parse '%s'\n", data->infile); goto cleanup; } @@ -82,11 +82,11 @@ testCompareStatusXMLToXMLFiles(const void *opaque) VIR_DOMAIN_DEF_FORMAT_ACTUAL_NET | VIR_DOMAIN_DEF_FORMAT_PCI_ORIG_STATES | VIR_DOMAIN_DEF_FORMAT_CLOCK_ADJUST))) { - VIR_TEST_DEBUG("\nfailed to format back '%s'\n", data->inName); + VIR_TEST_DEBUG("\nfailed to format back '%s'\n", data->infile); goto cleanup; } - if (virTestCompareToFile(actual, data->outActiveName) < 0) + if (virTestCompareToFile(actual, data->outfile) < 0) goto cleanup; ret = 0; @@ -101,8 +101,8 @@ testCompareStatusXMLToXMLFiles(const void *opaque) static void testInfoClear(struct testInfo *info) { - VIR_FREE(info->inName); - VIR_FREE(info->outActiveName); + VIR_FREE(info->infile); + VIR_FREE(info->outfile); VIR_FREE(info->outInactiveName); virObjectUnref(info->qemuCaps); @@ -134,7 +134,7 @@ testInfoSetPaths(struct testInfo *info, const char *name, int when) { - if (virAsprintf(&info->inName, "%s/qemuxml2argvdata/%s.xml", + if (virAsprintf(&info->infile, "%s/qemuxml2argvdata/%s.xml", abs_srcdir, name) < 0) goto error; @@ -155,15 +155,15 @@ testInfoSetPaths(struct testInfo *info, } if (when & WHEN_ACTIVE) { - if (virAsprintf(&info->outActiveName, + if (virAsprintf(&info->outfile, "%s/qemuxml2xmloutdata/%s-active.xml", abs_srcdir, name) < 0) goto error; - if (!virFileExists(info->outActiveName)) { - VIR_FREE(info->outActiveName); + if (!virFileExists(info->outfile)) { + VIR_FREE(info->outfile); - if (virAsprintf(&info->outActiveName, + if (virAsprintf(&info->outfile, "%s/qemuxml2xmloutdata/%s.xml", abs_srcdir, name) < 0) goto error; @@ -184,8 +184,8 @@ static int testInfoSetStatusPaths(struct testInfo *info, const char *name) { - if (virAsprintf(&info->inName, "%s%s-in.xml", statusPath, name) < 0 || - virAsprintf(&info->outActiveName, "%s%s-out.xml", statusPath, name) < 0) + if (virAsprintf(&info->infile, "%s%s-in.xml", statusPath, name) < 0 || + virAsprintf(&info->outfile, "%s%s-out.xml", statusPath, name) < 0) goto error; return 0; @@ -240,7 +240,7 @@ mymain(void) ret = -1; \ } \ \ - if (info.outActiveName) { \ + if (info.outfile) { \ if (virTestRun("QEMU XML-2-XML-active " name, \ testXML2XMLActive, &info) < 0) \ ret = -1; \