Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1631213

Summary: can not boot up guest with scsi-generic device via -blockdev
Product: Red Hat Enterprise Linux 7 Reporter: Xueqiang Wei <xuwei>
Component: qemu-kvm-rhevAssignee: Kevin Wolf <kwolf>
Status: CLOSED DUPLICATE QA Contact: Xueqiang Wei <xuwei>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.6CC: aliang, chayang, coli, juzhang, kwolf, michen, phou, virt-maint, yhong
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1643351 (view as bug list) Environment:
Last Closed: 2018-12-12 16:08:22 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:
Embargoed:
Bug Depends On:    
Bug Blocks: 1643351    

Description Xueqiang Wei 2018-09-20 08:50:13 UTC
Description of problem:

Can not boot up guest with scsi-generic device via -blockdev

QEMU 2.12.0 monitor - type 'help' for more information
(qemu) qemu-kvm: -device scsi-generic,drive=drive2,id=data-disk1,bus=scsi1.0: Device doesn't support drive option werror



Version-Release number of selected component (if applicable):

kernel-3.10.0-949.el7.x86_64
qemu-kvm-rhev-2.12.0-16.el7



How reproducible:
100%


Steps to Reproduce:

1. display mapping SCSI devices on host.
# sg_map
/dev/sg0  /dev/sr0
/dev/sg1  /dev/sda
/dev/sg2
/dev/sg3  /dev/sdb
/dev/sg4  /dev/sdc
/dev/sg5  /dev/sdd
/dev/sg6  /dev/sde

2. boot guest with scsi-generic via -blockdev
/usr/libexec/qemu-kvm \
    -S  \
    -name 'avocado-vt-vm1'  \
    -sandbox off  \
    -machine pc  \
    -nodefaults \
    -device VGA,bus=pci.0,addr=0x2  \
    -chardev socket,id=qmp_id_qmpmonitor1,path=/var/tmp/avocado_nCcZP2/monitor-qmpmonitor1-20180912-022419-cHHd8c59,server,nowait \
    -mon chardev=qmp_id_qmpmonitor1,mode=control  \
    -chardev socket,id=qmp_id_catch_monitor,path=/var/tmp/avocado_nCcZP2/monitor-catch_monitor-20180912-022419-cHHd8c59,server,nowait \
    -mon chardev=qmp_id_catch_monitor,mode=control \
    -device pvpanic,ioport=0x505,id=idQpDEaT  \
    -chardev socket,id=serial_id_serial0,path=/var/tmp/avocado_nCcZP2/serial-serial0-20180912-022419-cHHd8c59,server,nowait \
    -device isa-serial,chardev=serial_id_serial0  \
    -chardev socket,id=seabioslog_id_20180912-022419-cHHd8c59,path=/var/tmp/avocado_nCcZP2/seabios-20180912-022419-cHHd8c59,server,nowait \
    -device isa-debugcon,chardev=seabioslog_id_20180912-022419-cHHd8c59,iobase=0x402 \
    -device nec-usb-xhci,id=usb1,bus=pci.0,addr=0x3 \
    -device virtio-scsi-pci,id=virtio_scsi_pci0,bus=pci.0,addr=0x4 \
    -blockdev driver=file,cache.direct=off,cache.no-flush=on,filename=/home/rhel76-64-virtio-scsi.qcow2,node-name=my_file \
    -blockdev driver=qcow2,node-name=my,file=my_file \
    -device scsi-hd,drive=my,bus=virtio_scsi_pci0.0 \
    -device virtio-net-pci,mac=9a:ad:ae:af:b0:b1,id=id942Wof,vectors=4,netdev=idirzdj4,bus=pci.0,addr=0x5  \
    -netdev tap,id=idirzdj4,vhost=on \
    -m 2G  \
    -smp 4,maxcpus=4,cores=2,threads=1,sockets=2  \
    -cpu 'SandyBridge',+kvm_pv_unhalt \
    -device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1  \
    -vnc :0  \
    -rtc base=utc,clock=host,driftfix=slew  \
    -boot menu=off,strict=off,order=cdn,once=d  \
    -enable-kvm \
    -monitor stdio \
    -qmp tcp:0:4444,server,nowait \
    -device virtio-scsi-pci,id=scsi1,bus=pci.0,addr=0x6 \
    -blockdev driver=raw,file.driver=host_device,cache.direct=off,cache.no-flush=on,file.filename=/dev/sg6,node-name=drive2 \
    -device scsi-generic,drive=drive2,id=data-disk1,bus=scsi1.0 \
    
   
Actual results:
after step 2,
QEMU 2.12.0 monitor - type 'help' for more information
(qemu) qemu-kvm: -device scsi-generic,drive=drive2,id=data-disk1,bus=scsi1.0: Device doesn't support drive option werror


Expected results:
Guest boot up normally.
If it doesn't support, the hint information is not clear.


Additional info:

Also hit this issue on RHEL7.5
kernel-3.10.0-862.14.3.el7.x86_64
qemu-kvm-rhev-2.10.0-21.el7_5.7


Guest can boot up normally with scsi-block device via -blockdev

-device virtio-scsi-pci,id=scsi1,bus=pci.0,addr=0x6 \
-blockdev driver=raw,file.driver=host_device,cache.direct=off,cache.no-flush=on,file.filename=/dev/sde,node-name=drive2 \
-device scsi-block,drive=drive2,id=data-disk1,bus=scsi1.0 \



Guest can boot up normally with scsi-generic device via drive

-device virtio-scsi-pci,id=bus1,bus=pci.0 \
-drive file=/dev/sg6,if=none,format=raw,snapshot=off,aio=threads,cache=writethrough,id=scsi-disk0 \
-device scsi-generic,bus=bus1.0,drive=scsi-disk0,id=disk \

Comment 2 Fam Zheng 2018-10-30 09:16:38 UTC
Reassigning to Kevin since this is more -blockdev related.

Comment 3 Kevin Wolf 2018-10-30 17:23:02 UTC
This is fixed with upstream commit cb53460b70 ('block-backend: Set werror/rerror defaults in blk_new()').

Comment 4 Kevin Wolf 2018-12-12 16:08:22 UTC
The symptoms are a bit different but ultimately this is because the default values for werror/rerror are not applied correctly, and then QEMU complains that non-default values were used. The incorrect application of defaults is dealt with in bug 1631615.

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