From patchwork Thu Mar 14 14:43:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 160337 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp15594869jad; Thu, 14 Mar 2019 07:44:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqwdW02NQennWQTjV7UiyyMdgnnLEy5LFwgn24n+ZVyZi6wmkKL+NGXCPa1xl80ThAtjM84U X-Received: by 2002:a0c:ad90:: with SMTP id w16mr39378469qvc.53.1552574670707; Thu, 14 Mar 2019 07:44:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552574670; cv=none; d=google.com; s=arc-20160816; b=A5tVaPBMp5tE0D11hok3MbADbEHdGP/arAr1B0jm0Uuis/jDE08tMDzVRpXxlkjq66 eo7tYzbY/P6Tz+soH2z3xuxmVypgYOIAzqaUrAAeLgBDCqMjFfWe6A86DFDRif9G/wEq 80j06aNzn3SGrKzgQh4dxWOqzmQX0dp+dzawG+5Ky/zbbV2C0Zd7fRH1rRcNJFWOpY4N 65BVCQRH88JAiSQbgEgXSt3UQ6oFn0BZLvo7V44LdgJdRG6HbJHV+XK1ZROli156aOGX Bvh+ylk1083CizhC5Gl9DZegJdXv6Yf8fm2rLp+uWqdJgJnL46O/k6mjkv6Px7pDEfHc PGVA== 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=h4+cZbXzUCaIGp/iUJdXIGSUbgNFsmGXNS+kjt8hrjU=; b=wGc2naiQKGTpXOanQjbhvkKDvG5ScYQNnRZ7x3/nlPhlJesGNfODqsyC0j0mjgskP3 CkoQymOFpV887oxaSuzclzLENSjcYt/QfhW/yFvmtSElUtE1NY/+bFQNxtMxNk1rgwsq XDj0YfIuKB/lUGuCCWhAvq9gpQgvMAi4JQA20zkDACujDEPw+eXYYs/0klcHgcImc1Mf z+NSczX3oz0DPmqCNAziZY3sMf+9Z0ijBVo7S42VUhkxq6tR7vWZUClCzNERpM7qz+ri IT2bN8MMwyzVKFGpxzjY2PEnU7OUuYqp5M/OoeE0/qnqNlK3E7mMxu86q3XaiWEo2yVb cOuw== 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 z1si1447559qti.79.2019.03.14.07.44.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Mar 2019 07:44:30 -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-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 32108307B497; Thu, 14 Mar 2019 14:44:29 +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 F38D860FD6; Thu, 14 Mar 2019 14:44:28 +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 A962F181A138; Thu, 14 Mar 2019 14:44:28 +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 x2EEiOus024505 for ; Thu, 14 Mar 2019 10:44:24 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6DA3760FDB; Thu, 14 Mar 2019 14:44:24 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.redhat.com (ovpn-124-177.rdu2.redhat.com [10.10.124.177]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0880660BE6; Thu, 14 Mar 2019 14:44:23 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Thu, 14 Mar 2019 10:43:58 -0400 Message-Id: <4d2f36a09568251a2b9b81f28995cd2575b3cc6f.1552574299.git.crobinso@redhat.com> 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 Subject: [libvirt] [PATCH 05/21] tests: qemuxml2argv: break apart testInitQEMUCaps 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.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Thu, 14 Mar 2019 14:44:29 +0000 (UTC) Signed-off-by: Cole Robinson --- tests/qemuxml2argvtest.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) -- 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list Reviewed-by: Andrea Bolognani diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 393d2399fa..06a28178d0 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -378,25 +378,6 @@ testAddCPUModels(virQEMUCapsPtr caps, bool skipLegacy) } -static int -testInitQEMUCaps(struct testInfo *info, - int gic) -{ - int ret = -1; - - if (!(info->qemuCaps = virQEMUCapsNew())) - goto cleanup; - - if (testQemuCapsSetGIC(info->qemuCaps, gic) < 0) - goto cleanup; - - ret = 0; - - cleanup: - return ret; -} - - static int testUpdateQEMUCaps(const struct testInfo *info, virDomainObjPtr vm, @@ -840,7 +821,9 @@ mymain(void) static struct testInfo info = { \ name, NULL, NULL, migrateFrom, migrateFd, (flags), parseFlags, \ }; \ - if (testInitQEMUCaps(&info, gic) < 0) \ + if (!(info.qemuCaps = virQEMUCapsNew())) \ + return EXIT_FAILURE; \ + if (testQemuCapsSetGIC(info.qemuCaps, gic) < 0) \ return EXIT_FAILURE; \ if (testInfoSetArgs(&info, __VA_ARGS__, QEMU_CAPS_LAST, ARG_END) < 0) \ return EXIT_FAILURE; \