Bug 1025342

Summary: scsi-generic should not flush the LUN on exit, unless targeting a disk or a CD-ROM LUN
Product: Red Hat Enterprise Linux 7 Reporter: Paolo Bonzini <pbonzini>
Component: qemu-kvmAssignee: Fam Zheng <famz>
Status: CLOSED DUPLICATE QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 7.0CC: acathrow, hhuang, juzhang, knoel, michen, pbonzini, sluo, virt-maint, xfu
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1020581 Environment:
Last Closed: 2014-04-04 07:01:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 1058173    
Bug Blocks:    

Description Paolo Bonzini 2013-10-31 14:09:38 UTC
+++ This bug was initially created as a clone of Bug #1020581 +++

Description of problem:
Using system_reset to reboot guest with libscisi(lun 0) via monitor. It will cause qemu-kvm core dump. The following is target infos in host.  

# tgtadm --lld iscsi --op show --mode target
Target 1: libscisi-test
    System information:
        Driver: iscsi
        State: ready
    I_T nexus information:
        I_T nexus: 45
            Initiator: iqn.2008-11.org.linux-kvm
            Connection: 0
                IP Address: 10.66.106.31
    LUN information:
        LUN: 0
            Type: controller
            SCSI ID: IET     00010000
            SCSI SN: beaf10
            Size: 0 MB, Block size: 1
            Online: Yes
            Removable media: No
            Prevent removal: No
            Readonly: No
            Backing store type: null
            Backing store path: None
            Backing store flags: 
        LUN: 1
            Type: disk
            SCSI ID: IET     00010001
            SCSI SN: beaf11
            Size: 215214 MB, Block size: 512
            Online: Yes
            Removable media: No
            Prevent removal: No
            Readonly: No
            Backing store type: rdwr
            Backing store path: /dev/sda3
            Backing store flags: 
    Account information:
    ACL information:
        ALL


Version-Release number of selected component (if applicable):
qemu-kvm-1.5.3-9.el7.x86_64
3.10.0-35.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1./usr/libexec/qemu-kvm -vnc :3 -monitor stdio -drive file=iscsi://10.66.8.151:3260/libscisi-test/0,if=none,id=drive-disk -device virtio-scsi-pci,id=scsi1,bus=pci.0,addr=0x6 -device scsi-generic,drive=drive-disk,bus=scsi1.0,id=iscsi-disk

2.quit

Actual results:
qemu-system-x86_64: Failed to sync10 data on iSCSI lun. SENSE KEY:ILLEGAL_REQUEST(5) ASCQ:INVALID_OPERATION_CODE(0x2000)
qemu-system-x86_64: Failed to sync10 data on iSCSI lun. SENSE KEY:ILLEGAL_REQUEST(5) ASCQ:INVALID_OPERATION_CODE(0x2000)

Expected results:
no such message

Additional info:
create lun detailed steps:
#service tgtd start
#tgtadm --lld iscsi --op new --mode target --tid=1 --targetname libscisi-test
# tgtadm --lld iscsi --op show --mode target
# tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b /dev/sda3
# tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL

Comment 2 Fam Zheng 2014-04-04 07:01:14 UTC
Fix is included in https://bugzilla.redhat.com/show_bug.cgi?id=1083413, close as DUPLICATE.

*** This bug has been marked as a duplicate of bug 1083413 ***

Comment 3 Paolo Bonzini 2014-04-04 11:33:39 UTC
*** Bug 1078650 has been marked as a duplicate of this bug. ***