Description of problem: vm with memory device started failed for below reason- error: internal error: process exited while connecting to monitor: 2021-05-17T05:11:43.421282Z qemu-kvm: can't open backing store /var/lib/libvirt/qemu/ram/2-avocado-vt-vm1/dimm0 for guest RAM: No such file or directory Version-Release number of selected component (if applicable): libvirt-7.3.0-1.module+el8.5.0+11004+f4810536.x86_64 qemu-kvm-6.0.0-16.module+el8.5.0+10848+2dccc46d.x86_64 How reproducible: always Steps to Reproduce: 1.prepare vm with memory device as below - <maxMemory slots='16' unit='KiB'>8388608</maxMemory> <memory unit='KiB'>2621439</memory> <currentMemory unit='KiB'>2621439</currentMemory> ... <cpu mode='host-model' check='partial'> <feature policy='disable' name='vmx'/> <numa> <cell id='0' cpus='0-1' memory='2097152' unit='KiB'/> </numa> </cpu> <memory model='dimm' access='private' discard='yes'> <target> <size unit='KiB'>524287</size> <node>0</node> </target> <address type='dimm' slot='0'/> </memory> 2.virsh start avocado-vt-vm1 error: Failed to start domain 'avocado-vt-vm1' error: internal error: process exited while connecting to monitor: 2021-05-17T05:11:43.421282Z qemu-kvm: can't open backing store /var/lib/libvirt/qemu/ram/2-avocado-vt-vm1/dimm0 for guest RAM: No such file or directory Actual results: vm started failed Expected results: vm can start successfully Additional info: If <source type='file'> is added in <memoryBacking> , the vm can be started.
The problem is that we construct memory-backend-file with path pointing to /var/lib/libvirt/qemu/ram/... but later when preparing the host qemuProcessBuildDestroyMemoryPaths() is called which subsequently calls qemuProcessNeedMemoryBackingPath() which is supposed to return TRUE, because we need memory backing dir path. However, it checks for NUMA nodes only and not memory devices.
Patch proposed on the list: https://listman.redhat.com/archives/libvir-list/2021-May/msg00618.html
Merged upstream as: g19967f64f4 qemu: Add check for needed paths for memory devices v7.3.0-246-g19967f64f4
To POST per comment 4.
Tested with libvirt upstream version v7.3.0-257-gd8c468d58c & qemu-kvm-5.2.0-0.7.rc2.fc34.x86_64. Vm can be started successfully with memory device - <maxMemory slots='16' unit='KiB'>8388608</maxMemory> <memory unit='KiB'>2621439</memory> <currentMemory unit='KiB'>2097152</currentMemory> <vcpu placement='static'>2</vcpu> ... <numa> <cell id='0' cpus='0-1' memory='2097152' unit='KiB'/> </numa> </cpu> ... <memory model='dimm' access='private' discard='yes'> <target> <size unit='KiB'>524287</size> <node>0</node> </target> <address type='dimm' slot='0'/> </memory> # virsh start pc Domain 'pc' started
Verified with libvirt-daemon-7.4.0-1.module+el8.5.0+11218+83343022.x86_64 & qemu-kvm-6.0.0-19.module+el8.5.0+11385+6e7d542e.x86_64 Passed and test steps are the same as Comment 6.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (virt:av bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2021:4684