From nobody Sun May 12 08:39:26 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1653079648327858.3743851763201; Fri, 20 May 2022 13:47:28 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-68-W_39QBSNNtm0rDmXKPYiOA-1; Fri, 20 May 2022 16:47:23 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 913068041A5; Fri, 20 May 2022 20:47:21 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3153D40D2821; Fri, 20 May 2022 20:47:21 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 824FE1947058; Fri, 20 May 2022 20:47:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C9D16194704C for ; Fri, 20 May 2022 20:47:18 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id AD0A8401E9D; Fri, 20 May 2022 20:47:18 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast08.extmail.prod.ext.rdu2.redhat.com [10.11.55.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A8D90492C14 for ; Fri, 20 May 2022 20:47:18 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 912783804502 for ; Fri, 20 May 2022 20:47:18 +0000 (UTC) Received: from mail-oi1-f182.google.com (mail-oi1-f182.google.com [209.85.167.182]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-219-ihfJBMu2OhCGIbZ1fdvOVA-1; Fri, 20 May 2022 16:47:16 -0400 Received: by mail-oi1-f182.google.com with SMTP id t144so8030156oie.7 for ; Fri, 20 May 2022 13:47:16 -0700 (PDT) Received: from balboa.ibmuc.com ([191.193.151.26]) by smtp.gmail.com with ESMTPSA id o192-20020a4a2cc9000000b0035eb4e5a6cfsm1464343ooo.37.2022.05.20.13.47.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 May 2022 13:47:15 -0700 (PDT) X-MC-Unique: W_39QBSNNtm0rDmXKPYiOA-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: ihfJBMu2OhCGIbZ1fdvOVA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=haogTxfXBbLu6qvp59YBUZ0RWnDfYKmMuaFd0K86A6U=; b=g9bEI5mgaDiIc2QOH8Qa4itlp/2fCGbWsqwjIV1nuvtqIXEMYOXjAljDGZF7vf12UI dbNnbh+0xYbq6Xk6XHRNO3nEIuzblA0gtAt9P6vg+TTnP9FwRa5jHcNA18vrrCg8hPfT WiN36KQeff5/pkxxBb6YZtrsRip6JbD1jSp7vv3yM7arwedBsnYfMtKGo+qzYjHVpia8 nWD4HUoJCsHhqRsE5zBoQs6Jw5XyLzlFtcB3ZVmv7LlhnzjP27sAam0FtRNFkjguWx08 YSyUWQFX7rIiJQKSNuYSDa0umAPtbdZN268sObh8YcOLUWc5EUVTEnMXKCYKsiEO923Y I3pw== X-Gm-Message-State: AOAM530vYwZUbs1FmG7MZszXHQ8gtCb34tXyCsIoLWssjqnX6BC3DAEo Ng5qZgbFxJxvfjU15McUHf56mb5InBU= X-Google-Smtp-Source: ABdhPJzcUP49YH+D4IlNJs8qWKQ3HDOiDFlFgvz7AYvX0WI7VyWb3u2NX45u00DRla+2Hoo4o10aXQ== X-Received: by 2002:aca:1811:0:b0:2ef:3c0f:f169 with SMTP id h17-20020aca1811000000b002ef3c0ff169mr6532103oih.61.1653079635864; Fri, 20 May 2022 13:47:15 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH 1/3] qemu_capspriv.h: fix identation Date: Fri, 20 May 2022 17:47:02 -0300 Message-Id: <20220520204704.1290007-2-danielhb413@gmail.com> In-Reply-To: <20220520204704.1290007-1-danielhb413@gmail.com> References: <20220520204704.1290007-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: danielhb413@gmail.com Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1653079650531100005 Content-Type: text/plain; charset="utf-8"; x-default="true" Fix identation of virQEMUCapsUpdateHostCPUModel() params. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Martin Kletzander --- src/qemu/qemu_capspriv.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_capspriv.h b/src/qemu/qemu_capspriv.h index f4f4a99d32..26bf2d3571 100644 --- a/src/qemu/qemu_capspriv.h +++ b/src/qemu/qemu_capspriv.h @@ -63,8 +63,8 @@ virQEMUCapsInitHostCPUModel(virQEMUCaps *qemuCaps, =20 void virQEMUCapsUpdateHostCPUModel(virQEMUCaps *qemuCaps, - virArch hostArch, - virDomainVirtType type); + virArch hostArch, + virDomainVirtType type); int virQEMUCapsInitCPUModel(virQEMUCaps *qemuCaps, virDomainVirtType type, --=20 2.32.0 From nobody Sun May 12 08:39:26 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1653079651376985.7033147274559; Fri, 20 May 2022 13:47:31 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-94-BG2sOAFPOZei6NF57kg4vA-1; Fri, 20 May 2022 16:47:24 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 68979100DDF4; Fri, 20 May 2022 20:47:22 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 53A521415101; Fri, 20 May 2022 20:47:22 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 1CB621947052; Fri, 20 May 2022 20:47:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id AC892193F6D6 for ; Fri, 20 May 2022 20:47:19 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 969C640D2821; Fri, 20 May 2022 20:47:19 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 922D640D2820 for ; Fri, 20 May 2022 20:47:19 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 78F3E802A5B for ; Fri, 20 May 2022 20:47:19 +0000 (UTC) Received: from mail-oi1-f182.google.com (mail-oi1-f182.google.com [209.85.167.182]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-219-pSo_qiztMLez22zYMJy34g-2; Fri, 20 May 2022 16:47:17 -0400 Received: by mail-oi1-f182.google.com with SMTP id t144so8030156oie.7 for ; Fri, 20 May 2022 13:47:17 -0700 (PDT) Received: from balboa.ibmuc.com ([191.193.151.26]) by smtp.gmail.com with ESMTPSA id o192-20020a4a2cc9000000b0035eb4e5a6cfsm1464343ooo.37.2022.05.20.13.47.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 May 2022 13:47:17 -0700 (PDT) X-MC-Unique: BG2sOAFPOZei6NF57kg4vA-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: pSo_qiztMLez22zYMJy34g-2 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ugVj9QZR+vdAv/lvuYgBgbYjJ5H8/GIHR2R6f8q6bP0=; b=U4ZSQlI3M3h3psjbyQPzUnviGhgakjHMg6ySm5Fyy1xdksknGBGIeA18QB+dakoyHU H078mKXi/W7PkgGn3Les6Egfho9SrM+CULrh65tpPF5+DejleeeOMdP0Kt0Z72EdYZ9i XHoNUDKQYJyiPe0vMRNR+4eZ0o5LMRn15GSoCdYWCmuet5dZ0bonvODYFGPW1d0y1Yqw Hxm9XXZ8/Qwh69wyjJtMkW1SPJjlOgptaK9zZ/1auvf+YjaZvwSY62XtlR6jAkofHIUV 8414n7TkBm1OAAxF0tsuzxG6zaoab27df8YgtQEtCp1mwg4QsuvVkQcCTA0Ar/38RPhN /+sQ== X-Gm-Message-State: AOAM532zDtZ6SrV21pKSwphTCmVNa5zihSrclnUykv01fhjxjz8Lsthn 5F0U+dTnGK+8sYoHT2CgyQhrru6elt8= X-Google-Smtp-Source: ABdhPJyVGc5WTmQkxjV93tfNdWeR9E3oY3mysHCDcUpUOi7dtQXR45Ji23E8XzCfOjT2R837YVJjvg== X-Received: by 2002:a05:6808:14c2:b0:326:c129:d308 with SMTP id f2-20020a05680814c200b00326c129d308mr6209007oiw.193.1653079637242; Fri, 20 May 2022 13:47:17 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH 2/3] testutilsqemu: introduce ARG_CAPS_HOST_CPU_MODEL Date: Fri, 20 May 2022 17:47:03 -0300 Message-Id: <20220520204704.1290007-3-danielhb413@gmail.com> In-Reply-To: <20220520204704.1290007-1-danielhb413@gmail.com> References: <20220520204704.1290007-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: danielhb413@gmail.com Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1653079652592100001 Content-Type: text/plain; charset="utf-8"; x-default="true" When loading a latest caps for an arch for the first time the following occurs in testQemuInfoInitArgs(): - the caps file is located. It's not in the cache since it's the first time it's being read; - the cachecaps are retrieved using qemuTestParseCapabilitiesArch() and stored in the capscache; - FLAG_REAL_CAPS is set and regular flow continues. Loading the same latest caps for the second time the caps are loaded from t= he cache, skipping qemuTestParseCapabilitiesArch(). By skipping this function = it means that it also skips virQEMUCapsLoadCache() and, more relevant to our case, virQEMUCapsInitHostCPUModel(). This function will use the current arch and cpuModel settings to write the qemuCaps that are being stored in the cache. And we're also setting FLAG_REAL_CAPS, meaning that we won't be updating the qemucaps host model via testUpdateQEMUCaps() as well. This has side-effects such as: - the first time the latest caps for an arch is loaded determines the cpuModel it'll use during the current qemuxml2argvtest run. For example, when running all tests, the first time the latest ppc64 caps are read is on "disk-floppy-pseries" test. Since the current host arch at this point is x86_64, the cpuModel that will be set for this capability is "core2duo"; - every other latest arch test will use the same hostCPU as the first one set since we read it from the cache after the first run. qemuTestSetHostCPU() makes no difference because we won't update the host model due to FLAG_REAL_CAPS being set. Using the previous example, every other latest ppc64 test that will be run will be using the "core2duo" cpuModel. Using fake capabilities (e.g. using DO_TEST()) prevent FLAG_REAL_CAPS to be set, meaning that the cpuModel will be updated using the current settings the test is being ran due to testUpdateQEMUCaps(). Note that not all latest caps arch tests care about the cpuModel being set to an unexpected default cpuModel. But some tests will care, e.g. "pseries-cpu-compat-power9", and changing it from DO_TEST() to DO_TEST_CAPS_ARCH_LATEST() will make it fail every time the "disk-floppy-pseries" is being ran first. One way of fixing it is to rethink all the existing logic, for example not setting FLAG_REAL_CAPS for latest arch tests. Another way is presented here. ARGS_CAPS_HOST_CPU_MODEL is a new testQemuInfo arg that allow us to set any specific host CPU model we want when running latest arch caps tests. This new arg can then be used when converting existing DO_TEST() testcases to DO_TEST_CAPS_ARCH_LATEST() that requires a specific host CPU setting to be successful, which we're going to do in the next patch with "pseries-cpu-compat-power9". Signed-off-by: Daniel Henrique Barboza Reviewed-by: Martin Kletzander --- tests/qemuxml2argvtest.c | 18 ++++++++++++++---- tests/testutilsqemu.c | 4 ++++ tests/testutilsqemu.h | 18 +++++++++--------- 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index aadfaddc17..96bc7aadeb 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -336,6 +336,12 @@ testAddCPUModels(virQEMUCaps *caps, bool skipLegacy) return 0; } =20 +static void +testUpdateQEMUCapsHostCPUModel(virQEMUCaps *qemuCaps, virArch hostArch) +{ + virQEMUCapsUpdateHostCPUModel(qemuCaps, hostArch, VIR_DOMAIN_VIRT_KVM); + virQEMUCapsUpdateHostCPUModel(qemuCaps, hostArch, VIR_DOMAIN_VIRT_QEMU= ); +} =20 static int testUpdateQEMUCaps(const struct testQemuInfo *info, @@ -353,10 +359,7 @@ testUpdateQEMUCaps(const struct testQemuInfo *info, !!(info->flags & FLAG_SKIP_LEGACY_CPUS)) < 0) return -1; =20 - virQEMUCapsUpdateHostCPUModel(info->qemuCaps, caps->host.arch, - VIR_DOMAIN_VIRT_KVM); - virQEMUCapsUpdateHostCPUModel(info->qemuCaps, caps->host.arch, - VIR_DOMAIN_VIRT_QEMU); + testUpdateQEMUCapsHostCPUModel(info->qemuCaps, caps->host.arch); =20 return 0; } @@ -650,6 +653,13 @@ testCompareXMLToArgv(const void *data) if (info->arch !=3D VIR_ARCH_NONE && info->arch !=3D VIR_ARCH_X86_64) qemuTestSetHostArch(&driver, info->arch); =20 + if (info->args.capsHostCPUModel) { + virCPUDef *hostCPUModel =3D qemuTestGetCPUDef(info->args.capsHostC= PUModel); + + qemuTestSetHostCPU(&driver, driver.hostarch, hostCPUModel); + testUpdateQEMUCapsHostCPUModel(info->qemuCaps, driver.hostarch); + } + if (!(conn =3D virGetConnect())) goto cleanup; =20 diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index 004c7cf1d6..7e4e5d28b7 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -886,6 +886,10 @@ testQemuInfoSetArgs(struct testQemuInfo *info, info->args.capsver =3D va_arg(argptr, char *); break; =20 + case ARG_CAPS_HOST_CPU_MODEL: + info->args.capsHostCPUModel =3D va_arg(argptr, int); + break; + case ARG_HOST_OS: info->args.hostOS =3D va_arg(argptr, int); break; diff --git a/tests/testutilsqemu.h b/tests/testutilsqemu.h index 99897e6b79..5419b813ea 100644 --- a/tests/testutilsqemu.h +++ b/tests/testutilsqemu.h @@ -47,6 +47,7 @@ typedef enum { ARG_PARSEFLAGS, ARG_CAPS_ARCH, ARG_CAPS_VER, + ARG_CAPS_HOST_CPU_MODEL, ARG_HOST_OS, ARG_END, } testQemuInfoArgName; @@ -66,12 +67,20 @@ struct testQemuConf { GHashTable *qapiSchemaCache; }; =20 +typedef enum { + QEMU_CPU_DEF_DEFAULT, + QEMU_CPU_DEF_HASWELL, + QEMU_CPU_DEF_POWER8, + QEMU_CPU_DEF_POWER9, +} qemuTestCPUDef; + struct testQemuArgs { bool newargs; virQEMUCaps *fakeCaps; bool fakeCapsUsed; char *capsver; char *capsarch; + qemuTestCPUDef capsHostCPUModel; int gic; testQemuHostOS hostOS; bool invalidarg; @@ -101,15 +110,6 @@ virDomainXMLOption *testQemuXMLConfInit(void); =20 virQEMUCaps *qemuTestParseCapabilitiesArch(virArch arch, const char *capsFile); - - -typedef enum { - QEMU_CPU_DEF_DEFAULT, - QEMU_CPU_DEF_HASWELL, - QEMU_CPU_DEF_POWER8, - QEMU_CPU_DEF_POWER9, -} qemuTestCPUDef; - virCPUDef *qemuTestGetCPUDef(qemuTestCPUDef d); =20 void qemuTestSetHostArch(virQEMUDriver *driver, --=20 2.32.0 From nobody Sun May 12 08:39:26 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1653079647828272.7441696883999; Fri, 20 May 2022 13:47:27 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-450-Iy6BtDDGMsW31FkPxSfyTQ-1; Fri, 20 May 2022 16:47:25 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1C1E52949BC6; Fri, 20 May 2022 20:47:23 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 049A12026D6A; Fri, 20 May 2022 20:47:23 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D4D881947052; Fri, 20 May 2022 20:47:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 6B234194704C for ; Fri, 20 May 2022 20:47:21 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 3CD4E7AD5; Fri, 20 May 2022 20:47:21 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast08.extmail.prod.ext.rdu2.redhat.com [10.11.55.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3887D7C4F for ; Fri, 20 May 2022 20:47:21 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1B384380450A for ; Fri, 20 May 2022 20:47:21 +0000 (UTC) Received: from mail-oi1-f179.google.com (mail-oi1-f179.google.com [209.85.167.179]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-610-QQHBWkxoPLWDzptr6O-ljg-1; Fri, 20 May 2022 16:47:19 -0400 Received: by mail-oi1-f179.google.com with SMTP id v9so6626106oie.5 for ; Fri, 20 May 2022 13:47:19 -0700 (PDT) Received: from balboa.ibmuc.com ([191.193.151.26]) by smtp.gmail.com with ESMTPSA id o192-20020a4a2cc9000000b0035eb4e5a6cfsm1464343ooo.37.2022.05.20.13.47.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 May 2022 13:47:18 -0700 (PDT) X-MC-Unique: Iy6BtDDGMsW31FkPxSfyTQ-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: QQHBWkxoPLWDzptr6O-ljg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=W4gJOhThJrEwYsEp6GWHmVGU6woNUiYRSUUIy476CtE=; b=yeRi8kzDAhOwVPHfcFZu/m8+S45CM5KMVV+C9ReqWPSAHUQb7VHbrcLxn2l/pLuvof wUqJ13J5cv7kP484pJcgwuEHuo7fqeR8w+CHnS9P2LAantfUfryqIs2iWl1qk7eABlD+ yt9kjXX2bPp3i2jyb/lGwhlhV8rqJQH71IPgRVCP1fflzstabFb4MTkljz9cPqyFy6R/ RdN9W8o4Fbcsztc72eQVVDyTcevzkfgxMXxVqjTkGEKfDaJrlfvjNWrGesQi8B4o5WgC bb+rcG05UEldW7NXBADTKkHncaaNbWgsToxf77R5m7I3oz99KdddX1DUEbYmuTXIKHqn UWjQ== X-Gm-Message-State: AOAM5330fL7h7Ig9USNGq2ic1tDlOP4//GsDqGSzysjctDuvFrvRHRkT AvN+pp/ocen9PNFV+0g5QkFXXDU0ax0= X-Google-Smtp-Source: ABdhPJzmCkAa7tk4jfadPCgfuwYJs9sGeV6/3OfocKYv/gLzgcrjSvc7GOdfXgHUtNmUOO9nAIBc8g== X-Received: by 2002:a05:6808:13cd:b0:328:a194:1d15 with SMTP id d13-20020a05680813cd00b00328a1941d15mr6132806oiw.186.1653079638507; Fri, 20 May 2022 13:47:18 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH 3/3] qemuxml2argvtest.c: use CAPS_ARCH_LATEST() with pseries-cpu-compat-power9 Date: Fri, 20 May 2022 17:47:04 -0300 Message-Id: <20220520204704.1290007-4-danielhb413@gmail.com> In-Reply-To: <20220520204704.1290007-1-danielhb413@gmail.com> References: <20220520204704.1290007-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: danielhb413@gmail.com Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1653079648545100003 Content-Type: text/plain; charset="utf-8"; x-default="true" Use the newly added ARG_CAPS_HOST_CPU_MODEL to set which host CPU we expect the test to use - the test should fail when using a POWER8 host cpu but complete when using a POWER9 host cpu. Two new macros were added because we will be adding similar tests in the near future when adding support for the Power10 chip. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Martin Kletzander --- ...eries-cpu-compat-power9.ppc64-latest.args} | 12 ++++++---- ...series-cpu-compat-power9.ppc64-latest.err} | 0 tests/qemuxml2argvtest.c | 23 +++++++++++-------- 3 files changed, 20 insertions(+), 15 deletions(-) rename tests/qemuxml2argvdata/{pseries-cpu-compat-power9.args =3D> pseries= -cpu-compat-power9.ppc64-latest.args} (60%) rename tests/qemuxml2argvdata/{pseries-cpu-compat-power9.err =3D> pseries-= cpu-compat-power9.ppc64-latest.err} (100%) diff --git a/tests/qemuxml2argvdata/pseries-cpu-compat-power9.args b/tests/= qemuxml2argvdata/pseries-cpu-compat-power9.ppc64-latest.args similarity index 60% rename from tests/qemuxml2argvdata/pseries-cpu-compat-power9.args rename to tests/qemuxml2argvdata/pseries-cpu-compat-power9.ppc64-latest.args index 233e92f206..f458999291 100644 --- a/tests/qemuxml2argvdata/pseries-cpu-compat-power9.args +++ b/tests/qemuxml2argvdata/pseries-cpu-compat-power9.ppc64-latest.args @@ -6,15 +6,15 @@ LOGNAME=3Dtest \ XDG_DATA_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.local/share \ XDG_CACHE_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.cache \ XDG_CONFIG_HOME=3D/tmp/lib/domain--1-QEMUGuest1/.config \ -QEMU_AUDIO_DRV=3Dnone \ /usr/bin/qemu-system-ppc64 \ -name guest=3DQEMUGuest1,debug-threads=3Don \ -S \ --object secret,id=3DmasterKey0,format=3Draw,file=3D/tmp/lib/domain--1-QEMU= Guest1/master-key.aes \ --machine pseries,usb=3Doff,dump-guest-core=3Doff,max-cpu-compat=3Dpower9 \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/tm= p/lib/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine pseries,usb=3Doff,dump-guest-core=3Doff,max-cpu-compat=3Dpower9,m= emory-backend=3Dppc_spapr.ram \ -accel kvm \ -cpu host \ -m 256 \ +-object '{"qom-type":"memory-backend-ram","id":"ppc_spapr.ram","size":2684= 35456}' \ -overcommit mem-lock=3Doff \ -smp 4,sockets=3D4,cores=3D1,threads=3D1 \ -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ @@ -26,7 +26,9 @@ QEMU_AUDIO_DRV=3Dnone \ -rtc base=3Dutc \ -no-shutdown \ -boot strict=3Don \ --usb \ +-device '{"driver":"pci-ohci","id":"usb","bus":"pci.0","addr":"0x1"}' \ -chardev pty,id=3Dcharserial0 \ --device spapr-vty,chardev=3Dcharserial0,id=3Dserial0,reg=3D805306368 \ +-device '{"driver":"spapr-vty","chardev":"charserial0","id":"serial0","reg= ":805306368}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ -msg timestamp=3Don diff --git a/tests/qemuxml2argvdata/pseries-cpu-compat-power9.err b/tests/q= emuxml2argvdata/pseries-cpu-compat-power9.ppc64-latest.err similarity index 100% rename from tests/qemuxml2argvdata/pseries-cpu-compat-power9.err rename to tests/qemuxml2argvdata/pseries-cpu-compat-power9.ppc64-latest.err diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 96bc7aadeb..5ae245d254 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -980,6 +980,15 @@ mymain(void) # define DO_TEST_CAPS_LATEST_PPC64(name) \ DO_TEST_CAPS_ARCH_LATEST(name, "ppc64") =20 +# define DO_TEST_CAPS_LATEST_PPC64_HOSTCPU(name, hostcpu) \ + DO_TEST_CAPS_ARCH_LATEST_FULL(name, "ppc64", \ + ARG_CAPS_HOST_CPU_MODEL, hostcpu) + +# define DO_TEST_CAPS_LATEST_PPC64_HOSTCPU_FAILURE(name, hostcpu) \ + DO_TEST_CAPS_ARCH_LATEST_FULL(name, "ppc64", \ + ARG_CAPS_HOST_CPU_MODEL, hostcpu, \ + ARG_FLAGS, FLAG_EXPECT_FAILURE) + # define DO_TEST_CAPS_ARCH_LATEST_FAILURE(name, arch) \ DO_TEST_CAPS_ARCH_LATEST_FULL(name, arch, \ ARG_FLAGS, FLAG_EXPECT_FAILURE) @@ -2226,16 +2235,10 @@ mymain(void) DO_TEST("pseries-cpu-le", QEMU_CAPS_KVM, QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, QEMU_CAPS_DEVICE_SPAPR_VTY); - DO_TEST_FAILURE("pseries-cpu-compat-power9", - QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, - QEMU_CAPS_KVM); - - qemuTestSetHostCPU(&driver, driver.hostarch, qemuTestGetCPUDef(QEMU_CP= U_DEF_POWER9)); - DO_TEST("pseries-cpu-compat-power9", - QEMU_CAPS_KVM, - QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, - QEMU_CAPS_DEVICE_SPAPR_VTY); - qemuTestSetHostCPU(&driver, driver.hostarch, NULL); + DO_TEST_CAPS_LATEST_PPC64_HOSTCPU_FAILURE("pseries-cpu-compat-power9", + QEMU_CPU_DEF_POWER8); + DO_TEST_CAPS_LATEST_PPC64_HOSTCPU("pseries-cpu-compat-power9", + QEMU_CPU_DEF_POWER9); =20 qemuTestSetHostArch(&driver, VIR_ARCH_NONE); =20 --=20 2.32.0