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

attached virtio disk witch iommu=on & interface is not detached in specific cases

Linking RHIVOS CVEs to...Migration: Automation ...RHELPRIO AssignedTeam ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • rhel-9.8, rhel-10.2
    • qemu-kvm
    • None
    • None
    • rhel-virt-hwe-arm-1
    • None
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • Unspecified
    • Unspecified
    • Unspecified
    • aarch64
    • None

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

      Detach virtio disk with iommu=on from VM (after there is also virtio interface attached) - depends on order of attach/detach

      this can be also tested by run: 

      https://libvirt-rhos-jenkins-product.hosted.upshift.rdu2.redhat.com/job/libvirt-RHEL-10.2-runtest-aarch64-function-viommu/11/testReport/rhel/vIOMMU/hotplug_device_with_iommu_enabled_pcie_downstream_port_from_expander_bus_virtio

      What is the impact of this issue to you?

      Disk & interface not detached, VM will not stop. and has to be destroyed

      Please provide the package NVR for which the bug is seen:

      kernel-5.14.0-643.el9.aarch64
      libvirt-11.9.0-1.el9.aarch64
      qemu-kvm-10.1.0-5.el9.aarch64

      How reproducible is this bug?:

      100%

      Steps to reproduce

      in separated terminal watch events:

      while true; do virsh event --loop --all --timestamp; sleep 1; done

      Steps:

       

      1. define & start vm based on attached xml, wait for start
      virsh define avocado.xml
      

      2. prepare image for disk:

      qemu-img create -f qcow2 /tmp/test.qcow2 200M 

      3.attach virtio disk
      virsh attach-device vm1 /tmp/dev_obj.xml

      <disk type="file" device="disk">
            <driver name="qemu" type="qcow2" iommu="on" />
            <source file="/tmp/test.qcow2" index="2" />
            <backingStore />
            <target dev="vdb" bus="virtio" />
            <alias name="virtio-disk1" />
            <address type="pci" domain="0x0000" bus="0x14" slot="0x00" function="0x0" />
          </disk>
       

      4. attach interface
      virsh attach-device vm1 /tmp/iface_obj.xml

      •  
      <interface type="network">
              <model type="virtio" />
              <driver name="vhost" iommu="on" />
              <source network="default" />
              <address type="pci" bus="0x13" />
      </interface>
      

      5. detach disk

      (optional ... detach iface, shutdown vm)

      Expected results:

      There is event triggered

      There is event triggered
      disk is detached and no more in the XML

      (if iface is detached - event is also there, iface no more in xml, and user is able to shutdown the VM

      Actual results

       no event
      disk still in xml
      (the iface will still in xml,
      and vm not shutdown)

      Additional information:

      • if the order is "nested" i.e.
         attach dev_obj,
         attach iface_obj,
         detach iface_obj,
         detach dev_obj, the behavior is correct
      • in the VM the lsblk after the device-detach will not show the vdb row
      • shutdown console info is in the shutdown.log file 
      • no error visible in virtqemud.log

      The test is not failing on x86_64

        1. virtqemud.log.gz
          463 kB
        2. shutdown.log
          8 kB
        3. iface_obj.xml
          0.2 kB
        4. dev_obj.xml
          0.4 kB
        5. avocado.xml
          10 kB

              virt-maint virt-maint
              rh-ee-hholoubk Hana Holoubkova
              virt-maint virt-maint
              virt-bugs virt-bugs
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: