[Qemu-devel] [PATCH 0/3] nbd: merge block/nbd.c and block/nbd-client.c

Vladimir Sementsov-Ogievskiy posted 3 patches 4 years, 10 months ago
Test s390x passed
Test checkpatch passed
Test asan passed
Test docker-mingw@fedora passed
Test docker-clang@ubuntu passed
Test FreeBSD passed
Failed in applying to current master (apply log)
block/nbd-client.h  |   72 ---
block/nbd-client.c  | 1226 -----------------------------------------
block/nbd.c         | 1282 +++++++++++++++++++++++++++++++++++++++++--
block/Makefile.objs |    2 +-
block/trace-events  |    4 +-
5 files changed, 1251 insertions(+), 1335 deletions(-)
delete mode 100644 block/nbd-client.h
delete mode 100644 block/nbd-client.c
[Qemu-devel] [PATCH 0/3] nbd: merge block/nbd.c and block/nbd-client.c
Posted by Vladimir Sementsov-Ogievskiy 4 years, 10 months ago
Hi all!

I need some fields of BDRVNBDState to be available in nbd-client.c
code for my nbd-reconnect series. This leads to the following idea:
It seems that there is no actual benefits in splitting
NBDClientSession out of BDRVNBDState and nbd-client.c out of nbd.c
It only increases confusion around nbd client architecture, and make
it different from other formats. So, I propose to merge them back.

The only thing I doubt in:
NBD client block driver is called "nbd", so, seems logical to keep
BDRVNBDState structure name and block/nbd.c filename. But I can't
rename all nbd_client_* handlers to nbd_*, as they start conflicting
with definitions in include/block/nbd.h (nbd_init for example). So,
for now I've kept old names, so, some handlers are nbd_* and some
nbd_client_*, which is definitely inconsistent.. So, maybe they
all should become block_nbd_ or bdrv_nbd_ or nbddrv_ or something
like this to stress that it is BlockDriver implementation, not
nbd/client.c code (separated from generic block layer). Or keep them
as is, a bit inconsistent. What do you think?

Vladimir Sementsov-Ogievskiy (3):
  block/nbd-client: drop stale logout
  block/nbd: merge nbd-client.* to nbd.c
  block/nbd: merge NBDClientSession struct back to BDRVNBDState

 block/nbd-client.h  |   72 ---
 block/nbd-client.c  | 1226 -----------------------------------------
 block/nbd.c         | 1282 +++++++++++++++++++++++++++++++++++++++++--
 block/Makefile.objs |    2 +-
 block/trace-events  |    4 +-
 5 files changed, 1251 insertions(+), 1335 deletions(-)
 delete mode 100644 block/nbd-client.h
 delete mode 100644 block/nbd-client.c

-- 
2.18.0