summaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorPaolo Bonzini2021-04-14 19:52:26 +0200
committerPaolo Bonzini2021-06-25 10:54:13 +0200
commit18473467d55a20d643b6c9b3a52de42f705b4d35 (patch)
treec24a98cb7bafaacc30695d5d274df0de24433547 /python
parentblock: add max_hw_transfer to BlockLimits (diff)
downloadqemu-18473467d55a20d643b6c9b3a52de42f705b4d35.tar.gz
qemu-18473467d55a20d643b6c9b3a52de42f705b4d35.tar.xz
qemu-18473467d55a20d643b6c9b3a52de42f705b4d35.zip
file-posix: try BLKSECTGET on block devices too, do not round to power of 2
bs->sg is only true for character devices, but block devices can also be used with scsi-block and scsi-generic. Unfortunately BLKSECTGET returns bytes in an int for /dev/sgN devices, and sectors in a short for block devices, so account for that in the code. The maximum transfer also need not be a power of 2 (for example I have seen disks with 1280 KiB maximum transfer) so there's no need to pass the result through pow2floor. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'python')
0 files changed, 0 insertions, 0 deletions