From nobody Fri Apr 19 11:05:49 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=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1602608023; cv=none; d=zohomail.com; s=zohoarc; b=Z6ncTquoHBbW7W2PzVivPJ8kdpmcOE3JJ/9mY1Gbjr7ql1u1w92B7c0JyZeP/3lOgpjjBMz8v/Tvenshzoq5pOYTp/901px4Q8j31m5Bhqhh+4BDHj065jEY/vvjdHib2u8Tmr9Tlq4QUpvVqzMgKIzKiP05do+fbvJiTYa73pQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602608023; 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=dIiEwm/xt034LwbUtuTorxj4Rm/fYigk/hgRFqD/Dvw=; b=Fgu8ZBjiiQtPYqo/MCDpc591TWnYk7FKCRBBfoJ7aRkzaEMmkcIT4b/gjfrMhgB2M0nyli4U279EMi0KYRnE8ahZEvZ4mhbVtAO0wycr26HKECXlblA/c5JC8VgvEdIStf4DRU/UIMnTa8S7xycg+QAgwYgxw/X+BXR9qiNWafs= 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 1602608023328993.33477682682; Tue, 13 Oct 2020 09:53:43 -0700 (PDT) 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-559-7ih12t7TOnGk6ZynQ6D8Gg-1; Tue, 13 Oct 2020 12:53:39 -0400 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 051008015A3; Tue, 13 Oct 2020 16:53:34 +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 A77F7100238E; Tue, 13 Oct 2020 16:53:33 +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 9B7DE58121; Tue, 13 Oct 2020 16:53:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 09DGrUuM004528 for ; Tue, 13 Oct 2020 12:53:30 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1A1B72166BDB; Tue, 13 Oct 2020 16:53:30 +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 14C2C2166BB3 for ; Tue, 13 Oct 2020 16:53:28 +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-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 46E11182360F for ; Tue, 13 Oct 2020 16:53:28 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-473-5PfRWQyvOb-7RgCPk9NXHQ-1; Tue, 13 Oct 2020 12:53:23 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 09DGY6Wl190296; Tue, 13 Oct 2020 12:53:23 -0400 Received: from ppma04fra.de.ibm.com (6a.4a.5195.ip4.static.sl-reverse.com [149.81.74.106]) by mx0b-001b2d01.pphosted.com with ESMTP id 345fm6s0rc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 Oct 2020 12:53:23 -0400 Received: from pps.filterd (ppma04fra.de.ibm.com [127.0.0.1]) by ppma04fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 09DGqG7W003936; Tue, 13 Oct 2020 16:53:21 GMT Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by ppma04fra.de.ibm.com with ESMTP id 3434k7spt5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 Oct 2020 16:53:21 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 09DGrIpR19726620 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 13 Oct 2020 16:53:18 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3CB45A404D; Tue, 13 Oct 2020 16:53:18 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EE3A3A4053; Tue, 13 Oct 2020 16:53:17 +0000 (GMT) Received: from marcibm.ibmuc.com (unknown [9.145.92.138]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 13 Oct 2020 16:53:17 +0000 (GMT) X-MC-Unique: 7ih12t7TOnGk6ZynQ6D8Gg-1 X-MC-Unique: 5PfRWQyvOb-7RgCPk9NXHQ-1 From: Marc Hartmayer To: Subject: [PATCH 1/2] qemu: virtiofs can be used without NUMA nodes Date: Tue, 13 Oct 2020 18:53:11 +0200 Message-Id: <20201013165312.32261-2-mhartmay@linux.ibm.com> In-Reply-To: <20201013165312.32261-1-mhartmay@linux.ibm.com> References: <20201013165312.32261-1-mhartmay@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-10-13_08:2020-10-13, 2020-10-13 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 suspectscore=1 spamscore=0 phishscore=0 mlxlogscore=999 bulkscore=0 adultscore=0 lowpriorityscore=0 impostorscore=0 mlxscore=0 malwarescore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010130118 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.6 X-loop: libvir-list@redhat.com Cc: Halil Pasic , =?UTF-8?q?Michal=20Pr=C3=ADvozn=C3=ADk?= , Boris Fiuczynski 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" ...if a machine memory-backend using shared memory is configured for the guest. This is especially important for QEMU machine types that don't have NUMA but virtiofs support. An example snippet: test 2097152 ... ... and the corresponding QEMU command line: /usr/bin/qemu-system-s390x \ -machine s390-ccw-virtio-5.2,memory-backend=3Ds390.ram \ -m 2048 \ -object memory-backend-file,id=3Ds390.ram,mem-path=3D/var/lib/libvirt/qemu/ram/46= -test/s390.ram,share=3Dyes,size=3D2147483648 \ ... Signed-off-by: Marc Hartmayer --- src/qemu/qemu_validate.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 27e10d59fd25..bc3043bb3f0d 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -3470,14 +3470,19 @@ qemuValidateDomainDeviceDefGraphics(const virDomain= GraphicsDef *graphics, =20 =20 static int -qemuValidateDomainDefVirtioFSSharedMemory(const virDomainDef *def) +qemuValidateDomainDefVirtioFSSharedMemory(const virDomainDef *def, + virQEMUCapsPtr qemuCaps) { + const char *defaultRAMId =3D virQEMUCapsGetMachineDefaultRAMid(qemuCap= s, + def->virt= Type, + def->os.m= achine); size_t numa_nodes =3D virDomainNumaGetNodeCount(def->numa); size_t i; =20 - if (numa_nodes =3D=3D 0) { + if (numa_nodes =3D=3D 0 && + !(defaultRAMId && def->mem.access =3D=3D VIR_DOMAIN_MEMORY_ACCESS_= SHARED)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("virtiofs requires one or more NUMA nodes")); + _("virtiofs requires shared memory")); return -1; } =20 @@ -3591,7 +3596,7 @@ qemuValidateDomainDeviceDefFS(virDomainFSDefPtr fs, _("virtiofs does not support multidevs")); return -1; } - if (qemuValidateDomainDefVirtioFSSharedMemory(def) < 0) + if (qemuValidateDomainDefVirtioFSSharedMemory(def, qemuCaps) < 0) return -1; break; =20 --=20 2.25.4