Hide Forgot
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:
Reproducible with qemu-kvm-rhev-2.3.0-31.el7_2.12.x86_64
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.