Bug 1328715 - physical_block_size in guest (Linux) is not same as specified in qemu-kvm command
Summary: physical_block_size in guest (Linux) is not same as specified in qemu-kvm com...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm-rhev
Version: 7.3
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Paolo Bonzini
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-20 07:02 UTC by yduan
Modified: 2016-07-15 07:15 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-15 07:15:38 UTC
Target Upstream Version:


Attachments (Terms of Use)

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.


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