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-virtualization
    • 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 

       

              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: