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

The cache mode on lun device in libvirt xml is not applied on qemu command line

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

    • No
    • Important
    • rhel-virt-core-libvirt-2
    • ssg_virtualization
    • None
    • False
    • False
    • Hide

      None

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

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

      Set cache mode on lun block device in XML, the qemu command line of VM does not apply the cache mode.

      What is the impact of this issue to you?

      RHEL-86543 [DEV Task]: [QEMU] Retry SG_IO on error with multipath failover group policy

      It needs to set the cache.direct=on on the blockdev node,example

      -blockdev driver=host_device,filename=/dev/mapper/mpatha,cache.direct=on,node-name=drive_disk,pr-manager=helper0 \
      -blockdev driver=raw,node-name=host_disk,file=drive_disk \
      -device scsi-block,bus=scsi1.0,drive=host_disk,id=scsi0-0-0-0

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

      Red Hat Enterprise Linux release 9.5 (Plow)
      5.14.0-427.13.1.el9_4.x86_64
      device-mapper-1.02.198-2.el9.x86_64
      device-mapper-multipath-0.8.7-32.el9.x86_64
      qemu-kvm-9.0.0-10.el9_5.2.x86_64
      seabios-bin-1.16.3-2.el9_5.1.noarch
      edk2-ovmf-20240524-6.el9_5.3.noarch
      libvirt-10.5.0-7.5.el9_5.x86_64

      How reproducible is this bug?:

      100%

      Steps to reproduce

      1. vm XML
      <disk type="block" device="lun">
                  <driver name="qemu" type="raw" />
                  <source dev="/dev/sdc" />
                  <target dev="sdc" bus="scsi" />
              </disk>
              <!-- cache empty -->
              <disk type="block" device="lun" cache="default">
                  <driver name="qemu" type="raw" />
                  <source dev="/dev/sdd" />
                  <target dev="sdd" bus="scsi" />
              </disk>
              <!-- cache empty -->
              <disk type="block" device="lun" cache="none">
                  <driver name="qemu" type="raw" />
                  <source dev="/dev/sde" />
                  <target dev="sde" bus="scsi" />
              </disk>
              <!-- cache empty -->
              <disk type="block" device="lun" cache="directsync">
                  <driver name="qemu" type="raw" />
                  <source dev="/dev/sdf" />
                  <target dev="sdf" bus="scsi" />
              </disk>
              <!-- cache empty -->
              <disk type="block" device="lun" cache="writeback">
                  <driver name="qemu" type="raw" />
                  <source dev="/dev/sdg" />
                  <target dev="sdg" bus="scsi" />
              </disk>
              <!-- cache empty -->
              <disk type="block" device="lun" cache="writethrough">
                  <driver name="qemu" type="raw" />
                  <source dev="/dev/sdh" />
                  <target dev="sdh" bus="scsi" />
              </disk>
      
      1. Boot vm to check the qemu command line
      -blockdev {"driver":"host_device","filename":"/dev/sdc","node-name":"libvirt-6-storage","read-only":false} \
       -device {"driver":"scsi-block","bus":"scsi0.0","channel":0,"scsi-id":0,"lun":2,"drive":"libvirt-6-storage","id":"scsi0-0-0-2"} \
       -blockdev {"driver":"host_device","filename":"/dev/sdd","node-name":"libvirt-5-storage","read-only":false} \
       -device {"driver":"scsi-block","bus":"scsi0.0","channel":0,"scsi-id":0,"lun":3,"drive":"libvirt-5-storage","id":"scsi0-0-0-3"} \
       -blockdev {"driver":"host_device","filename":"/dev/sde","node-name":"libvirt-4-storage","read-only":false} \
       -device {"driver":"scsi-block","bus":"scsi0.0","channel":0,"scsi-id":0,"lun":4,"drive":"libvirt-4-storage","id":"scsi0-0-0-4"} \
       -blockdev {"driver":"host_device","filename":"/dev/sdf","node-name":"libvirt-3-storage","read-only":false} \
       -device {"driver":"scsi-block","bus":"scsi0.0","channel":0,"scsi-id":0,"lun":5,"drive":"libvirt-3-storage","id":"scsi0-0-0-5"} \
       -blockdev {"driver":"host_device","filename":"/dev/sdg","node-name":"libvirt-2-storage","read-only":false} \
       -device {"driver":"scsi-block","bus":"scsi0.0","channel":0,"scsi-id":0,"lun":6,"drive":"libvirt-2-storage","id":"scsi0-0-0-6"} \
       -blockdev {"driver":"host_device","filename":"/dev/sdh","node-name":"libvirt-1-storage","read-only":false} \
       -device {"driver":"scsi-block","bus":"scsi1.0","channel":0,"scsi-id":0,"lun":0,"drive":"libvirt-1-storage","id":"scsi1-0-0-0"} \
      
      

      Expected results

      the cache mode may apply to qemu command line

      Actual results

      no cache definition

              pkrempa@redhat.com Peter Krempa
              qingwangrh qing wang
              virt-maint virt-maint
              Meina Li Meina Li
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: