Bug 1735375

Summary: Introduce virtio-pmem support (libvirt)
Product: Red Hat Enterprise Linux Advanced Virtualization Reporter: Luiz Capitulino <lcapitulino>
Component: libvirtAssignee: Michal Privoznik <mprivozn>
Status: CLOSED WONTFIX QA Contact: Jing Qi <jinqi>
Severity: low Docs Contact:
Priority: medium    
Version: 8.3CC: dhildenb, dyuan, hhan, jsuchane, knoel, lmen, mprivozn, rbalakri, virt-maint, xuzhang, yalzhang
Target Milestone: rcKeywords: FutureFeature, Upstream
Target Release: 8.3   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-01-29 14:06:20 UTC Type: Feature Request
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1735374    
Bug Blocks:    

Description Luiz Capitulino 2019-07-31 20:48:22 UTC
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

Comment 1 Luiz Capitulino 2019-07-31 20:50:42 UTC
Just a note, Pankaj will soon start a thread in libvirt-devel to get
the ball rolling on upstream.

Comment 6 Michal Privoznik 2021-01-15 14:13:50 UTC
Another attempt:

https://www.redhat.com/archives/libvir-list/2021-January/msg00730.html

Comment 7 Michal Privoznik 2021-01-18 10:57:43 UTC
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

Comment 8 Jing Qi 2021-01-28 04:18:52 UTC
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

Comment 9 David Hildenbrand 2021-01-29 14:06:20 UTC
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.