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 1134670 - fail to specify the physical_block_size/logical_block_size value not 512 for IDE disk
Summary: fail to specify the physical_block_size/logical_block_size value not 512 for ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm
Version: 7.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Kevin Wolf
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 1134693
TreeView+ depends on / blocked
 
Reported: 2014-08-28 04:31 UTC by Sibiao Luo
Modified: 2015-11-19 04:52 UTC (History)
13 users (show)

Fixed In Version: qemu-kvm-1.5.3-101.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1134693 (view as bug list)
Environment:
Last Closed: 2015-11-19 04:52:59 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2213 0 normal SHIPPED_LIVE qemu-kvm bug fix and enhancement update 2015-11-19 08:16:10 UTC

Description Sibiao Luo 2014-08-28 04:31:24 UTC
Description of problem:
fail to specify the physical_block_size/logical_block_size=1024|2048... for IDE disk, check the value in guest which is 512 all the time.

Version-Release number of selected component (if applicable):
host info:
# uname -r && rpm -q qemu-kvm-rhev && rpm -q seabios
3.10.0-145.el7.x86_64
qemu-kvm-rhev-1.5.3-60.el7ev.x86_64
seabios-1.7.5-4.el7.x86_64
guest info:
rhel: 3.10.0-145.el7.x86_64
windows: win2012-R2
virtio-win-prewhql-0.1-89

How reproducible:
100%

Steps to Reproduce:
1.launch a KVM guest with physical_block_size/logical_block_size=1024|2048 specified for IDE disk.
e.g.:...-drive file=/home/my-data-disk1.qcow2,if=none,id=drive-data-disk1,format=qcow2,cache=none,aio=native -device ide-hd,drive=drive-data-disk1,id=data-disk1,bus=ide.0,unit=0,physical_block_size=1024,logical_block_size=1024
2.login guest and check the physical_block_size/logical_block_size value.
# cat /sys/block/sda/queue/logical_block_size
# cat /sys/block/sda/queue/physical_block_size

Actual results:
after step 2, it was not the value specified in qemu-kvm commandline.
- for rhel guest:
# cat /sys/block/sda/queue/logical_block_size 
512
# cat /sys/block/sda/queue/physical_block_size 
512
- for windows guest:
C:\Windows\system32>fsutil fsinfo ntfsinfo D:
NTFS Volume Serial Number :       0xbc70d39970d3592a
NTFS Version   :                  3.1
LFS Version    :                  2.0
Number Sectors :                  0x00000000009fe7ff
Total Clusters :                  0x000000000013fcff
Free Clusters  :                  0x000000000013c27f
Total Reserved :                  0x0000000000000000
Bytes Per Sector  :               512       <-----------logical block size
Bytes Per Physical Sector :       512       <-----------physical block size
Bytes Per Cluster :               4096
Bytes Per FileRecord Segment    : 1024
Clusters Per FileRecord Segment : 0
Mft Valid Data Length :           0x0000000000040000
Mft Start Lcn  :                  0x0000000000040000
Mft2 Start Lcn :                  0x0000000000000002
Mft Zone Start :                  0x0000000000040040
Mft Zone End   :                  0x000000000004c840
Resource Manager Identifier :     7C9FE2F6-2E41-11E4-8B47-A304308EAA2B

Expected results:
It should the same values as specified(1024) in qemu-kvm command line.

Additional info:

Comment 1 Kevin Wolf 2014-12-10 15:13:32 UTC
The command line is not correct, our IDE emulation doesn't support logical block
sizes other than 512. Using a different one happens to also the affect the
exposed physical block size.

I sent a patch upstream to catch this ('ide: Check validity of logical block
size') and unless the pull request is rejected, this is going to become commit
d2005185.

Comment 4 Miroslav Rezanina 2015-08-14 18:03:59 UTC
Fix included in qemu-kvm-1.5.3-101.el7

Comment 6 mazhang 2015-08-24 09:23:27 UTC
Reproduced this bug on qemu-kvm-1.5.3-100.el7.x86_64

Host:
qemu-kvm-1.5.3-100.el7.x86_64

Guest:
3.10.0-308.el7.x86_64

Command line:
-drive file=/home/rhel7.2-64.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,cache=none,werror=stop,rerror=stop,aio=threads \
-device virtio-blk-pci,scsi=off,bus=pci.0,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1 \
-drive file=/home/my-data-disk1.qcow2,if=none,id=drive-data-disk1,format=qcow2,cache=none,aio=native \
-device ide-hd,drive=drive-data-disk1,id=data-disk1,bus=ide.0,unit=0,physical_block_size=1024,logical_block_size=1024 \


Result:
Both physical_block_size and logical_block_size is 512.

[root@dhcp-10-70 ~]# cat /sys/block/sda/queue/physical_block_size
512
[root@dhcp-10-70 ~]# cat /sys/block/sda/queue/logical_block_size
512


Verified this bug on qemu-kvm-1.5.3-101.el7.x86_64.

Result:
qemu-kvm quit with warning.

QEMU 1.5.3 monitor - type 'help' for more information
(qemu) qemu-kvm: -device ide-hd,drive=drive-data-disk1,id=data-disk1,bus=ide.0,unit=0,physical_block_size=1024,logical_block_size=1024: logical_block_size must be 512 for IDE
qemu-kvm: -device ide-hd,drive=drive-data-disk1,id=data-disk1,bus=ide.0,unit=0,physical_block_size=1024,logical_block_size=1024: Device initialization failed.
qemu-kvm: -device ide-hd,drive=drive-data-disk1,id=data-disk1,bus=ide.0,unit=0,physical_block_size=1024,logical_block_size=1024: Device 'ide-hd' could not be initialized


So this bug has been fixed.

Comment 8 errata-xmlrpc 2015-11-19 04:52:59 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, 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://rhn.redhat.com/errata/RHBA-2015-2213.html


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