Description of problem: virsh setmem --config doesn't work well when vm is not running Version-Release number of selected component (if applicable): libvirt-daemon-7.5.0-1.module+el8.5.0+11664+59f87560.x86_64 qemu-kvm-6.0.0-21.module+el8.5.0+11555+e0ab0d09.x86_64 How reproducible: Always Steps to Reproduce: 1. prepare a vm - <memory unit='KiB'>2097152</memory> <currentMemory unit='KiB'>2097152</currentMemory> 2. virsh setmem avocado-vt-vm1 3G --config error: Requested operation is not valid: domain is not running Actual results: setmem failed Expected results: setmem succeed Additional info: The cmd worked in other versions.
Upstream commit: commit dc721f99df82ccc652624fc2940251722d83f435 Author: Pavel Hrdina <phrdina> Date: Thu Jul 22 21:00:50 2021 +0200 virsh: fix setmem flags logic v7.5.0-195-gdc721f99df
Tested with libvirt upstream version v7.6.0-rc1 & qemu-6.0.0-11.fc35.x86_64 1. Create domain with below memory configuration in domain xml - <maxMemory slots='16' unit='KiB'>8388608</maxMemory> <memory unit='KiB'>3133439</memory> <currentMemory unit='KiB'>2097152</currentMemory> 2.# virsh setmem pc 1G --config No error. 3.# virsh edit pc <maxMemory slots='16' unit='KiB'>8388608</maxMemory> <memory unit='KiB'>3133439</memory> <currentMemory unit='KiB'>1048576</currentMemory>
Verified with libvirt-7.6.0-1.module+el8.5.0+12097+2c77910b.x86_64 & qemu-kvm-6.0.0-21.module+el8.5.0+11555+e0ab0d09.x86_64 Steps are the same with Comment 2.
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