From nobody Sat May 18 12:05:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1607043980; cv=none; d=zohomail.com; s=zohoarc; b=AgZp7MkVKcsqUn4OWXaOIFtj/iTlP5ilFHkG8N+sN3+dfuujAl5xIzqx+zeMthA3t9/3RpoOyjDd0+WOWebnLw+2Ks/Ku+AHW740HhFiAhb+z1FCEq6wjOrvwPeQ27LQpb6YjzNJlcPpD1HIjv/e0DNlMigkximmBpnfloEN3VE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607043980; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=k5kkMOQnu0Tzr7pm9acxxzWrRh16lw0vhtgxONoOzYg=; b=SahZqJQkd1PLXQzYvO7OrYahUEB257/sEipvPZ8JYPfEv0A3oome72BICp+f9qp2xDbgZ4ThXNkJzeqRTkDJt6ucM9EBOJ598qifvpxfzkltSwhSa80zYdW61Z3AsRMpe3cak63u/VvBqVgJZdzve2BB3aMS7vf+ZVEkxYdMasU= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1607043980922186.57465697885664; Thu, 3 Dec 2020 17:06:20 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-237-H-b29q4QN9KQARXxwjoEHg-1; Thu, 03 Dec 2020 20:06:17 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 523341005D4C; Fri, 4 Dec 2020 01:06:10 +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 2D3316085A; Fri, 4 Dec 2020 01:06:10 +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 EA8A35002E; Fri, 4 Dec 2020 01:06:09 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0B415qZw026403 for ; Thu, 3 Dec 2020 20:05:53 -0500 Received: by smtp.corp.redhat.com (Postfix) id D4ADEF11CC; Fri, 4 Dec 2020 01:05:52 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CEC1EF1C8C for ; Fri, 4 Dec 2020 01:05:50 +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-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9AF0F800B3A for ; Fri, 4 Dec 2020 01:05:50 +0000 (UTC) Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-497-zrnAdU1TMxSicOHDUmeNVQ-1; Thu, 03 Dec 2020 20:05:46 -0500 Received: by mail-qt1-f175.google.com with SMTP id p12so2888285qtp.7; Thu, 03 Dec 2020 17:05:46 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c7:c1a:69c1:2b22:e880:fc49]) by smtp.gmail.com with ESMTPSA id z133sm3600542qka.20.2020.12.03.17.05.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2020 17:05:44 -0800 (PST) X-MC-Unique: H-b29q4QN9KQARXxwjoEHg-1 X-MC-Unique: zrnAdU1TMxSicOHDUmeNVQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=k5kkMOQnu0Tzr7pm9acxxzWrRh16lw0vhtgxONoOzYg=; b=LPl93uOwgN9RaIN/R90ChOETgcTSCBnUPEj7q8Rl0vmtjA0MWmiLQB7AwAD6seom4B mFvUaeauWiEpzaoe/6h6qoEyrnMOQY8d/4oiZPP3GWjTJgxW9egnzF2fP3Oz1+NScb9+ SZ/5GLDy3GHG9/ap7tur4E4TKtvh8ivVE1u2rSXAa+TWkpEia7bpfvDAuRo+2kRPi3a3 x+8WjIO5sqhMpC4uLi1vg3Zmz2vNJH/gUoYhm53QJPJd8GSh6ffpxvQCQKB0+5Vglwlq KtEAB8Ej+452bQ4fGubfHX7ykPQp0KPEva+hyAUNEZHd7liSioCBUU1WQ0K7a9Mdmrmi RuaQ== X-Gm-Message-State: AOAM533nxxC9t2caGNKV6Iwst+kaME01sZdw+NIMtr0oaIOYz6R76nPB FigtM8H2lLurV7KeUdo9wFImoH2TU+b7hw== X-Google-Smtp-Source: ABdhPJyc3Xc+6rKXsYgSZqKMa7L2atSsPBSf9JrCFlYESHCvhvusuIyzVkyreU5IaZnOtXOk0rLp+w== X-Received: by 2002:aed:308a:: with SMTP id 10mr6420551qtf.312.1607043945424; Thu, 03 Dec 2020 17:05:45 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v3 1/5] tests: Sync some ppc64 tests Date: Thu, 3 Dec 2020 22:05:25 -0300 Message-Id: <20201204010529.325244-2-danielhb413@gmail.com> In-Reply-To: <20201204010529.325244-1-danielhb413@gmail.com> References: <20201204010529.325244-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-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza , Andrea Bolognani 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.13 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 Content-Type: text/plain; charset="utf-8" From: Andrea Bolognani The ppc64 tests memory-hotplug-ppc64-nonuma memory-hotplug-nvdimm-ppc64 are not passed the same information for qemuxml2argv and qemuxml2xml tests; the former, in particular, doesn't show up at all in qemuxml2xml. Address this inconsistency. Note that one of the new output files had been introduced with 5540acb9a2bd despite not being actually used as of that commit. Reviewed-by: Daniel Henrique Barboza Signed-off-by: Andrea Bolognani --- .../memory-hotplug-nvdimm-ppc64.args | 2 +- ...ory-hotplug-nvdimm-ppc64.ppc64-latest.args | 38 ---------------- tests/qemuxml2argvtest.c | 4 +- .../memory-hotplug-ppc64-nonuma.xml | 45 +++++++++++++++++++ tests/qemuxml2xmltest.c | 5 +++ 5 files changed, 54 insertions(+), 40 deletions(-) delete mode 100644 tests/qemuxml2argvdata/memory-hotplug-nvdimm-ppc64.ppc6= 4-latest.args create mode 100644 tests/qemuxml2xmloutdata/memory-hotplug-ppc64-nonuma.xml diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-ppc64.args b/test= s/qemuxml2argvdata/memory-hotplug-nvdimm-ppc64.args index 92e6c538fb..94bd86ada0 100644 --- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-ppc64.args +++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-ppc64.args @@ -15,7 +15,7 @@ QEMU_AUDIO_DRV=3Dnone \ -realtime mlock=3Doff \ -smp 2,sockets=3D2,cores=3D1,threads=3D1 \ -numa node,nodeid=3D0,cpus=3D0-1,mem=3D1024 \ --object memory-backend-file,id=3Dmemnvdimm0,prealloc=3Dyes,mem-path=3D/tmp= /nvdimm,\ +-object memory-backend-file,id=3Dmemnvdimm0,mem-path=3D/tmp/nvdimm,preallo= c=3Dyes,\ size=3D537001984 \ -device nvdimm,node=3D0,label-size=3D131072,\ uuid=3D49545eb3-75e1-2d0a-acdd-f0294406c99e,memdev=3Dmemnvdimm0,id=3Dnvdim= m0,slot=3D0 \ diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-ppc64.ppc64-lates= t.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-ppc64.ppc64-latest.ar= gs deleted file mode 100644 index e7be7216c1..0000000000 --- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-ppc64.ppc64-latest.args +++ /dev/null @@ -1,38 +0,0 @@ -LC_ALL=3DC \ -PATH=3D/bin \ -HOME=3D/tmp/lib/domain--1-QEMUGuest1 \ -USER=3Dtest \ -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-QEMUGuest1/master-key.aes \ --machine pseries,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff,nvdimm=3Don \ --cpu POWER9 \ --m size=3D1048576k,slots=3D16,maxmem=3D1099511627776k \ --overcommit mem-lock=3Doff \ --smp 2,sockets=3D2,dies=3D1,cores=3D1,threads=3D1 \ --numa node,nodeid=3D0,cpus=3D0-1,mem=3D1024 \ --object memory-backend-file,id=3Dmemnvdimm0,mem-path=3D/tmp/nvdimm,preallo= c=3Dyes,\ -size=3D537001984 \ --device nvdimm,node=3D0,label-size=3D131072,\ -uuid=3D49545eb3-75e1-2d0a-acdd-f0294406c99e,memdev=3Dmemnvdimm0,id=3Dnvdim= m0,slot=3D0 \ --uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ --display none \ --no-user-config \ --nodefaults \ --chardev socket,id=3Dcharmonitor,fd=3D1729,server,nowait \ --mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ --rtc base=3Dutc \ --no-shutdown \ --boot strict=3Don \ --device pci-ohci,id=3Dusb,bus=3Dpci.0,addr=3D0x1 \ --device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 \ --sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,\ -resourcecontrol=3Ddeny \ --msg timestamp=3Don diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 409680c84e..8c8426e699 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -3011,7 +3011,9 @@ mymain(void) DO_TEST_CAPS_LATEST("memory-hotplug-nvdimm-align"); DO_TEST_CAPS_LATEST("memory-hotplug-nvdimm-pmem"); DO_TEST_CAPS_LATEST("memory-hotplug-nvdimm-readonly"); - DO_TEST_CAPS_ARCH_LATEST("memory-hotplug-nvdimm-ppc64", "ppc64"); + DO_TEST("memory-hotplug-nvdimm-ppc64", QEMU_CAPS_DEVICE_SPAPR_PCI_HOST= _BRIDGE, + QEMU_CAPS_OBJECT_MEMORY_FILE, + QEMU_CAPS_DEVICE_NVDIMM); =20 DO_TEST("machine-aeskeywrap-on-caps", QEMU_CAPS_AES_KEY_WRAP, diff --git a/tests/qemuxml2xmloutdata/memory-hotplug-ppc64-nonuma.xml b/tes= ts/qemuxml2xmloutdata/memory-hotplug-ppc64-nonuma.xml new file mode 100644 index 0000000000..a5905e64b5 --- /dev/null +++ b/tests/qemuxml2xmloutdata/memory-hotplug-ppc64-nonuma.xml @@ -0,0 +1,45 @@ + + QEMUGuest1 + 49545eb3-75e1-2d0a-acdd-f0294406c99e + 4194304 + 2097152 + 2097152 + 1 + + hvm + /media/ram/uImage + /media/ram/ramdisk + root=3D/dev/ram rw console=3DttyS0,115200 + + + + destroy + restart + destroy + + /usr/bin/qemu-system-ppc64 + +
+ + + + + + +
+ + + + + 523264 + +
+ + + + 524287 + +
+ + + diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 603ba71686..83e5dd0cbe 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -1229,6 +1229,9 @@ mymain(void) /* SVE aarch64 CPU features work on modern QEMU */ DO_TEST_CAPS_ARCH_LATEST("aarch64-features-sve", "aarch64"); =20 + DO_TEST("memory-hotplug-ppc64-nonuma", QEMU_CAPS_KVM, QEMU_CAPS_DEVICE= _PC_DIMM, QEMU_CAPS_NUMA, + QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, + QEMU_CAPS_OBJECT_MEMORY_RAM, QEMU_CAPS_OBJECT_MEMORY_FILE); DO_TEST("memory-hotplug", NONE); DO_TEST("memory-hotplug-dimm", QEMU_CAPS_DEVICE_PC_DIMM); DO_TEST("memory-hotplug-nvdimm", QEMU_CAPS_DEVICE_NVDIMM); @@ -1239,7 +1242,9 @@ mymain(void) DO_TEST("memory-hotplug-nvdimm-readonly", QEMU_CAPS_DEVICE_NVDIMM, QEMU_CAPS_DEVICE_NVDIMM_UNAR= MED); DO_TEST("memory-hotplug-nvdimm-ppc64", QEMU_CAPS_DEVICE_SPAPR_PCI_HOST= _BRIDGE, + QEMU_CAPS_OBJECT_MEMORY_FILE, QEMU_CAPS_DEVICE_NVDIMM); + DO_TEST("net-udp", NONE); =20 DO_TEST("video-virtio-gpu-device", QEMU_CAPS_DEVICE_VIRTIO_GPU); --=20 2.26.2 From nobody Sat May 18 12:05:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1607044009; cv=none; d=zohomail.com; s=zohoarc; b=Ed+q8Tp990VJ4qkcvcDXifKxxxrgYeEWjGpWtfk30kCaKEmR+i5vQVoVG6PpwfBb+LByGphDaP8b5AqONOoVRqxXuHoSiDFFZXl030es26LiCxjMa0+KtjO1aEdfmv6qjQkml4m+uPb4Fpl6InBNoFc2RLa8wFoBbfcoaVGn0xo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607044009; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/0er/khZaLYCf28fCWpVL9v+hOMxGeALAzgxMY//abc=; b=Igjf0K1wA44aoc8ffoSaSN6tzX0B58gdGFLG4tKqVMeSvKQFcYE8vaxmKxXxdkQ2HSnu62BJKoSCbAK9BzkYNcwkJZN8wBEXJGizz2bMNlZ6ED9zwq3mIeZtv9cw0TbhH4034BLMlS91jZ2o28EjK/YDzgA8ln30JiXgAecEX84= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1607044009004549.4147126754351; Thu, 3 Dec 2020 17:06:49 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-95-oyFclwvzMdmsvP9ojelH5Q-1; Thu, 03 Dec 2020 20:06:44 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 11F8C107ACF5; Fri, 4 Dec 2020 01:06:38 +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 E03EF1A8A6; Fri, 4 Dec 2020 01:06:37 +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 ACBEE1809C9F; Fri, 4 Dec 2020 01:06:37 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0B415o2N026377 for ; Thu, 3 Dec 2020 20:05:50 -0500 Received: by smtp.corp.redhat.com (Postfix) id A1ABF2026D3E; Fri, 4 Dec 2020 01:05:50 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9CD5B2027144 for ; Fri, 4 Dec 2020 01:05:50 +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-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 84243108C0A0 for ; Fri, 4 Dec 2020 01:05:50 +0000 (UTC) Received: from mail-qt1-f171.google.com (mail-qt1-f171.google.com [209.85.160.171]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-248-gv7Y2fC1Mj2e1IyjWUcOfg-1; Thu, 03 Dec 2020 20:05:48 -0500 Received: by mail-qt1-f171.google.com with SMTP id a6so477986qtw.6; Thu, 03 Dec 2020 17:05:48 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c7:c1a:69c1:2b22:e880:fc49]) by smtp.gmail.com with ESMTPSA id z133sm3600542qka.20.2020.12.03.17.05.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2020 17:05:46 -0800 (PST) X-MC-Unique: oyFclwvzMdmsvP9ojelH5Q-1 X-MC-Unique: gv7Y2fC1Mj2e1IyjWUcOfg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/0er/khZaLYCf28fCWpVL9v+hOMxGeALAzgxMY//abc=; b=J8umWxLeGbfKK2Sifsj0D94/ZWgtsxGO+aMebOkygb0AHosAk+fAQ9nX+5wdzDu6iQ WLAy/W6Xl/fL3okhmV+5QfHMnpaJdAoZE01A/IPSoVeKXcHOMgJMNqzA8PHaraC9nMlE iWIgzF4ygdJLXmxSbllBPP72rErxnjZYBWD9zgi7aXjedKyMKwh/jKwNC+4gDrQHN9DB bx2mLkamzUrDh4H4wjGkuMrfsVqYi357H3IFbU4yM04MR0Cj5RGQZESD+AqHtMc3tyfP fHhxTXm6gBxOQ3Cne2yZ2blVgh4b80RaAlV3gUtVKFzouOpvZ0+s7/KzA8BCJyaSvJYT pKYA== X-Gm-Message-State: AOAM5322vHqAjrL+AbtWiZ7SwQw1pkBMZk7v8uTxI50dETOgVt+2laoO Kf6dvowk7DJaPdj3TZx0ycEz1qBnmqUiZA== X-Google-Smtp-Source: ABdhPJynBpdIYJLN+AOWOA3nl23SFRAQB+jnomqmNZ33/QSYB+hgnCKIQ/DnjM6E1CzBYGdijFS0Lw== X-Received: by 2002:aed:31c5:: with SMTP id 63mr6427801qth.84.1607043947289; Thu, 03 Dec 2020 17:05:47 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v3 2/5] tests: Simplify some ppc64 tests Date: Thu, 3 Dec 2020 22:05:26 -0300 Message-Id: <20201204010529.325244-3-danielhb413@gmail.com> In-Reply-To: <20201204010529.325244-1-danielhb413@gmail.com> References: <20201204010529.325244-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.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza , Andrea Bolognani 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 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 Content-Type: text/plain; charset="utf-8" From: Andrea Bolognani We can leave out things like USB controller, memballoon device, kernel and initrd since they're not the focus of the tests. Propagating some information from the output files back to the input files makes it easier to compare them, as it reduces the resulting diff, and in the case of the qemuxml2xml test for memory-hotplug-ppc64-nonuma it allows us to convert the output file into a symlink, since in the specific case the XML doesn't change at all. Reviewed-by: Daniel Henrique Barboza Signed-off-by: Andrea Bolognani --- .../memory-hotplug-nvdimm-ppc64.args | 4 +- .../memory-hotplug-nvdimm-ppc64.xml | 8 +--- .../memory-hotplug-ppc64-nonuma.args | 7 +-- .../memory-hotplug-ppc64-nonuma.xml | 14 ++++-- .../memory-hotplug-nvdimm-ppc64.xml | 8 +--- .../memory-hotplug-ppc64-nonuma.xml | 46 +------------------ 6 files changed, 17 insertions(+), 70 deletions(-) mode change 100644 =3D> 120000 tests/qemuxml2xmloutdata/memory-hotplug-ppc= 64-nonuma.xml diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-ppc64.args b/test= s/qemuxml2argvdata/memory-hotplug-nvdimm-ppc64.args index 94bd86ada0..f50444e47e 100644 --- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-ppc64.args +++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-ppc64.args @@ -27,6 +27,4 @@ uuid=3D49545eb3-75e1-2d0a-acdd-f0294406c99e,memdev=3Dmemn= vdimm0,id=3Dnvdimm0,slot=3D0 \ server,nowait \ -mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ -rtc base=3Dutc \ --no-shutdown \ --usb \ --device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 +-no-shutdown diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-ppc64.xml b/tests= /qemuxml2argvdata/memory-hotplug-nvdimm-ppc64.xml index ae5a17d3c8..bf7df9a259 100644 --- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-ppc64.xml +++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-ppc64.xml @@ -21,16 +21,12 @@ destroy /usr/bin/qemu-system-ppc64 - -
- + - -
- + 49545eb3-75e1-2d0a-acdd-f0294406c99e diff --git a/tests/qemuxml2argvdata/memory-hotplug-ppc64-nonuma.args b/test= s/qemuxml2argvdata/memory-hotplug-ppc64-nonuma.args index 91cea9d8bf..f7f151d1ca 100644 --- a/tests/qemuxml2argvdata/memory-hotplug-ppc64-nonuma.args +++ b/tests/qemuxml2argvdata/memory-hotplug-ppc64-nonuma.args @@ -26,9 +26,4 @@ QEMU_AUDIO_DRV=3Dnone \ server,nowait \ -mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ -rtc base=3Dutc \ --no-shutdown \ --kernel /media/ram/uImage \ --initrd /media/ram/ramdisk \ --append 'root=3D/dev/ram rw console=3DttyS0,115200' \ --usb \ --device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x2 +-no-shutdown diff --git a/tests/qemuxml2argvdata/memory-hotplug-ppc64-nonuma.xml b/tests= /qemuxml2argvdata/memory-hotplug-ppc64-nonuma.xml index 7c68cd6aa2..a0806c4b54 100644 --- a/tests/qemuxml2argvdata/memory-hotplug-ppc64-nonuma.xml +++ b/tests/qemuxml2argvdata/memory-hotplug-ppc64-nonuma.xml @@ -7,9 +7,7 @@ 1 hvm - /media/ram/uImage - /media/ram/ramdisk - root=3D/dev/ram rw console=3DttyS0,115200 + destroy @@ -17,16 +15,24 @@ destroy /usr/bin/qemu-system-ppc64 - + + + + + + + 523264 +
524287 +
diff --git a/tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-ppc64.xml b/tes= ts/qemuxml2xmloutdata/memory-hotplug-nvdimm-ppc64.xml index ecb1b83b4a..0c0b9f96fb 100644 --- a/tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-ppc64.xml +++ b/tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-ppc64.xml @@ -21,16 +21,12 @@ destroy /usr/bin/qemu-system-ppc64 - -
- + - -
- + 49545eb3-75e1-2d0a-acdd-f0294406c99e diff --git a/tests/qemuxml2xmloutdata/memory-hotplug-ppc64-nonuma.xml b/tes= ts/qemuxml2xmloutdata/memory-hotplug-ppc64-nonuma.xml deleted file mode 100644 index a5905e64b5..0000000000 --- a/tests/qemuxml2xmloutdata/memory-hotplug-ppc64-nonuma.xml +++ /dev/null @@ -1,45 +0,0 @@ - - QEMUGuest1 - 49545eb3-75e1-2d0a-acdd-f0294406c99e - 4194304 - 2097152 - 2097152 - 1 - - hvm - /media/ram/uImage - /media/ram/ramdisk - root=3D/dev/ram rw console=3DttyS0,115200 - - - - destroy - restart - destroy - - /usr/bin/qemu-system-ppc64 - -
- - - - - - -
- - - - - 523264 - -
- - - - 524287 - -
- - - diff --git a/tests/qemuxml2xmloutdata/memory-hotplug-ppc64-nonuma.xml b/tes= ts/qemuxml2xmloutdata/memory-hotplug-ppc64-nonuma.xml new file mode 120000 index 0000000000..0822e409b4 --- /dev/null +++ b/tests/qemuxml2xmloutdata/memory-hotplug-ppc64-nonuma.xml @@ -0,0 +1 @@ +../qemuxml2argvdata/memory-hotplug-ppc64-nonuma.xml \ No newline at end of file --=20 2.26.2 From nobody Sat May 18 12:05:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1607044010; cv=none; d=zohomail.com; s=zohoarc; b=cXxAqxOJsXRa5BvE+6CDcEtJxt6S6t/+q5uE4dXdx3Rb9PUC1qKwq5lX/sBm53JXP/IBoypX4K4MieHQxtJkur3asI+wWeIuAHI/jE+XyNrFT3UGO9+ROQg4+kWrMhJntQqSaoCfpLxZfelpk2/piNNRslrGMAk57PeJ4fTiFW0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1607044010; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ckkhGY/UUjaHvuUPzvOQ2m2HYozzhAbelqxOEyDrq4o=; b=ag+PxsPiXsAvYWiE1fg9NHSQGKFMDnIKo/8zFoW+iSZCy1tCKy7DoLJVs+o4DJZMcDpUgYQEFoFX68AfOMcfzzbNWnM7wU9mzbPcWT0+CYFylbSnNvQir3EkZSIaNFedZhCsxWOitZzEkgwvZvg3IKR/TLhhhNeNs8WnyQ0GMVs= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1607044010210359.3468392240052; Thu, 3 Dec 2020 17:06:50 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-533-iSaVtqUUPQWn5-RlYvzKjg-1; Thu, 03 Dec 2020 20:06:47 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id D46D0107ACF6; Fri, 4 Dec 2020 01:06: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 ACA011002393; Fri, 4 Dec 2020 01:06:40 +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 73B5F50030; Fri, 4 Dec 2020 01:06:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0B415s21026413 for ; Thu, 3 Dec 2020 20:05:54 -0500 Received: by smtp.corp.redhat.com (Postfix) id 11E1D2026D3E; Fri, 4 Dec 2020 01:05:54 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0D24D202717E for ; Fri, 4 Dec 2020 01:05:54 +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-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E9AE3185A7BC for ; Fri, 4 Dec 2020 01:05:53 +0000 (UTC) Received: from mail-qt1-f172.google.com (mail-qt1-f172.google.com [209.85.160.172]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-443-HZV_Jnw8OuqkWMccdwIfvg-1; Thu, 03 Dec 2020 20:05:49 -0500 Received: by mail-qt1-f172.google.com with SMTP id a6so478033qtw.6; Thu, 03 Dec 2020 17:05:49 -0800 (PST) Received: from rekt.ibmuc.com ([2804:431:c7c7:c1a:69c1:2b22:e880:fc49]) by smtp.gmail.com with ESMTPSA id z133sm3600542qka.20.2020.12.03.17.05.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2020 17:05:48 -0800 (PST) X-MC-Unique: iSaVtqUUPQWn5-RlYvzKjg-1 X-MC-Unique: HZV_Jnw8OuqkWMccdwIfvg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ckkhGY/UUjaHvuUPzvOQ2m2HYozzhAbelqxOEyDrq4o=; b=qHmBPicSeMQ9yLWOS2O4aXJevwkfrDale7RtuMShlJnZOphEcF/Xdf0fcooPTGfnFw KRE/Cp16nqSdc6Kqy/beXi7o75b8qj6GkZaVhUrccxMN4G57DGgySeyCcQCqFUqMAe9F PG92mv4iN+buen8TTPUpGJXub/tNdscpS0TC2AQqyFm4GDTm3sWVDKuECjyNyEMMr6WY +ousj2vmD/sDip7PauAC7b1D1P8jcZVVoVylh7IWmiLffelbs4XzvWFHEdWJgnosda1m 5y0XjRZkiU+u2Tgr6cuh8as37drp9nMXincSyKrZZI17ahlr6Yi+p0091rdUmJ224RoI bycA== X-Gm-Message-State: AOAM53032DM2apPPWC6yphwnDSMEm3wTq+2Hun3fUVtAiyzeoDKeBy61 PCzAqE/sgcm6M0+hXjjtKeiMA1XqRkmthg== X-Google-Smtp-Source: ABdhPJw48I2QjvbGc0P/+vXCaZ+yywQ9xpixGj032mClZ0gw3AKIOiaPWdVfZoxVmaI0X6ZljmcrWg== X-Received: by 2002:ac8:c2:: with SMTP id d2mr6353343qtg.207.1607043949031; Thu, 03 Dec 2020 17:05:49 -0800 (PST) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v3 3/5] domain_conf.c: revert auto-alignment of pSeries NVDIMM in post parse Date: Thu, 3 Dec 2020 22:05:27 -0300 Message-Id: <20201204010529.325244-4-danielhb413@gmail.com> In-Reply-To: <20201204010529.325244-1-danielhb413@gmail.com> References: <20201204010529.325244-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.78 on 10.11.54.4 X-loop: libvir-list@redhat.com Cc: Michal Privoznik , Daniel Henrique Barboza 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 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 Content-Type: text/plain; charset="utf-8" The code to align ppc64 NVDIMMs on post parse was introduced in commit d3f3c2c97f9b. That commit failed to realize that we can't align memory unconditionally. As of commit c7d7ba85a624 ("qemu: command: Align memory sizes only on fresh starts"), all memory alignment should be executed only when we're not migrating or in a snapshot. This revert does not break any guests in the wild, given that ppc64 NVDIMMs are still being aligned in qemuDomainAlignMemorySizes(). Next patch will introduce a mechanism where we can have post parse NVDIMM alignment for pSeries without breaking the intended design, as defined by c7d7ba85a624. Commit d3f3c2c97f9b was predecessed by a move/rename of the former qemuDomainNVDimmAlignSizePseries() function, commit ace5931553c8. Reverting d3f3c2c97f9b will make the function rename obsolete since all callers will now reside in QEMU drivers files, and it will remain that way in the next patches, so let's revert ace5931553c8 as well. This reverts commit d3f3c2c97f9b92c982ff809479495f44614edb88 (domain_conf.c: auto-align pSeries NVDIMM in virDomainMemoryDefPostParse()). This reverts commit ace5931553c87beebb6b3cd994061742b3f88238 (conf, qemu: move qemuDomainNVDimmAlignSizePseries to domain_conf.c). Reviewed-by: Michal Privoznik Signed-off-by: Daniel Henrique Barboza --- src/conf/domain_conf.c | 59 +------------------ src/conf/domain_conf.h | 3 - src/libvirt_private.syms | 1 - src/qemu/qemu_domain.c | 42 ++++++++++++- .../memory-hotplug-nvdimm-ppc64.xml | 2 +- 5 files changed, 42 insertions(+), 65 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 425e3c3710..d069a3ecc2 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -5359,24 +5359,6 @@ virDomainVsockDefPostParse(virDomainVsockDefPtr vsoc= k) } =20 =20 -static int -virDomainMemoryDefPostParse(virDomainMemoryDefPtr mem, - const virDomainDef *def) -{ - /* Although only the QEMU driver implements PPC64 support, this - * code is related to the platform specification (PAPR), i.e. it - * is hypervisor agnostic, and any future PPC64 hypervisor driver - * will have the same restriction. - */ - if (ARCH_IS_PPC64(def->os.arch) && - mem->model =3D=3D VIR_DOMAIN_MEMORY_MODEL_NVDIMM && - virDomainNVDimmAlignSizePseries(mem) < 0) - return -1; - - return 0; -} - - static int virDomainDeviceDefPostParseCommon(virDomainDeviceDefPtr dev, const virDomainDef *def, @@ -5422,10 +5404,6 @@ virDomainDeviceDefPostParseCommon(virDomainDeviceDef= Ptr dev, ret =3D 0; break; =20 - case VIR_DOMAIN_DEVICE_MEMORY: - ret =3D virDomainMemoryDefPostParse(dev->data.memory, def); - break; - case VIR_DOMAIN_DEVICE_LEASE: case VIR_DOMAIN_DEVICE_FS: case VIR_DOMAIN_DEVICE_INPUT: @@ -5440,6 +5418,7 @@ virDomainDeviceDefPostParseCommon(virDomainDeviceDefP= tr dev, case VIR_DOMAIN_DEVICE_SHMEM: case VIR_DOMAIN_DEVICE_TPM: case VIR_DOMAIN_DEVICE_PANIC: + case VIR_DOMAIN_DEVICE_MEMORY: case VIR_DOMAIN_DEVICE_IOMMU: case VIR_DOMAIN_DEVICE_AUDIO: ret =3D 0; @@ -16836,42 +16815,6 @@ virDomainSEVDefParseXML(xmlNodePtr sevNode, return NULL; } =20 -int -virDomainNVDimmAlignSizePseries(virDomainMemoryDefPtr mem) -{ - /* For NVDIMMs in ppc64 in we want to align down the guest - * visible space, instead of align up, to avoid writing - * beyond the end of file by adding a potential 256MiB - * to the user specified size. - * - * The label-size is mandatory for ppc64 as well, meaning that - * the guest visible space will be target_size-label_size. - * - * Finally, target_size must include label_size. - * - * The above can be summed up as follows: - * - * target_size =3D AlignDown(target_size - label_size) + label_size - */ - unsigned long long ppc64AlignSize =3D 256 * 1024; - unsigned long long guestArea =3D mem->size - mem->labelsize; - - /* Align down guest_area. 256MiB is the minimum size. Error - * out if target_size is smaller than 256MiB + label_size, - * since aligning it up will cause QEMU errors. */ - if (mem->size < (ppc64AlignSize + mem->labelsize)) { - virReportError(VIR_ERR_XML_ERROR, "%s", - _("minimum target size for the NVDIMM " - "must be 256MB plus the label size")); - return -1; - } - - guestArea =3D (guestArea/ppc64AlignSize) * ppc64AlignSize; - mem->size =3D guestArea + mem->labelsize; - - return 0; -} - static virDomainMemoryDefPtr virDomainMemoryDefParseXML(virDomainXMLOptionPtr xmlopt, xmlNodePtr memdevNode, diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 34cde22965..b1571d423c 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -3912,9 +3912,6 @@ bool virDomainBlockIoTuneInfoEqual(const virDomainBlockIoTuneInfo *a, const virDomainBlockIoTuneInfo *b); =20 -int -virDomainNVDimmAlignSizePseries(virDomainMemoryDefPtr mem); - bool virHostdevIsSCSIDevice(const virDomainHostdevDef *hostdev) ATTRIBUTE_NONNULL(1); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 2f640ef1c4..5cf39bdf6c 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -546,7 +546,6 @@ virDomainNetTypeToString; virDomainNetUpdate; virDomainNostateReasonTypeFromString; virDomainNostateReasonTypeToString; -virDomainNVDimmAlignSizePseries; virDomainObjAssignDef; virDomainObjBroadcast; virDomainObjCheckActive; diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 663c0af867..af3c0e269a 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -8044,6 +8044,44 @@ qemuDomainGetMemoryModuleSizeAlignment(const virDoma= inDef *def, } =20 =20 +static int +qemuDomainNVDimmAlignSizePseries(virDomainDefPtr def, + virDomainMemoryDefPtr mem) +{ + /* For NVDIMMs in ppc64 in we want to align down the guest + * visible space, instead of align up, to avoid writing + * beyond the end of file by adding a potential 256MiB + * to the user specified size. + * + * The label-size is mandatory for ppc64 as well, meaning that + * the guest visible space will be target_size-label_size. + * + * Finally, target_size must include label_size. + * + * The above can be summed up as follows: + * + * target_size =3D AlignDown(target_size - label_size) + label_size + */ + unsigned long long ppc64AlignSize =3D qemuDomainGetMemorySizeAlignment= (def); + unsigned long long guestArea =3D mem->size - mem->labelsize; + + /* Align down guest_area. 256MiB is the minimum size. Error + * out if target_size is smaller than 256MiB + label_size, + * since aligning it up will cause QEMU errors. */ + if (mem->size < (ppc64AlignSize + mem->labelsize)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("minimum target size for the NVDIMM " + "must be 256MB plus the label size")); + return -1; + } + + guestArea =3D (guestArea/ppc64AlignSize) * ppc64AlignSize; + mem->size =3D guestArea + mem->labelsize; + + return 0; +} + + int qemuDomainAlignMemorySizes(virDomainDefPtr def) { @@ -8092,7 +8130,7 @@ qemuDomainAlignMemorySizes(virDomainDefPtr def) for (i =3D 0; i < def->nmems; i++) { if (def->mems[i]->model =3D=3D VIR_DOMAIN_MEMORY_MODEL_NVDIMM && ARCH_IS_PPC64(def->os.arch)) { - if (virDomainNVDimmAlignSizePseries(def->mems[i]) < 0) + if (qemuDomainNVDimmAlignSizePseries(def, def->mems[i]) < 0) return -1; } else { align =3D qemuDomainGetMemoryModuleSizeAlignment(def, def->mem= s[i]); @@ -8129,7 +8167,7 @@ qemuDomainMemoryDeviceAlignSize(virDomainDefPtr def, { if (mem->model =3D=3D VIR_DOMAIN_MEMORY_MODEL_NVDIMM && ARCH_IS_PPC64(def->os.arch)) { - return virDomainNVDimmAlignSizePseries(mem); + return qemuDomainNVDimmAlignSizePseries(def, mem); } else { mem->size =3D VIR_ROUND_UP(mem->size, qemuDomainGetMemorySizeAlignment(def)); diff --git a/tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-ppc64.xml b/tes= ts/qemuxml2xmloutdata/memory-hotplug-nvdimm-ppc64.xml index 0c0b9f96fb..bf7df9a259 100644 --- a/tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-ppc64.xml +++ b/tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-ppc64.xml @@ -34,7 +34,7 @@ /tmp/nvdimm - 524416 + 550000 0