qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/4] block: Drop BDS.filename
@ 2014-09-24 19:48 Max Reitz
  2014-09-24 19:48 ` [Qemu-devel] [PATCH 1/4] block: Change bdrv_get_encrypted_filename() Max Reitz
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Max Reitz @ 2014-09-24 19:48 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, Stefan Hajnoczi, Max Reitz

The BDS filename field is generally only used when opening disk images
or emitting error or warning messages, the only exception to this rule
is the map command of qemu-img. However, using exact_filename there
instead should not be a problem. Therefore, we can drop the filename
field from the BlockDriverState and use a function instead which builds
the filename from scratch when called.

This is slower than reading a static char array but the problem of that
static array is that it may become obsolete due to changes in any
BlockDriverState or in the BDS graph. Using a function which rebuilds
the filename every time it is called resolves this problem.

The disadvantage of worse performance is negligible, on the other hand.
After patch 2 of this series, which replaces some queries of
BDS.filename by reads from somewhere else (mostly BDS.exact_filename),
the filename field is only used when a disk image is opened or some
message should be emitted, both of which cases do not suffer from the
performance hit.


Max Reitz (4):
  block: Change bdrv_get_encrypted_filename()
  block: Avoid BlockDriverState.filename
  block: Add bdrv_filename()
  block: Drop BlockDriverState.filename

 block.c                   | 90 ++++++++++++++++++++++++++++++++---------------
 block/commit.c            |  4 ++-
 block/gluster.c           |  2 +-
 block/mirror.c            | 14 +++++---
 block/qapi.c              |  7 ++--
 block/raw-posix.c         |  8 ++---
 block/raw-win32.c         |  4 +--
 block/vhdx-log.c          |  5 ++-
 block/vmdk.c              | 22 ++++++++----
 block/vpc.c               |  6 ++--
 blockdev.c                | 21 ++++++++---
 include/block/block.h     |  3 +-
 include/block/block_int.h |  1 -
 monitor.c                 |  7 ++--
 qemu-img.c                |  2 +-
 qmp.c                     |  4 ++-
 16 files changed, 136 insertions(+), 64 deletions(-)

-- 
2.1.0

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

end of thread, other threads:[~2015-02-03 14:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-24 19:48 [Qemu-devel] [PATCH 0/4] block: Drop BDS.filename Max Reitz
2014-09-24 19:48 ` [Qemu-devel] [PATCH 1/4] block: Change bdrv_get_encrypted_filename() Max Reitz
2014-09-24 19:48 ` [Qemu-devel] [PATCH 2/4] block: Avoid BlockDriverState.filename Max Reitz
2014-09-24 19:48 ` [Qemu-devel] [PATCH 3/4] block: Add bdrv_filename() Max Reitz
2014-09-24 19:48 ` [Qemu-devel] [PATCH 4/4] block: Drop BlockDriverState.filename Max Reitz
2015-02-03  9:32 ` [Qemu-devel] [PATCH 0/4] block: Drop BDS.filename Kevin Wolf
2015-02-03 13:48   ` Max Reitz
2015-02-03 14:40     ` Kevin Wolf

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).