From nobody Mon Feb 9 00:39:00 2026 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; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.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=1606489536; cv=none; d=zohomail.com; s=zohoarc; b=iA6xZJSqUP/gbaN+Rx71ZjAM8hNw4W5dmogZq6pKYmIYJGuk6Ltb2CSkYDP+aQ6lWfGgyvWfVGk5Ly9jgZB047BaXg597lZaDIZNDiOxyhPyT/xhGHg6Twftv6rSiuaOQFXUUJp2jP9lg3p07FjhZrNGcJu5j0qmAxwHIHyq3Go= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606489536; 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=DtatU/x2pdKgTynORsO63W1WEJVLT2K0QVV6FrkKR4A=; b=Bvmq5f4JLpVFtFaYfF4A3Bh+LEGtA0Xl4s+Q50X8f9bkRyVusn+rm2AshFRXcY8r5l0n04ra/XvfJMZemTKNalfCQDE1VjHZh4jLI33/RkAeCr3NmW9QcmAdCj3JYzqUjJiG+kus3kUxYhYkxj4S/qgjdZAMwpDeBoLADgVNJuY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass 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 1606489535957178.89878291197215; Fri, 27 Nov 2020 07:05:35 -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-446-elfDVlxsOY67RjtSCzNGEw-1; Fri, 27 Nov 2020 10:05:32 -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 E5D5D100E1CA; Fri, 27 Nov 2020 15:05:26 +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 BCE7A10074F1; Fri, 27 Nov 2020 15:05:26 +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 87F241809CA7; Fri, 27 Nov 2020 15:05:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0ARF5Npg031086 for ; Fri, 27 Nov 2020 10:05:23 -0500 Received: by smtp.corp.redhat.com (Postfix) id 345445D9EF; Fri, 27 Nov 2020 15:05:23 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.195.47]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6902E5D9E8; Fri, 27 Nov 2020 15:05:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606489534; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=DtatU/x2pdKgTynORsO63W1WEJVLT2K0QVV6FrkKR4A=; b=DonCTCkVCfM+PHTFos0P82oCIGn4Rc2YmJFcIx4kF1r2lK6wFL+18KEznmH4wbpdMNsogX vaY07EpFTvPxuN85Q4e+pXrJeiXqYh7i+QOSVf/TZMwA4cr3fT077WOswdBAuPdSqtCjco /i5mh5k8eI0FhB0xAGq561qStPE+YAY= X-MC-Unique: elfDVlxsOY67RjtSCzNGEw-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH v1 17/26] qemu: Create virtio-pmem in domain namespace Date: Fri, 27 Nov 2020 16:03:03 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: david@redhat.com 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 X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Some users might wanto have virtio-pmem backed by a block device in which case we have to create the device in domain namespace. Signed-off-by: Michal Privoznik --- src/qemu/qemu_namespace.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_namespace.c b/src/qemu/qemu_namespace.c index ba1e6365f1..0800c5d585 100644 --- a/src/qemu/qemu_namespace.c +++ b/src/qemu/qemu_namespace.c @@ -351,10 +351,25 @@ static int qemuDomainSetupMemory(virDomainMemoryDefPtr mem, char ***paths) { - if (mem->model !=3D VIR_DOMAIN_MEMORY_MODEL_NVDIMM) + const char *path =3D NULL; + + switch (mem->model) { + case VIR_DOMAIN_MEMORY_MODEL_NVDIMM: + path =3D mem->s.nvdimm.path; + break; + case VIR_DOMAIN_MEMORY_MODEL_VIRTIO: + path =3D mem->s.virtio.path; + break; + case VIR_DOMAIN_MEMORY_MODEL_DIMM: + case VIR_DOMAIN_MEMORY_MODEL_LAST: + case VIR_DOMAIN_MEMORY_MODEL_NONE: + break; + } + + if (!path) return 0; =20 - return virStringListAdd(paths, mem->s.nvdimm.path); + return virStringListAdd(paths, path); } =20 =20 --=20 2.26.2