[PATCH v2 0/3] block: remove separate bdrv_file_open callback

Paolo Bonzini posted 3 patches 10 months, 3 weeks ago
Failed in applying to current master (apply log)
Maintainers: Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, Stefan Hajnoczi <stefanha@redhat.com>, Stefan Weil <sw@weilnetz.de>, Ronnie Sahlberg <ronniesahlberg@gmail.com>, Paolo Bonzini <pbonzini@redhat.com>, Peter Lieven <pl@kamp.de>, Eric Blake <eblake@redhat.com>, Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>, Fam Zheng <fam@euphon.net>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Ilya Dryomov <idryomov@gmail.com>, "Richard W.M. Jones" <rjones@redhat.com>
block.c                          | 17 +++++++----------
block/blkdebug.c                 |  2 +-
block/blkio.c                    |  2 +-
block/blkverify.c                |  2 +-
block/curl.c                     |  8 ++++----
block/file-posix.c               |  8 ++++----
block/file-win32.c               |  4 ++--
block/gluster.c                  |  8 ++++----
block/iscsi.c                    |  4 ++--
block/nbd.c                      |  6 +++---
block/nfs.c                      |  2 +-
block/null.c                     |  4 ++--
block/nvme.c                     |  2 +-
block/rbd.c                      |  3 ++-
block/ssh.c                      |  2 +-
block/vvfat.c                    |  2 +-
include/block/block_int-common.h |  3 ---
17 files changed, 37 insertions(+), 42 deletions(-)
[PATCH v2 0/3] block: remove separate bdrv_file_open callback
Posted by Paolo Bonzini 10 months, 3 weeks ago
The value of the bdrv_file_open is sometimes checked to distinguish
protocol and format drivers, but apart from that there is no difference
between bdrv_file_open and bdrv_open.

However, they can all be distinguished by the non-NULL .protocol_name
member.  Change the checks to use .protocol_name instead of .bdrv_file_open,
and unify the two callbacks.

Paolo

v1->v2: fix bisectability

Paolo Bonzini (3):
  block: make assertion more generic
  block: do not check bdrv_file_open
  block: remove separate bdrv_file_open callback

 block.c                          | 17 +++++++----------
 block/blkdebug.c                 |  2 +-
 block/blkio.c                    |  2 +-
 block/blkverify.c                |  2 +-
 block/curl.c                     |  8 ++++----
 block/file-posix.c               |  8 ++++----
 block/file-win32.c               |  4 ++--
 block/gluster.c                  |  8 ++++----
 block/iscsi.c                    |  4 ++--
 block/nbd.c                      |  6 +++---
 block/nfs.c                      |  2 +-
 block/null.c                     |  4 ++--
 block/nvme.c                     |  2 +-
 block/rbd.c                      |  3 ++-
 block/ssh.c                      |  2 +-
 block/vvfat.c                    |  2 +-
 include/block/block_int-common.h |  3 ---
 17 files changed, 37 insertions(+), 42 deletions(-)

-- 
2.40.1
Re: [PATCH v2 0/3] block: remove separate bdrv_file_open callback
Posted by Eric Blake 10 months, 3 weeks ago
On Thu, Jun 01, 2023 at 01:51:36PM +0200, Paolo Bonzini wrote:
> The value of the bdrv_file_open is sometimes checked to distinguish
> protocol and format drivers, but apart from that there is no difference
> between bdrv_file_open and bdrv_open.
> 
> However, they can all be distinguished by the non-NULL .protocol_name
> member.  Change the checks to use .protocol_name instead of .bdrv_file_open,
> and unify the two callbacks.
> 
> Paolo
> 
> v1->v2: fix bisectability
> 
> Paolo Bonzini (3):
>   block: make assertion more generic
>   block: do not check bdrv_file_open
>   block: remove separate bdrv_file_open callback

Series:
Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org