Hide Forgot
Description of problem: we can do block_resize to local file image via vritio-blk or virtio-scsi interface, but we fail to do block_resize for passthrough iSCSI LUN via scsi-block interface. QEMU should give disable message if not support block_resize with passthrough iSCSI LUN or make it works well. Version-Release number of selected component (if applicable): host info: # uname -r && rpm -q qemu-kvm 2.6.32-424.el6.x86_64 qemu-kvm-0.12.1.2-2.414.el6.x86_64 How reproducible: 100% Steps to Reproduce: 1.prepare a iSCSI LUN. # qemu-img info /dev/disk/by-path/ip-10.66.90.100\:3260-iscsi-iqn.2001-05.com.equallogic\:0-8a0906-0971f7d03-1dff49b26885073d-s2-sluo-172259-lun-0 image: /dev/disk/by-path/ip-10.66.90.100:3260-iscsi-iqn.2001-05.com.equallogic:0-8a0906-0971f7d03-1dff49b26885073d-s2-sluo-172259-lun-0 file format: raw virtual size: 100G (107379425280 bytes) disk size: 0 2.boot guest with SCSI LUN passthrough via scsi-block interface. e.g:...-drive file=/dev/disk/by-path/ip-10.66.90.100\:3260-iscsi-iqn.2001-05.com.equallogic\:0-8a0906-0971f7d03-1dff49b26885073d-s2-sluo-172259-lun-0,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 3.do block_resize with passthrough LUN. { "execute": "block_resize", "arguments": { "device": "drive-data-disk", "size":50000000000}} {"return": {}} guest] # fdisk -l /dev/sda Disk /dev/sda: 107.4 GB, 107379425280 bytes 255 heads, 63 sectors/track, 13054 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 { "execute": "block_resize", "arguments": { "device": "drive-data-disk", "size":100000000000}} {"return": {}} guest] guest] # fdisk -l /dev/sda Disk /dev/sda: 107.4 GB, 107379425280 bytes 255 heads, 63 sectors/track, 13054 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 {"execute": "block_resize", "arguments": { "device": "drive-data-disk", "size":50000000000000}} {"error": {"class": "UndefinedError", "desc": "An undefined error has ocurred", "data": {}}} Actual results: After step 3, excute block_resize to shink or enlarge successfully but fail to detect any changes in guest, no any message output in guest kernel log. And it will get 'An undefined error has ocurred' error message if enlarge the block size larger than iSCSI LUN. Expected results: QEMU should give disable message if not support block_resize with passthrough iSCSI LUN or make it works well. Additional info:
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.