From nobody Wed Oct 30 19:56:10 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; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1678716589; cv=none; d=zohomail.com; s=zohoarc; b=apRWhbtLmEvxXkrZBYfQae1fte2JkvT6ZtBSEvyS5nU27JMS7EWjrb7b9seJArlNct9umq7ZBNuzO91M+xfpRebZLsppEgcskdid4CvoHNiFjQEJPWwf6Q1HjDNxy9ndGfEbRx4Bcyb0OcC+tf1TCgIUou3ZZTOd1lkJdiECyfk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1678716589; h=Content-Type:Content-Transfer-Encoding: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=sim3rdM0slDXlf4AV3N9KVJrraWKcVOroVBU4OSC9eM=; b=eUgaEpz8HHyDGyqY3qXVcMVMYvW3S9pr+AFJoVGzaBRKpomFickdS1zNCzRamZ5IxJhhqEk+WK3GFUkwCtHa7g0qv43t4GMMjZ+B6KvSoao2J51PT15tUarsXnBXdiyCpwY/RASc/psmUZXis6r7RqmB21jCvtvinTp9UpW9Sxg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) 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 1678716589071135.17037880880468; Mon, 13 Mar 2023 07:09:49 -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-614-rjvCmf8KMXazeBlX7qWffw-1; Mon, 13 Mar 2023 10:09:44 -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 5C25529AA384; Mon, 13 Mar 2023 14:09:39 +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 4364D40C6E68; Mon, 13 Mar 2023 14:09:39 +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 12707194658F; Mon, 13 Mar 2023 14:09:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5E9121946588 for ; Mon, 13 Mar 2023 14:09:35 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 5374B140E95F; Mon, 13 Mar 2023 14:09:35 +0000 (UTC) Received: from fedora.. (unknown [10.43.2.118]) by smtp.corp.redhat.com (Postfix) with ESMTP id EEB12140E991 for ; Mon, 13 Mar 2023 14:09:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678716588; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=sim3rdM0slDXlf4AV3N9KVJrraWKcVOroVBU4OSC9eM=; b=Zu0coG2n2zyGEikGBSFkmFo6ZSrAr5NI8wMCczLgAEI0piHuM0hy2T7U2iA8NZxbtKGSBM ORK5HepUOM1BtMorQrDAVHXTt6W87tj4GQ1RiS4Z0agYcVdkHFwbaRn6svbKmRE1ZIbXDy QpttkPHN+LWlGgvs7juOvffP2yhYP20= X-MC-Unique: rjvCmf8KMXazeBlX7qWffw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Subject: [libvirt PATCH 1/2] qemu: relax shared memory check for vhostuser daemons Date: Mon, 13 Mar 2023 15:09:31 +0100 Message-Id: <05ae7cb75aeb9433734d90fbce8fc212221174c6.1678716555.git.jtomko@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 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: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1678716591035100002 For some vhostuser daemons, we validate that the guest memory is shared with the host. With earlier versions of QEMU, it was only possible to mark memory as shared by defining an explicit NUMA topology. Later, QEMU exposed the name of the default memory backend (defaultRAMid) so we can mark that memory as shared. Since libvirt commit: commit bff2ad5d6b1f25da02802273934d2a519159fec7 qemu: Relax validation for mem->access if guest has no NUMA we already check for the case when user requests shared memory, but QEMU did not expose defaultRAMid. Drop the duplicit check from vhostuser device validation, to make it pass on hotplug even after libvirtd restart. This avoids the need to store the defaultRAMid, since we don't really need it for anything after the VM has been already started. https://bugzilla.redhat.com/show_bug.cgi?id=3D2078693 https://bugzilla.redhat.com/show_bug.cgi?id=3D2177701 Signed-off-by: J=C3=A1n Tomko --- src/qemu/qemu_validate.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 0146220d8f..f750684414 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -1782,7 +1782,7 @@ qemuValidateNetSupportsCoalesce(virDomainNetType type) static int qemuValidateDomainDefVhostUserRequireSharedMemory(const virDomainDef *def, const char *name, - virQEMUCaps *qemuCaps) + virQEMUCaps *qemuCaps G_= GNUC_UNUSED) { const char *defaultRAMId =3D virQEMUCapsGetMachineDefaultRAMid(qemuCap= s, def->virt= Type, @@ -1790,8 +1790,7 @@ qemuValidateDomainDefVhostUserRequireSharedMemory(con= st virDomainDef *def, size_t numa_nodes =3D virDomainNumaGetNodeCount(def->numa); size_t i; =20 - if (numa_nodes =3D=3D 0 && - !(defaultRAMId && def->mem.access =3D=3D VIR_DOMAIN_MEMORY_ACCESS_= SHARED)) { + if (numa_nodes =3D=3D 0 && def->mem.access !=3D VIR_DOMAIN_MEMORY_ACCE= SS_SHARED) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("'%s' requires shared memory"), name); return -1; --=20 2.39.2