Bug 1021544

Summary: fail to do block_resize for passthrough iSCSI LUN via scsi-block interface
Product: Red Hat Enterprise Linux 7 Reporter: Sibiao Luo <sluo>
Component: qemu-kvmAssignee: Virtualization Maintenance <virt-maint>
Status: CLOSED CANTFIX QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 7.0CC: acathrow, bsarathy, chayang, juzhang, michen, mkenneth, pbonzini, qzhang, virt-maint, xfu
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1021540 Environment:
Last Closed: 2013-10-24 23:08:15 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:
Bug Depends On: 1021540    
Bug Blocks:    

Comment 1 Sibiao Luo 2013-10-21 13:34:20 UTC
host info:
# uname -r && rpm -q qemu-kvm
3.10.0-34.el7.x86_64
qemu-kvm-1.5.3-9.el7.x86_64

iSCSI LUN:
# fdisk /dev/sdb

Disk /dev/sdb: 32.2 GB, 32212254720 bytes, 62914560 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0xc09bd2e5

e.g:...-drive file=/dev/sdb,if=none,id=drive-data-disk,format=raw,aio=native -device virtio-scsi-pci,bus=pci.0,addr=0x7,id=scsi0 -device scsi-block,drive=drive-data-disk,id=data-disk,bus=scsi0.0 -vnc :1 -monitor stdio
QEMU 1.5.3 monitor - type 'help' for more information
(qemu) info block
drive-data-disk: removable=0 io-status=ok file=/dev/sdb ro=0 drv=raw encrypted=0 bps=0 bps_rd=0 bps_wr=0 iops=0 iops_rd=0 iops_wr=0
ide1-cd0: removable=1 locked=0 tray-open=0 io-status=ok [not inserted]
floppy0: removable=1 locked=0 tray-open=0 [not inserted]
sd0: removable=1 locked=0 tray-open=0 [not inserted]
(qemu) block_resize drive-data-disk 10G
(qemu) block_resize drive-data-disk 20G
(qemu) block_resize drive-data-disk 30G
(qemu) block_resize drive-data-disk 40G
Could not resize: Invalid argument

But checked that there was no any info about disk changes in guest.

Best Regards,
sluo

Comment 3 Paolo Bonzini 2013-10-24 23:08:15 UTC
This is expected behavior.  Because the capacity is retrieved directly from the disk, block_resize cannot change it (there is no "resize" SCSI command to send to the disk).  "Do not shrink" is safe but "do not enlarge" is unsafe, so QEMU is simply checking that you are not asking for more space than allowed.