From nobody Mon May 6 10:02:02 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1602001301; cv=none; d=zohomail.com; s=zohoarc; b=SxReHFmkrB5Wj9Fv4QuIdercvege+KXR5/B6NjoVWjNgjCMpxMDODGs5ipSzWyqNDe1I8M7l8R4uNT3Gy9LQ/A/JfSycRVoN4WlMfbxe7w0NJGTeH7innZBFAsn3WYban1l0IPHw7/3qjhTBZoQRqNx7RGrESPpBcDL5OWZMV30= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1602001301; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=gNK0QW6by8ZWaSJXmM6MV+qh3dXKb/3R/wo84VubaI0=; b=GI8YgiHCLayTmzJTqCA68C3sQG+LpiZHhljcZZHRKhtofub76iD1IggjErWAYtJo/XZR6dEBFFzajNSoi5L8r35m9UOSguekCuopoA4dMyRk6PucRXSRvrIvcdhRQttKymG9vg7i8leawHfAyAlE9vJY5Fqow76uFuRm4w+h3zc= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.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 [63.128.21.124]) by mx.zohomail.com with SMTPS id 1602001301039834.9261006950611; Tue, 6 Oct 2020 09:21:41 -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-406-veGqEDsYMwizt1Jd8iExag-1; Tue, 06 Oct 2020 12:21:36 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E6E73803F51; Tue, 6 Oct 2020 16:21:30 +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 B3E3B5D9D2; Tue, 6 Oct 2020 16:21:30 +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 6FD7379FE2; Tue, 6 Oct 2020 16:21:30 +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 096GLS8P025988 for ; Tue, 6 Oct 2020 12:21:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id 69FF1EAFA7; Tue, 6 Oct 2020 16:21:28 +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 5E9CBEAFAC for ; Tue, 6 Oct 2020 16:21:19 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.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 0AA43800161 for ; Tue, 6 Oct 2020 16:21:19 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-181-UoDRxoRvO7SXDnEEjbbFwA-1; Tue, 06 Oct 2020 12:21:16 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 096GAZNQ165102; Tue, 6 Oct 2020 12:21:15 -0400 Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 340u8h1ssr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 06 Oct 2020 12:21:15 -0400 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 096GI9ns024791; Tue, 6 Oct 2020 16:21:13 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma04ams.nl.ibm.com with ESMTP id 33xgx83dsb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 06 Oct 2020 16:21:12 +0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 096GLAeQ30671212 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 6 Oct 2020 16:21:10 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 14DD2AE05A; Tue, 6 Oct 2020 16:21:10 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D2605AE055; Tue, 6 Oct 2020 16:21:09 +0000 (GMT) Received: from marcibm.ibmuc.com (unknown [9.145.191.8]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 6 Oct 2020 16:21:09 +0000 (GMT) X-MC-Unique: veGqEDsYMwizt1Jd8iExag-1 X-MC-Unique: UoDRxoRvO7SXDnEEjbbFwA-1 From: Marc Hartmayer To: Subject: [RFC] qemu: virtiofs can be used without NUMA nodes Date: Tue, 6 Oct 2020 18:20:58 +0200 Message-Id: <20201006162058.44596-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-06_06:2020-10-06, 2020-10-06 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 mlxscore=0 impostorscore=0 malwarescore=0 adultscore=0 suspectscore=1 phishscore=0 priorityscore=1501 bulkscore=0 clxscore=1015 mlxlogscore=967 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2010060101 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: =?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.79 on 10.5.11.14 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 --- Note: There are still some TODOs left... e.g. adapt the virtiofs documentation of libvirt. --- src/qemu/qemu_validate.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index a212605579d2..077a85b30802 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -3470,14 +3470,21 @@ 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)) { + /* TODO do we need further checks here (e.g. check whether + * memory backend is supported by the QEMU binary)? */ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", - _("virtiofs requires one or more NUMA nodes")); + _("virtiofs requires shared memory")); return -1; } =20 @@ -3591,7 +3598,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