qemu-e2k/include
Eric Blake d6a644bbfe block: Make bdrv_is_allocated() byte-based
We are gradually moving away from sector-based interfaces, towards
byte-based.  In the common case, allocation is unlikely to ever use
values that are not naturally sector-aligned, but it is possible
that byte-based values will let us be more precise about allocation
at the end of an unaligned file that can do byte-based access.

Changing the signature of the function to use int64_t *pnum ensures
that the compiler enforces that all callers are updated.  For now,
the io.c layer still assert()s that all callers are sector-aligned
on input and that *pnum is sector-aligned on return to the caller,
but that can be relaxed when a later patch implements byte-based
block status.  Therefore, this code adds usages like
DIV_ROUND_UP(,BDRV_SECTOR_SIZE) to callers that still want aligned
values, where the call might reasonbly give non-aligned results
in the future; on the other hand, no rounding is needed for callers
that should just continue to work with byte alignment.

For the most part this patch is just the addition of scaling at the
callers followed by inverse scaling at bdrv_is_allocated().  But
some code, particularly bdrv_commit(), gets a lot simpler because it
no longer has to mess with sectors; also, it is now possible to pass
NULL if the caller does not care how much of the image is allocated
beyond the initial offset.  Leave comments where we can further
simplify once a later patch eliminates the need for sector-aligned
requests through bdrv_is_allocated().

For ease of review, bdrv_is_allocated_above() will be tackled
separately.

Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2017-07-10 13:18:07 +02:00
..
block block: Make bdrv_is_allocated() byte-based 2017-07-10 13:18:07 +02:00
chardev char: fix alias devices regression 2017-06-08 17:57:36 +04:00
crypto crypto: qcrypto_random_bytes() now works on windows w/o any other crypto libs 2017-05-09 14:41:47 +01:00
disas Fix Thumb-1 BE32 execution and disassembly. 2017-02-07 18:29:59 +00:00
exec tcg: add CONFIG_TCG guards in headers 2017-07-05 09:11:08 +02:00
fpu softfloat: define floatx80_round() 2017-06-29 20:27:39 +02:00
hw xenfb: remove xen_init_display "temporary" hack 2017-07-07 11:10:03 -07:00
io trivial patches for 2017-05-10 2017-05-10 12:31:19 -04:00
libdecnumber Clean up ill-advised or unusual header guards 2016-07-12 16:20:46 +02:00
migration vmstate: error hint for failed equal checks 2017-06-28 11:18:44 +02:00
monitor qmp: Dumb down how we run QMP command registration 2017-03-05 09:02:10 +01:00
net slirp: add a fake NC-SI backend 2017-04-25 19:17:25 +08:00
qapi qnum: add uint type 2017-06-20 14:31:31 +02:00
qemu blockjob: Track job ratelimits via bytes, not sectors 2017-07-10 13:18:06 +02:00
qom include/exec/poison: Mark CONFIG_SOFTMMU as poisoned 2017-07-04 14:39:11 +02:00
standard-headers linux-headers: update 2017-05-19 12:29:01 +02:00
sysemu vl: convert -tb-size to qemu_strtoul 2017-07-04 14:39:28 +02:00
ui gtk: use framebuffer helper functions. 2017-06-21 14:23:16 +02:00
elf.h nios2: Add usermode binaries emulation 2017-01-24 13:10:35 -08:00
glib-compat.h qga: Add 'guest-get-users' command 2017-04-26 23:57:45 -05:00
qemu-common.h tcg: make tcg_allowed global 2017-07-04 16:01:16 +02:00
qemu-io.h hmp: Request permissions in qemu-io 2017-02-28 20:47:50 +01:00
trace-tcg.h trace: get rid of generated-events.h/generated-events.c 2016-10-12 09:54:52 +02:00