qemu-e2k/include
Markus Armbruster 65a9bb25d6 block: New bdrv_nb_sectors()
A call to retrieve the image size converts between bytes and sectors
several times:

* BlockDriver method bdrv_getlength() returns bytes.

* refresh_total_sectors() converts to sectors, rounding up, and stores
  in total_sectors.

* bdrv_getlength() converts total_sectors back to bytes (now rounded
  up to a multiple of the sector size).

* Callers wanting sectors rather bytes convert it right back.
  Example: bdrv_get_geometry().

bdrv_nb_sectors() provides a way to omit the last two conversions.
It's exactly bdrv_getlength() with the conversion to bytes omitted.
It's functionally like bdrv_get_geometry() without its odd error
handling.

Reimplement bdrv_getlength() and bdrv_get_geometry() on top of
bdrv_nb_sectors().

The next patches will convert some users of bdrv_getlength() to
bdrv_nb_sectors().

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-08-15 15:07:12 +02:00
..
block block: New bdrv_nb_sectors() 2014-08-15 15:07:12 +02:00
disas disas: Implement disassembly output for A64 2014-02-08 14:50:48 +00:00
exec exec: fix migration with devices that use address_space_rw 2014-07-22 10:38:50 +02:00
fpu fpu: softfloat: drop INLINE macro 2014-06-23 11:00:12 -04:00
hw qemu: support xen hvm direct kernel boot 2014-08-01 15:58:12 +00:00
libdecnumber Fix new typos in comments (found by codespell) 2014-07-18 17:45:36 +04:00
migration vmstate: Add preallocation for migrating arrays (VMS_ALLOC flag) 2014-06-27 13:48:27 +02:00
monitor qapi event: clean up 2014-06-23 11:12:28 -04:00
net net: move queue number into NICPeers 2014-06-27 11:19:31 +02:00
qapi qapi: add event helper functions 2014-06-23 11:01:25 -04:00
qemu Merge remote-tracking branch 'remotes/qmp-unstable/queue/qmp' into staging 2014-06-24 13:06:13 +01:00
qom qom: add a generic mechanism to resolve paths 2014-07-01 10:17:48 +02:00
sysemu Handle G_IO_HUP in tcp_chr_read for tcp chardev 2014-07-06 09:13:54 +03:00
ui console: move chardev declarations to sysemu/char.h 2014-06-23 10:56:20 +01:00
config.h janitor: move remaining public headers to include/ 2012-12-19 08:32:46 +01:00
elf.h target-ppc: Support little-endian PPC64 in user mode. 2014-06-16 13:24:40 +02:00
glib-compat.h glib-compat.h: add new thread API emulation on top of pre-2.31 API 2014-06-10 07:44:01 +02:00
qemu-common.h dma-helpers: Fix too long qiov 2014-07-14 12:03:21 +02:00
qemu-io.h qemu-io: Fix warnings from static code analysis 2014-03-13 14:42:24 +01:00
trace.h build: some simplifications for "trace/Makefile.objs" 2013-01-12 18:42:51 +01:00