qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/5] Clean up around bdrv_getlength()
@ 2014-05-09  9:48 Markus Armbruster
  2014-05-09  9:48 ` [Qemu-devel] [PATCH 1/5] raw-posix: Fix raw_getlength() to always return -errno on error Markus Armbruster
                   ` (6 more replies)
  0 siblings, 7 replies; 12+ messages in thread
From: Markus Armbruster @ 2014-05-09  9:48 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, stefanha

Issues addressed in this series:

* BlockDriver method bdrv_getlength() generally returns -errno, but
  some implementations return -1 instead.  Fix them [PATCH 1].

* Frequent conversions between sectors and bytes complicate the code
  needlessly.  Clean up some [PATCH 2+3].

* bdrv_getlength() always returns a multiple of BDRV_SECTOR_SIZE, but
  some places appear to be confused about that, and align the result
  up or down.  Don't [PATCH 4].

* bdrv_get_geometry() hides errors.  Don't use it in places where
  errors should be detected [PATCH 5].

Issues not addressed:

* There are quite a few literals left in the code where
  BDRV_SECTOR_SIZE, BDRV_SECTOR_BITS or BDRV_SECTOR_MASK should be
  used instead.

* Error handling is missing in places, but it's not always obvious
  whether errors can actually happen, and if yes, how to handle them.

Markus Armbruster (5):
  raw-posix: Fix raw_getlength() to always return -errno on error
  block: New bdrv_nb_sectors()
  block: Use bdrv_nb_sectors() when sectors, not bytes are wanted
  block: Drop superfluous aligning of bdrv_getlength()'s value
  block: Avoid bdrv_get_geometry() where errors should be detected

 block-migration.c     |  9 +++--
 block.c               | 81 ++++++++++++++++++++++++--------------------
 block/qapi.c          | 14 +++++---
 block/qcow2.c         |  3 +-
 block/raw-posix.c     | 28 ++++++++++++----
 block/vmdk.c          |  5 ++-
 include/block/block.h |  1 +
 qemu-img.c            | 93 ++++++++++++++++++++++++++++++++++-----------------
 8 files changed, 147 insertions(+), 87 deletions(-)

-- 
1.8.1.4

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-05-12 12:50 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-09  9:48 [Qemu-devel] [PATCH 0/5] Clean up around bdrv_getlength() Markus Armbruster
2014-05-09  9:48 ` [Qemu-devel] [PATCH 1/5] raw-posix: Fix raw_getlength() to always return -errno on error Markus Armbruster
2014-05-09  9:48 ` [Qemu-devel] [PATCH 2/5] block: New bdrv_nb_sectors() Markus Armbruster
2014-05-12 11:11   ` Kevin Wolf
2014-05-12 12:36     ` Markus Armbruster
2014-05-12 12:50     ` Eric Blake
2014-05-09  9:48 ` [Qemu-devel] [PATCH 3/5] block: Use bdrv_nb_sectors() when sectors, not bytes are wanted Markus Armbruster
2014-05-09 16:27   ` Markus Armbruster
2014-05-09  9:48 ` [Qemu-devel] [PATCH 4/5] block: Drop superfluous aligning of bdrv_getlength()'s value Markus Armbruster
2014-05-09  9:48 ` [Qemu-devel] [PATCH 5/5] block: Avoid bdrv_get_geometry() where errors should be detected Markus Armbruster
2014-05-09 12:29 ` [Qemu-devel] [PATCH 0/5] Clean up around bdrv_getlength() Stefan Hajnoczi
2014-05-09 15:30 ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).