Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-15480

Fail to attach virtio-mem device to persistent guest config without memory slot

    • libvirt-10.0.0-1.el9
    • None
    • Moderate
    • rhel-sst-virt-tools
    • ssg_virtualization
    • 20
    • 26
    • None
    • QE ack, Dev ack
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • 10.0.0
    • None

      What were you trying to do that didn't work?

      Error msg prompts when attaching virtio-mem device to persistent guest config without memory slot.

      Please provide the package NVR for which bug is seen:

       # rpm -q libvirt
      libvirt-9.5.0-7.el9_3.x86_64

      How reproducible:

      100%

      Steps to reproduce

      1. Define a guest with below config xml:

      <maxMemory unit="KiB">20485760</maxMemory>
      <memory unit="KiB">2097152</memory>
      <currentMemory unit="KiB">2097152</currentMemory>

      ...

      <numa>
            <cell id="0" cpus="0-5" memory="2097152" unit="KiB"/>
      </numa>

      2. Prepare a virtio-mem device with below config xml:

       # cat mem.xml 
      <memory model='virtio-mem'> 
        <target> 
          <size unit='MiB'>512</size> 
          <block unit='KiB'>2048</block>
          <requested unit='MiB'>512</requested> 
          <node>0</node> 
        </target> 
      </memory>

      3. Attach the virtio-mem device from step2:

       # virsh attach-device vm1 mem.xml --config
      error: Failed to attach device from mem.xml
      error: unsupported configuration: no free memory device slot available

      Expected results

      The virtio-mem device should be attached successfully.

      Actual results

      Error msg "no free memory device slot available" prompts while attaching.

       

      Additional info:

      If define the guest with below config xml:

      <maxMemory unit="KiB">20485760</maxMemory>
      <memory unit="KiB">2097152</memory>
      <currentMemory unit="KiB">2097152</currentMemory>

      ...
      <numa>
            <cell id="0" cpus="0-5" memory="2097152" unit="KiB"/>
      </numa>

      ...

      <memory model='virtio-mem'> 
        <target> 
          <size unit='MiB'>512</size> 
          <block unit='KiB'>2048</block>
          <requested unit='MiB'>512</requested> 
          <node>0</node> 
        </target> 
      </memory>

      The the guest config could be defined:

       # virsh define vm1.xml
      Domain 'vm1' defined from vm1.xml

      Then attach the virtio-mem device with --config, we could get successful result:

       # virsh attach-device vm1 mem.xml --config
      Device attached successfully 

       

            [RHEL-15480] Fail to attach virtio-mem device to persistent guest config without memory slot

            Errata Tool added a comment -

            Since the problem described in this issue should be resolved in a recent advisory, it has been closed.

            For information on the advisory (Moderate: libvirt security 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/RHSA-2024:2236

            Errata Tool added a comment - Since the problem described in this issue should be resolved in a recent advisory, it has been closed. For information on the advisory (Moderate: libvirt security 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/RHSA-2024:2236

            The 'blocked by' issue RHEL-15267 is transitioned to Release Pending.

            RHEL Jira bot added a comment - The 'blocked by' issue RHEL-15267 is transitioned to Release Pending.

            Liang Cong added a comment - - edited

            Verified on build:

            # rpm -q libvirt
            libvirt-10.0.0-2.el9.x86_64

             

            Verify steps:

            1. Define a guest with below config xml:

            <maxMemory unit='KiB'>10485760</maxMemory>
            <memory unit='KiB'>2097152</memory>
            <currentMemory unit='KiB'>2097152</currentMemory>

            2. Prepare a virtio-mem device with below config xml:

            # cat mem.xml
            <memory model='virtio-mem'>
            <source>
            <pagesize unit='KiB'>2048</pagesize>
            <nodemask>0</nodemask>
            </source>
            <target>
            <size unit='MiB'>512</size>
            <node>0</node>
            <block unit='KiB'>2048</block>
            <requested unit='MiB'>256</requested>
            <address base="0x100000000"/>
            </target>
            </memory>

            3. Attach the virtio-mem device from step2:

            # virsh attach-device vm1 mem.xml --config
            Device attached successfully

            Also tested with dimm and nvdimm memory devices
             

            Liang Cong added a comment - - edited Verified on build: # rpm -q libvirt libvirt-10.0.0-2.el9.x86_64   Verify steps: 1. Define a guest with below config xml: <maxMemory unit='KiB'>10485760</maxMemory> <memory unit='KiB'>2097152</memory> <currentMemory unit='KiB'>2097152</currentMemory> 2. Prepare a virtio-mem device with below config xml: # cat mem.xml <memory model='virtio-mem'> <source> <pagesize unit='KiB'>2048</pagesize> <nodemask>0</nodemask> </source> <target> <size unit='MiB'>512</size> <node>0</node> <block unit='KiB'>2048</block> <requested unit='MiB'>256</requested> <address base="0x100000000"/> </target> </memory> 3. Attach the virtio-mem device from step2: # virsh attach-device vm1 mem.xml --config Device attached successfully Also tested with dimm and nvdimm memory devices  

            Liang Cong added a comment -

            Pre-verified on upstream libvirt build v10.0.0-17-g3a45455558

            Verify steps:

            1. Define a guest with below config xml:

            <maxMemory unit="KiB">15243264</maxMemory>
            <memory unit="KiB">2097152</memory>
            <currentMemory unit="KiB">2097152</currentMemory>

            ...

            <numa>
                  <cell id="0" cpus="0,2" memory="1048576" unit="KiB"/>
                  <cell id="1" cpus="1" memory="1048576" unit="KiB"/>
            </numa>

            2. Prepare a virtio-mem device with below config xml:

             # cat mem.xml 
            <memory model='virtio-mem'> 
              <target> 
                <size unit='MiB'>512</size> 
                <block unit='KiB'>2048</block>
                <requested unit='MiB'>512</requested> 
                <node>0</node>
              </target> 
            </memory>

            3. Attach the virtio-mem device from step2:

             # virsh attach-device vm1 mem.xml --config
            Device attached successfully

             

            Also tested with dimm and nvdimm memory devices

            Liang Cong added a comment - Pre-verified on upstream libvirt build v10.0.0-17-g3a45455558 Verify steps: 1. Define a guest with below config xml: <maxMemory unit="KiB">15243264</maxMemory> <memory unit="KiB">2097152</memory> <currentMemory unit="KiB">2097152</currentMemory> ... <numa>       <cell id="0" cpus="0,2" memory="1048576" unit="KiB"/>       <cell id="1" cpus="1" memory="1048576" unit="KiB"/> </numa> 2. Prepare a virtio-mem device with below config xml:  # cat mem.xml  <memory model='virtio-mem'>    <target>      <size unit='MiB'>512</size>      <block unit='KiB'>2048</block>     <requested unit='MiB'>512</requested>      <node>0</node>   </target>  </memory> 3. Attach the virtio-mem device from step2:  # virsh attach-device vm1 mem.xml --config Device attached successfully   Also tested with dimm and nvdimm memory devices

            gitlab-bot added a comment -

            Jiri Denemark mentioned this issue in a commit of Red Hat / centos-stream / rpms / libvirt on branch c9s:

            libvirt-10.0.0-1.el9

            gitlab-bot added a comment - Jiri Denemark mentioned this issue in a commit of Red Hat / centos-stream / rpms / libvirt on branch c9s : libvirt-10.0.0-1.el9

            gitlab-bot added a comment -

            Jiri Denemark mentioned this issue in a merge request of Red Hat / centos-stream / rpms / libvirt on branch libvirt-10.0.0-1.el9:

            libvirt-10.0.0-1.el9

            gitlab-bot added a comment - Jiri Denemark mentioned this issue in a merge request of Red Hat / centos-stream / rpms / libvirt on branch libvirt-10.0.0-1.el9 : libvirt-10.0.0-1.el9

            Merged upstream as:

            cab49d394f  qemu: Relax check for memory device coldplug
            b41f730c33 qemu: Move memory device coldplug into a separate function

            Michal Privoznik added a comment - Merged upstream as: cab49d394f  qemu: Relax check for memory device coldplug b41f730c33 qemu: Move memory device coldplug into a separate function

            Michal Privoznik added a comment - Patches posted on the list: https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/XXIMHF5AUKBL4GOPKNRAPXEP7UASPRZD/

              mprivozn@redhat.com Michal Privoznik
              lcong@redhat.com Liang Cong
              Michal Privoznik Michal Privoznik
              Liang Cong Liang Cong
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: