qemu-patch-raspberry4/include
Eric Farman 482652502e block: Fix target variable of BLKSECTGET ioctl
Commit 6f6071745b ("raw-posix: Fetch max sectors for host block device")
introduced a routine to call the kernel BLKSECTGET ioctl, which stores the
result back to user space.  However, the size of the data returned depends
on the routine handling the ioctl.  The (compat_)blkdev_ioctl returns a
short, while sg_ioctl returns an int.  Thus, on big-endian systems, we can
find ourselves accidentally shifting the result to a much larger value.
(On s390x, a short is 16 bits while an int is 32 bits.)

Also, the two ioctl handlers return values in different scales (block
returns sectors, while sg returns bytes), so some tweaking of the outputs
is required such that hdev_get_max_transfer_length returns a value in a
consistent set of units.

Signed-off-by: Eric Farman <farman@linux.vnet.ibm.com>
Message-Id: <20170120162527.66075-3-farman@linux.vnet.ibm.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-01-27 18:07:31 +01:00
..
block block: Fix target variable of BLKSECTGET ioctl 2017-01-27 18:07:31 +01:00
crypto crypto: add CTR mode support 2016-10-19 10:09:24 +01:00
disas nios2: Add disas entries 2017-01-24 13:10:35 -08:00
exec memory: hmp: add "-f" for "info mtree" 2017-01-27 18:07:31 +01:00
fpu fpu: add mechanism to check for invalid long double formats 2016-09-15 12:43:18 +01:00
hw Introduce DEVICE_CATEGORY_CPU for CPU devices 2017-01-27 18:07:31 +01:00
io io: introduce a DNS resolver API 2017-01-23 15:32:46 +00:00
libdecnumber Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
migration migration: re-active images while migration been canceled after inactive them 2017-01-24 18:00:31 +00:00
monitor qdev: add function qdev_set_id() 2016-11-22 10:29:37 -08:00
net vhost-net: Notify the backend about the host MTU 2017-01-10 07:02:53 +02:00
qapi include: Fix typos found by codespell 2017-01-24 23:26:52 +03:00
qemu hbitmap: Add hbitmap_is_serializable() 2017-01-26 10:25:01 +08:00
qom object: make some funcs static 2017-01-24 23:26:53 +03:00
standard-headers virtio_crypto: header update 2017-01-18 22:59:53 +02:00
sysemu replay: save/load initial state 2017-01-27 18:07:30 +01:00
ui curses: Fix compiler warnings (Mingw-w64 redefinition of macro KEY_EVENT) 2017-01-10 08:14:20 +01:00
elf.h nios2: Add usermode binaries emulation 2017-01-24 13:10:35 -08:00
glib-compat.h win32: use glib gpoll if glib >= 2.50 2017-01-24 23:26:53 +03:00
qemu-common.h tcg: Add EXCP_ATOMIC 2016-10-26 08:29:00 -07:00
qemu-io.h qemu-io: Use BlockBackend 2015-02-16 15:07:19 +00:00
trace-tcg.h trace: get rid of generated-events.h/generated-events.c 2016-10-12 09:54:52 +02:00
trace.h trace: get rid of generated-events.h/generated-events.c 2016-10-12 09:54:52 +02:00