From patchwork Thu Mar 21 19:55:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 160818 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp1192535jan; Thu, 21 Mar 2019 12:55:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqxN+o0dwZ7KziGk9Bf6eYnciRN58Guu8mv+KfaYI98k7pDDGStgcl5dAO0YDcOy3L8LGGEI X-Received: by 2002:a37:4d52:: with SMTP id a79mr4359128qkb.75.1553198126851; Thu, 21 Mar 2019 12:55:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553198126; cv=none; d=google.com; s=arc-20160816; b=F5HS7Yo0LVJATPAh/rRQEI8wX+RiN1tBAVxorw2ZO+a5TlmaDxmX0KKBY2lausLwYL miHWm79GNn8c4ObKQXqsaSNUGnUpzfsLBfy+dm935n1Kv3/kUkOn4YKv8A1vA00mMsNx Xxh0QQ1mmlsZZFioQ8ETECJESlF3kPCGkVoBk/P/7SqHPOLD1uKkE5I+u3+IoKGxw3Ws 8IrrWDXfuJv4O3ifMmugZ5o7USMBxTSxY3orCbD9Uf2pszeSky/Ny+7YuWRU7VVbvb2z ol0I7fzjdFRA8ATOkldXzgsJ6gO0XCuhKj7AP2HIUAHqVX7gac5TWq4Ld5nC755O1cEJ BSjg== 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=jfEB+k6aEf8ju3We5dNq74PMpvRZvIwQ59HeaJ3uWoM=; b=h5Nt8INmB97rzL8fbB8MIU7EM8ZKyr6wGgh7OgRmUZDnus9kEAMikwvYe+TSKSKpEX rxSI5NhptEbU1fvpIdecgPzglkPCVPdEnLlcDHnlHszo2tzodhzWoIwHct0UTJOEyD05 fVx5tT8Gd5a04k/wcX+fV4pxUWvbkD/JVb9FkP/00nxHjhRVkBC6CKN1MUV0lrw4SOcF jK3Pjbj+/rI9XmZxLDhQvoImrnFUYlTYVv3sVG48JANBPMgsy1jnewYTPfD4zIldKWCH Lzw3Iw0Zaq0dVuqsAjIxpGxwHOnyhm6jjHiLpoMZ0jHzfELSUNDMAIri9Stp6uYzHO5P BJXA== 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 i3si64249qkg.84.2019.03.21.12.55.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Mar 2019 12:55:26 -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-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 604593092650; Thu, 21 Mar 2019 19:55:25 +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 2EFE11018A35; Thu, 21 Mar 2019 19:55: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 CAAE3180338C; Thu, 21 Mar 2019 19:55:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x2LJtH9l020718 for ; Thu, 21 Mar 2019 15:55:17 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8D24F4108; Thu, 21 Mar 2019 19:55:17 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from worklaptop.redhat.com (ovpn-121-55.rdu2.redhat.com [10.10.121.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 318E319C59; Thu, 21 Mar 2019 19:55:17 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Thu, 21 Mar 2019 15:55:05 -0400 Message-Id: <18de67cff7d62c950885a42f98c3d646579fa432.1553197802.git.crobinso@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 3/4] tests: qemuxml2argv: report error on ARG_* collisions 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.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Thu, 21 Mar 2019 19:55:25 +0000 (UTC) * ARG_CAPS_ARCH must be specified with ARG_CAPS_VER * ARG_QEMU_CAPS shouldn't be specified with ARG_CAPS_* Signed-off-by: Cole Robinson --- tests/qemuxml2argvtest.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) -- 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/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 191a43726d..34394181c1 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -688,6 +688,18 @@ testInfoSetArgs(struct testInfo *info, } } + if (!!capsarch ^ !!capsver) { + fprintf(stderr, "ARG_CAPS_ARCH and ARG_CAPS_VER " + "must be specified together.\n"); + goto cleanup; + } + + if (qemuCaps && (capsarch || capsver)) { + fprintf(stderr, "ARG_QEMU_CAPS can not be combined with ARG_CAPS_ARCH " + "or ARG_CAPS_VER\n"); + goto cleanup; + } + if (!qemuCaps && capsarch && capsver) { bool stripmachinealiases = false;