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 1179577 - QEMU fail to do SG_IO INQUIRY checking when pass-through(scsi-block) a LVM to KVM guest
Summary: QEMU fail to do SG_IO INQUIRY checking when pass-through(scsi-block) a LVM to...
Keywords:
Status: CLOSED CANTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev
Version: 7.1
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Ademar Reis
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 1179578
TreeView+ depends on / blocked
 
Reported: 2015-01-07 06:59 UTC by Sibiao Luo
Modified: 2015-01-08 18:14 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1179578 (view as bug list)
Environment:
Last Closed: 2015-01-08 18:14:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Sibiao Luo 2015-01-07 06:59:13 UTC
Description of problem:
as subject, QEMU fail to do SG_IO INQUIRY checking when pass-through(scsi-block) a LV to KVM guest. LVM is not SCSI device which should not be pass-through to KVM guest.

Version-Release number of selected component (if applicable):
host info:
# uname -r && rpm -q qemu-kvm
3.10.0-220.el7.x86_64
qemu-kvm-rhev-2.1.2-17.el7.x86_64
guest info:
# uname -r
3.10.0-220.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.create a LVM in guest.
# lvscan | grep lv
  ACTIVE            '/dev/vg/lv' [10.00 GiB] inherit

2.pass-through(scsi-block) a LVM to KVM guest.
e.g: # /usr/libexec/qemu-kvm -M pc -cpu Opteron_G2 -enable-kvm -m 2048 -smp 2,sockets=2,cores=1,threads=1 -no-kvm-pit-reinjection -drive file=/dev/vg/lv,if=none,id=drive-data-disk,format=raw,cache=none,aio=native -device virtio-scsi-pci,bus=pci.0,addr=0x7,id=scsi0,ioeventfd=on -device scsi-block,drive=drive-data-disk,id=data-disk,bus=scsi0.0...

Actual results:
after step 2, it can boot up successfully and the LVM work well in guest.

Expected results:
QEMU should reject to pass-through a LVM to KVM guest, like:
(qemu) qemu-kvm: -device scsi-block,drive=drive-data-disk,id=data-disk,bus=scsi0.0: cannot get SG_IO version number: Operation not supported.  Is this a SCSI device?
qemu-kvm: -device scsi-block,drive=drive-data-disk,id=data-disk,bus=scsi0.0: Device initialization failed.
qemu-kvm: -device scsi-block,drive=drive-data-disk,id=data-disk,bus=scsi0.0: Device 'scsi-block' could not be initialized

Additional info:
rhel6.x did not hit this issue, just rhel7 hit it.
for rhel6.x prompting example:
qemu-kvm: -device scsi-block,drive=drive-data-disk,id=data-disk,bus=scsi0.0: scsi-block: INQUIRY failed
qemu-kvm: -device scsi-block,drive=drive-data-disk,id=data-disk,bus=scsi0.0: Device 'scsi-block' could not be initialized

Comment 1 Paolo Bonzini 2015-01-08 18:14:55 UTC
This is unfortunately expected behavior when CAP_SYS_RAWIO is valid.  The patch that was applied to RHEL6 was rejected upstream and is not in RHEL7.  Example:

# capsh --drop=cap_sys_rawio -- -c '/usr/libexec/qemu-kvm -M pc -enable-kvm -m 2048 -smp 2 -drive file=/dev/vg-root/rhel5-x86-64,id=root,if=none -device virtio-scsi-pci -device scsi-block,drive=root -S'
qemu-kvm: -device scsi-block,drive=root: scsi-block: INQUIRY failed
qemu-kvm: -device scsi-block,drive=root: Device initialization failed.
qemu-kvm: -device scsi-block,drive=root: Device 'scsi-block' could not be initialized

(put the capsh command on a single line).


Note You need to log in before you can comment on or make changes to this bug.