Bug 1961118
Summary: | virsh setmem run failed with " --current" when domain is not running | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux Advanced Virtualization | Reporter: | Jing Qi <jinqi> |
Component: | libvirt | Assignee: | Michal Privoznik <mprivozn> |
Status: | CLOSED ERRATA | QA Contact: | Jing Qi <jinqi> |
Severity: | high | Docs Contact: | |
Priority: | low | ||
Version: | 8.4 | CC: | ehadley, jdenemar, jsuchane, lcheng, lmen, pkrempa, smitterl, virt-maint, yidliu |
Target Milestone: | rc | Keywords: | Automation, Regression, TestBlocker, Triaged, Upstream |
Target Release: | 8.5 | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | libvirt-7.4.0-1.el8 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2021-11-16 07:53:34 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | 7.4.0 |
Embargoed: |
Description
Jing Qi
2021-05-17 09:56:46 UTC
Caused by: commit b5e267e8c59a257652f88d034cb1e0ce1ed4b58a Author: Michal Prívozník <mprivozn> Date: Wed Nov 25 10:40:50 2020 +0100 virsh: Simplify @flags handing in cmdSetmem() and cmdSetmaxmem() What code tries to achieve is that if no flags were provided to either 'setmem' or 'setmaxmem' commands then the old (no flags) API is called to be able to communicate with older daemons. Well, the code can be simplified a bit. Note that with this change the old no flag version of APIs is used more often. Previously if --current argument was given it resulted in *Flags() version to be called even though it is not necessary - VIR_DOMAIN_AFFECT_CURRENT is implied. Therefore, this change in fact allows virsh to talk with broader set of daemons. No other user visible changes were made. Signed-off-by: Michal Privoznik <mprivozn> Reviewed-by: Daniel Henrique Barboza <danielhb413> The problem is that the legacy API virDomainSetMaxMemory implies VIR_DOMAIN_AFFECT_LIVE in it's internal call and since --current doesn't add any special flag the old API is used instead of the new one which handles CURRENT properly. This was a hack in virsh though, the public API behavior didn't change. Ooops. Patch proposed upstream: https://listman.redhat.com/archives/libvir-list/2021-May/msg00484.html Setting to blocker- as while this has the "test blocker" keyword it will not be a blocker for a release. Fixed upstream as: 168190e19c virsh: Fix logic wrt to --current flag in cmdSetmem v7.3.0-222-g168190e19c Tested with libvirt upstream version v7.3.0-257-gd8c468d58c & qemu-kvm-5.2.0-0.7.rc2.fc34.x86_64. S1. Run "virsh setmem x x --current" on a stopped vm. 1. Prepare a vm with below configuration. <maxMemory slots='16' unit='KiB'>8388608</maxMemory> <memory unit='KiB'>2621439</memory> <currentMemory unit='KiB'>2097152</currentMemory> <vcpu placement='static'>2</vcpu> 2. ✗ virsh setmem pc 2GiB --current 3. ✗ virsh dumpxml pc |grep -i memory <maxMemory slots='16' unit='KiB'>8388608</maxMemory> <memory unit='KiB'>2621439</memory> <currentMemory unit='KiB'>2097152</currentMemory> <cell id='0' cpus='0-1' memory='2097152' unit='KiB'/> <memory model='dimm' access='private' discard='yes'> </memory> 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 9. 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 |