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 1328715

Summary: physical_block_size in guest (Linux) is not same as specified in qemu-kvm command
Product: Red Hat Enterprise Linux 7 Reporter: yduan
Component: qemu-kvm-rhevAssignee: Paolo Bonzini <pbonzini>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3CC: chayang, famz, huding, juzhang, knoel, pbonzini, virt-maint
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-15 07:15:38 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:

Description yduan 2016-04-20 07:02:29 UTC
Description of problem:
  physical_block_size in guest (Linux) is not same as qemu-kvm command when specifies physical_block_size=512 and logical_block_size=4096 in command line.

Version-Release number of selected component (if applicable):
Host:
  kernel: 3.10.0-382.el7.x86_64
  qemu-kvm-rhev: qemu-kvm-rhev-2.5.0-4.el7.x86_64
Guest:
  kernel: 3.10.0-382.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Start a VM by using following command:
 ...
 -device virtio-scsi-pci,id=scsi_pci_bus0 \
 -drive file=/dev/sdb,format=qcow2,id=drive_sysdisk,if=none,cache=none,aio=native,werror=stop,rerror=stop \
 -device scsi-hd,drive=drive_sysdisk,bus=scsi_pci_bus0.0,id=device_sysdisk,bootindex=0 \
 -device virtio-scsi-pci,id=scsi_pci_bus1 \
 -drive file=/home/scsi_test1/datadisk1.qcow2,format=qcow2,id=drive_datadisk1,if=none,cache=none,werror=stop,rerror=stop \
 -device scsi-hd,drive=drive_datadisk1,bus=scsi_pci_bus1.0,id=device_datadisk1,physical_block_size=512,logical_block_size=4096 \
 ...
2.info qtree
  ...
  bus: scsi_pci_bus1.0
              type SCSI
              dev: scsi-hd, id "device_datadisk1"
                drive = "drive_datadisk1"
                logical_block_size = 4096 (0x1000)
                physical_block_size = 512 (0x200)
  ...
3.In guest:
#cat /sys/block/sdb/queue/physical_block_size
4096
#cat /sys/block/sdb/queue/logical_block_size
4096

Actual results:
#cat /sys/block/sdb/queue/physical_block_size
4096
#cat /sys/block/sdb/queue/logical_block_size
4096

Expected results:
#cat /sys/block/sdb/queue/physical_block_size
512
#cat /sys/block/sdb/queue/logical_block_size
4096

Additional info:

Comment 2 yduan 2016-04-20 08:14:21 UTC
Reproducible with qemu-kvm-rhev-2.3.0-31.el7_2.12.x86_64

Comment 3 Kevin Wolf 2016-06-21 16:05:21 UTC
This is expected. SCSI allows physical block sizes that are smaller than the
logical block size, but it reports them as if the physical block size was the
same as the logical block size. (See READ CAPACITY (16) spec)

I'm reassigning this to Paolo to decide whether to close this as NOTABUG, or
whether we should error out if such a configuration is requested in qemu. Strictly
speaking it is a valid configuration even though it doesn't make a lot of sense.