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

Error msg may get confused when hot-unplugging none 0 current size virtio-mem device

    • Normal
    • sst_virtualization
    • ssg_virtualization
    • 17
    • 3
    • QE ack, Dev ack
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • None

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

      Please provide the package NVR for which bug is seen:

       

      # rpm -q libvirt qemu-kvm
      libvirt-10.0.0-6.1.el9_4.x86_64
      qemu-kvm-8.2.0-11.el9_4.x86_64
      

      How reproducible:

      100%

      Steps to reproduce

      1. Start a vm with virtio-mem device like below:

      <memory model="virtio-mem">
            <target>
              <size unit="KiB">262144</size>
              <node>0</node>
              <block unit="KiB">2048</block>
              <requested unit="KiB">262144</requested>
            </target>
      </memory>

      2. Check the running guest virtio-mem device config xml and the current-size is not 0:

       

      # virsh dumpxml vm1
      ... 
      <memory model='virtio-mem'>
            <target>
              <size unit='KiB'>262144</size>
              <node>0</node>
              <block unit='KiB'>2048</block>
              <requested unit='KiB'>262144</requested>
              <current unit='KiB'>262144</current>
              <address base='0x100000000'/>
            </target>
            <alias name='virtiomem0'/>
            <address type='pci' domain='0x0000' bus='0x07' slot='0x00' function='0x0'/>
          </memory>
      

       

       

      3. Hot-unplug the virtio-mem deivce with below config xml:

      # cat vmem.xml 
      <memory model='virtio-mem'>
            <target>
              <size unit='KiB'>262144</size>
              <node>0</node>
              <block unit='KiB'>2048</block>
              <requested unit='KiB'>262144</requested>
              <address base='0x100000000'/>
            </target>
          </memory>

      4. Error msg occurs like below:

      # virsh detach-device vm1 vmem.xml 
      error: Failed to detach device from vmem.xml
      error: internal error: unable to execute QEMU command 'device_del': virtio-mem device cannot get unplugged while 'size' != '0'

      Expected results

      Error msg mentioned 'size' != '0', 'size' suggests changing to 'current-size'. Otherwise the user may confuse the 'size' with the config <size unit="KiB">262144</size>

      Actual results

      Error msg like below:

      error: internal error: unable to execute QEMU command 'device_del': virtio-mem device cannot get unplugged while 'size' != '0'

       

       

            dhildenb@redhat.com David Hildenbrand
            lcong@redhat.com Liang Cong
            virt-maint virt-maint
            Liping Cheng Liping Cheng
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated: