qemu-irix/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
exec exec: fix migration with devices that use address_space_rw 2014-07-22 10:38:50 +02:00
fpu
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
monitor
net
qapi
qemu
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
config.h
elf.h
glib-compat.h
qemu-common.h dma-helpers: Fix too long qiov 2014-07-14 12:03:21 +02:00
qemu-io.h
trace.h