Virtio-pmem support has been added to kernel and qemu upstream (see bug 1735366 and bug 1735374). We now need support in libvirt. For a virtio-pmem introduction, please see: https://lists.gnu.org/archive/html/qemu-devel/2019-07/msg06535.html
Just a note, Pankaj will soon start a thread in libvirt-devel to get the ball rolling on upstream.
v1: https://www.redhat.com/archives/libvir-list/2020-November/msg01525.html
steps: https://www.redhat.com/archives/libvir-list/2020-December/msg00083.html
Another attempt: https://www.redhat.com/archives/libvir-list/2021-January/msg00730.html
Merged upstream: 6cf2ce8e8b qemu: Build command line for virtio-pmem 5b4b8dd1e2 qemu: Create virtio-pmem in namespace a536873d82 qemu: Allow virtio-pmem in CGroups 5259748a9f security: Relabel virtio-pmem 173733b7a8 conf: Introduce virtio-pmem <memory/> model f06c1d908f qemu_capabilities: Introduce QEMU_CAPS_DEVICE_VIRTIO_PMEM_PCI v7.0.0-33-g6cf2ce8e8b
Verified in libvirt upstream v7.0.0-157-g85be8e3d74 & qemu-5.1.0-9.fc33.x86_64 S1: Start domain with memory device using "virtio-pmem" driver steps: 1. #mkdir /tmp/virtio_pmem 2. In domain configuration, add below part - <memory model='virtio-pmem' access='shared'> <source> <path>/tmp/virtio_pmem</path> </source> <target> <size unit='KiB'>524288</size> </target> <alias name='virtiopmem0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/> </memory> 3. Start domain- #virsh start pc Domain 'pc' started 4. Checking qemu cmdline - -object memory-backend-file,id=memvirtiopmem0,mem-path=/tmp/virtio_pmem,share=yes,size=536870912 -device virtio-pmem-pci,memdev=memvirtiopmem0,id=virtiopmem0,bus=pci.0,addr=0xa
virtio-pmem still has a known preflush issue in the upstream kernel, which has to be sorted out upstream first. As the author of virtio-pmem is no longer working at Red Hat, we won't be supporting virtio-pmem in RHEL8 and will disable it in RHEL9 until we have an upstream fix. Until then, we really can't test and support this in QEMU.