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:
Just a note, Pankaj will soon start a thread in libvirt-devel to get
the ball rolling on 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
Verified in libvirt upstream v7.0.0-157-g85be8e3d74
S1: Start domain with memory device using "virtio-pmem" driver
1. #mkdir /tmp/virtio_pmem
2. In domain configuration, add below part -
<memory model='virtio-pmem' access='shared'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/>
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.