Bug 1980199 - virsh setmem --config doesn't work well when vm is not running
Summary: virsh setmem --config doesn't work well when vm is not running
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: libvirt
Version: 8.5
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: 8.5
Assignee: Pavel Hrdina
QA Contact: Jing Qi
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-07-08 05:01 UTC by Jing Qi
Modified: 2021-11-16 08:52 UTC (History)
6 users (show)

Fixed In Version: libvirt-7.6.0-1.module+el8.5.0+12097+2c77910b
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-16 07:55:01 UTC
Type: Bug
Target Upstream Version: 7.6.0
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2021:4684 0 None None None 2021-11-16 07:55:59 UTC

Description Jing Qi 2021-07-08 05:01:08 UTC
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.

Comment 1 Pavel Hrdina 2021-07-23 09:30:16 UTC
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

Comment 2 Jing Qi 2021-07-28 05:14:14 UTC
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>

Comment 3 Jing Qi 2021-08-03 02:21:02 UTC
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.

Comment 6 errata-xmlrpc 2021-11-16 07:55:01 UTC
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


Note You need to log in before you can comment on or make changes to this bug.