Bug 2003071

Summary: qemu-kvm scsi: change default passthrough timeout to non-infinite [rhel-8.6.0]
Product: Red Hat Enterprise Linux 8 Reporter: RHEL Program Management Team <pgm-rhel-tools>
Component: qemu-kvmAssignee: Paolo Bonzini <pbonzini>
qemu-kvm sub component: virtio-blk,scsi QA Contact: qing.wang <qinwang>
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: urgent CC: chorn, cnagarka, coli, darren.lavender, gveitmic, jinzhao, juzhang, kkiwi, knoel, lmiksik, pbonzini, qinwang, rick.beldin, virt-maint
Version: 8.4Keywords: TestOnly, Triaged, ZStream
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: qemu-kvm-6.1.0-1.module+el8.6.0+12648+6ede71a5 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1994041
: 2004334 (view as bug list) Environment:
Last Closed: 2022-05-10 13:21:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1994041    
Bug Blocks: 2004334    

Comment 1 qing.wang 2021-09-23 08:48:41 UTC
Passed on


Red Hat Enterprise Linux release 8.6 Beta (Ootpa)
4.18.0-343.el8.x86_64
qemu-kvm-6.1.0-1.module+el8.6.0+12648+6ede71a5.x86_64
seabios-bin-1.14.0-1.module+el8.6.0+12648+6ede71a5.noarch



1.create scsi_debug disk 128 on iscsi server
modprobe scsi_debug  dev_size_mb=128

2.create mapper device with 10 minutes delay on the disk
dmsetup create test << EOF
0 160000 linear /dev/sdd 0
160000 5 delay /dev/sdd 0 0 /dev/sdd 0 600000
160005 80000 linear /dev/sdd 160005
EOF

3.expose mapper device with iscsi target
o- / ...................................................................................... [...]
  o- backstores ........................................................................... [...]
  | o- block ............................................................... [Storage Objects: 1]
  | | o- disk0 ............................... [/dev/mapper/test (117.2MiB) write-thru activated]
  | |   o- alua ................................................................ [ALUA Groups: 1]
  | |     o- default_tg_pt_gp .................................... [ALUA state: Active/optimized]
  | o- fileio .............................................................. [Storage Objects: 0]
  | o- pscsi ............................................................... [Storage Objects: 0]
  | o- ramdisk ............................................................. [Storage Objects: 0]
  o- iscsi ......................................................................... [Targets: 1]
  | o- iqn.2016-06.one.server:block ................................................... [TPGs: 1]
  |   o- tpg1 ............................................................ [no-gen-acls, no-auth]
  |     o- acls ....................................................................... [ACLs: 2]
  |     | o- iqn.1994-05.com.redhat:clienta .................................... [Mapped LUNs: 1]
  |     | | o- mapped_lun0 .............................................. [lun0 block/disk0 (rw)]
  |     | o- iqn.1994-05.com.redhat:clientb .................................... [Mapped LUNs: 1]
  |     |   o- mapped_lun0 .............................................. [lun0 block/disk0 (rw)]
  |     o- luns ....................................................................... [LUNs: 1]
  |     | o- lun0 ........................... [block/disk0 (/dev/mapper/test) (default_tg_pt_gp)]
  |     o- portals ................................................................. [Portals: 1]
  |       o- 0.0.0.0:3260 .................................................................. [OK]
  o- loopback ...................................................................... [Targets: 0]

4. attach disk on [other] host

iscsiadm -m discovery -t st -p dell7
iscsiadm -m node -T iqn.2016-06.one.server:block  -p dell7:3260 -l

root@dell-per6515-03 /home/vbugs/bug/1994041 $ lsblk 
NAME                            MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
...
sdb                               8:16   0 117.2M  0 disk 


5.boot vm with passthrough disk

/usr/libexec/qemu-kvm \
  -name testvm \
  -machine pc \
  -m 8G \
  -smp 8 \
  -cpu host,+kvm_pv_unhalt \
  -device ich9-usb-ehci1,id=usb1 \
  -device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1 \
  -device virtio-scsi-pci,id=scsi0,bus=pci.0,addr=0xa \
  -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x6 \
  -blockdev driver=qcow2,file.driver=file,file.filename=/home/kvm_autotest_root/images/rhel840-64-virtio-scsi.qcow2,node-name=os_image1   \
  -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x7,drive=os_image1,id=virtio-disk0,bootindex=1 \
  \
  -blockdev driver=raw,file.driver=host_device,file.filename=/dev/sdb,node-name=data1   \
  -device scsi-block,bus=scsi0.0,drive=data1,id=disk1,bootindex=2 \
  \
  -vnc :5 \
  -qmp tcp:0:5955,server,nowait \
  -monitor stdio \
  -netdev \
  tap,id=hostnet0,vhost=on \
  -device virtio-net-pci,netdev=hostnet0,id=net0,mac=52:54:00:dd:0a:82,bus=pci.0


6. execute io on guest and step in low speed write status

dev=sda
if [ "x$1" != "x" ];then
dev=$1
fi
echo "$dev"
while true;do
sg_dd if=/dev/zero of=/dev/$dev bs=1M count=100 oflag=direct
echo "do dd"
done

7.find the qemu process and kill it
pid=`pgrep qemu-kvm`;echo $pid;  kill -9 $pid
time while true;do if ps $pid; then sleep 10;echo "active";else echo "exit";break;fi done


8.the real kill time is about 3 minutes

Comment 6 errata-xmlrpc 2022-05-10 13:21:40 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: virt:rhel and virt-devel:rhel security, bug fix, and enhancement 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-2022:1759