diff options
| author | Paolo Bonzini <pbonzini@redhat.com> | 2021-04-14 19:52:26 +0200 |
|---|---|---|
| committer | Paolo Bonzini <pbonzini@redhat.com> | 2021-06-25 10:54:13 +0200 |
| commit | 18473467d55a20d643b6c9b3a52de42f705b4d35 (patch) | |
| tree | c24a98cb7bafaacc30695d5d274df0de24433547 /hw/core/machine.c | |
| parent | 24b36e9813ec15da7db62e3b3621730710c5f020 (diff) | |
| download | focaccia-qemu-18473467d55a20d643b6c9b3a52de42f705b4d35.tar.gz focaccia-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 'hw/core/machine.c')
0 files changed, 0 insertions, 0 deletions