qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC v3 3/8] block: pass size to bdrv_unregister_buf()


From: Hanna Reitz
Subject: Re: [RFC v3 3/8] block: pass size to bdrv_unregister_buf()
Date: Wed, 13 Jul 2022 16:08:47 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0

On 08.07.22 06:17, Stefan Hajnoczi wrote:
The only implementor of bdrv_register_buf() is block/nvme.c, where the
size is not needed when unregistering a buffer. This is because
util/vfio-helpers.c can look up mappings by address.

Future block drivers that implement bdrv_register_buf() may not be able
to do their job given only the buffer address. Add a size argument to
bdrv_unregister_buf().

Also document the assumptions about
bdrv_register_buf()/bdrv_unregister_buf() calls. The same <host, size>
values that were given to bdrv_register_buf() must be given to
bdrv_unregister_buf().

gcc 11.2.1 emits a spurious warning that img_bench()'s buf_size local
variable might be uninitialized, so it's necessary to silence the
compiler.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
  include/block/block-global-state.h          | 5 ++++-
  include/block/block_int-common.h            | 2 +-
  include/sysemu/block-backend-global-state.h | 2 +-
  block/block-backend.c                       | 4 ++--
  block/io.c                                  | 6 +++---
  block/nvme.c                                | 2 +-
  qemu-img.c                                  | 4 ++--
  7 files changed, 14 insertions(+), 11 deletions(-)

Reviewed-by: Hanna Reitz <hreitz@redhat.com>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]