qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v5 00/13] qapi: Allow blockdev-add for NBD
@ 2016-10-25 13:11 Max Reitz
  2016-10-25 13:11 ` [Qemu-devel] [PATCH v5 01/13] block/nbd: Drop trailing "." in error messages Max Reitz
                   ` (14 more replies)
  0 siblings, 15 replies; 28+ messages in thread
From: Max Reitz @ 2016-10-25 13:11 UTC (permalink / raw)
  To: qemu-block
  Cc: qemu-devel, Max Reitz, Kevin Wolf, Eric Blake, Paolo Bonzini,
	Markus Armbruster

This series adds blockdev-add support for NBD clients.

Patches 1, 2, 3, and 4 are minor patches with no functional relation to
this series, other than the fact that later patches will touch the code
they touch, too.

Patch 5 prepares the code for the addition of a new option prefix, which
is "server.".

Patch 6 makes the NBD client accept a SocketAddress under the "server"
option (or rather, a flattened SocketAddress QDict with its keys
prefixed by "server."). The old options "host", "port", and "path" are
supported as legacy options and translated to the respective
SocketAddress representation.

Patch 7 drops usage of "host", "port", and "path" outside of
nbd_has_filename_options_conflict(),
nbd_process_legacy_socket_options(), and nbd_refresh_filename(), making
those options nothing but legacy.

Patch 8, the goal of this series, is again not very complicated.

Patches 9, 10, 11, and 12 are required for the iotest added in patch 13.
It will invoke qemu-nbd, so patch 9 is required. Besides qemu-nbd, it
will launch an NBD server VM concurrently to the client VM, which is why
patch 10 is required. And finally, it will test whether we can add an
NBD BDS by passing it a file descriptor, which patch 11 is needed for
(so we use the socket_scm_helper to pass sockets to qemu).

During rebase of v5 I noticed that the order of keys in has changed when
querying a json: filename. Instead of just adjusting the reference
string, I decided to write a function for actually parsing such
filenames and comparing them against reference dicts. This is
implemented in patch 12.

Patch 13 then adds the iotest for NBD's blockdev-add interface.


***This series depends on qdict_crumple() as it has been merged by
   Markus to his qapi-next branch (i.e. without @recursive).***


v5:
- Patch 6:
  - "server" instead of "address"
  - Dropped comparison of key against "server" (or "address",
    previously), because all options are flattened anyway and it looks
    strange to assume otherwise here
  - Use strstart() instead of strncmp()
  - Reject use of the new server option and the legacy path/host/port
    options at the same time
  - qdict_crumple() no longer has a @recursive parameter
  - The former QMP visitors are now called QObject visitors
- Patch 7: Only rebase conflicts because of %s/address/server/g
- Patch 8: Same
- Patch 12: As explained above, comparing json: filenames against
            reference strings is not extremely clever. This new patch
            adds a function to compare such filenames against reference
            Python dicts (which is thus order-independent).
- Patch 13:
  - %s/address/server/g
  - Rebase conflict because of the blockdev-add parameter change
  - Use the new assert_json_filename_equal() function from patch 12
  - Delete the Unix socket file (if there is one) in tearDown()


git-backport-diff against v4:

Key:
[----] : patches are identical
[####] : number of functional differences between upstream/downstream patch
[down] : patch is downstream-only
The flags [FC] indicate (F)unctional and (C)ontextual differences, respectively

001/13:[----] [--] 'block/nbd: Drop trailing "." in error messages'
002/13:[----] [--] 'block/nbd: Reject port parameter without host'
003/13:[----] [--] 'block/nbd: Default port in nbd_refresh_filename()'
004/13:[----] [--] 'block/nbd: Use qdict_put()'
005/13:[----] [--] 'block/nbd: Add nbd_has_filename_options_conflict()'
006/13:[0093] [FC] 'block/nbd: Accept SocketAddress'
007/13:[0020] [FC] 'block/nbd: Use SocketAddress options'
008/13:[0004] [FC] 'qapi: Allow blockdev-add for NBD'
009/13:[----] [--] 'iotests.py: Add qemu_nbd function'
010/13:[----] [--] 'iotests.py: Allow concurrent qemu instances'
011/13:[----] [--] 'socket_scm_helper: Accept fd directly'
012/13:[down] 'iotests: Add assert_json_filename_equal() method'
013/13:[0081] [FC] 'iotests: Add test for NBD's blockdev-add interface'


Max Reitz (13):
  block/nbd: Drop trailing "." in error messages
  block/nbd: Reject port parameter without host
  block/nbd: Default port in nbd_refresh_filename()
  block/nbd: Use qdict_put()
  block/nbd: Add nbd_has_filename_options_conflict()
  block/nbd: Accept SocketAddress
  block/nbd: Use SocketAddress options
  qapi: Allow blockdev-add for NBD
  iotests.py: Add qemu_nbd function
  iotests.py: Allow concurrent qemu instances
  socket_scm_helper: Accept fd directly
  iotests: Add assert_json_filename_equal() method
  iotests: Add test for NBD's blockdev-add interface

 block/nbd.c                            | 234 +++++++++++++++++++++------------
 qapi/block-core.json                   |  25 +++-
 tests/qemu-iotests/051.out             |   4 +-
 tests/qemu-iotests/051.pc.out          |   4 +-
 tests/qemu-iotests/147                 | 196 +++++++++++++++++++++++++++
 tests/qemu-iotests/147.out             |   5 +
 tests/qemu-iotests/group               |   1 +
 tests/qemu-iotests/iotests.py          |  34 ++++-
 tests/qemu-iotests/socket_scm_helper.c |  29 ++--
 9 files changed, 428 insertions(+), 104 deletions(-)
 create mode 100755 tests/qemu-iotests/147
 create mode 100644 tests/qemu-iotests/147.out

-- 
2.10.1

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

end of thread, other threads:[~2016-10-27 17:09 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-25 13:11 [Qemu-devel] [PATCH v5 00/13] qapi: Allow blockdev-add for NBD Max Reitz
2016-10-25 13:11 ` [Qemu-devel] [PATCH v5 01/13] block/nbd: Drop trailing "." in error messages Max Reitz
2016-10-25 13:11 ` [Qemu-devel] [PATCH v5 02/13] block/nbd: Reject port parameter without host Max Reitz
2016-10-25 13:11 ` [Qemu-devel] [PATCH v5 03/13] block/nbd: Default port in nbd_refresh_filename() Max Reitz
2016-10-25 13:11 ` [Qemu-devel] [PATCH v5 04/13] block/nbd: Use qdict_put() Max Reitz
2016-10-25 13:11 ` [Qemu-devel] [PATCH v5 05/13] block/nbd: Add nbd_has_filename_options_conflict() Max Reitz
2016-10-25 13:11 ` [Qemu-devel] [PATCH v5 06/13] block/nbd: Accept SocketAddress Max Reitz
2016-10-25 15:30   ` Kevin Wolf
2016-10-25 13:11 ` [Qemu-devel] [PATCH v5 07/13] block/nbd: Use SocketAddress options Max Reitz
2016-10-26  9:51   ` Kevin Wolf
2016-10-25 13:11 ` [Qemu-devel] [PATCH v5 08/13] qapi: Allow blockdev-add for NBD Max Reitz
2016-10-25 23:57   ` Eric Blake
2016-10-26  8:09     ` Kevin Wolf
2016-10-26 14:17     ` Max Reitz
2016-10-26  9:54   ` Kevin Wolf
2016-10-25 13:11 ` [Qemu-devel] [PATCH v5 09/13] iotests.py: Add qemu_nbd function Max Reitz
2016-10-26 10:04   ` Kevin Wolf
2016-10-25 13:11 ` [Qemu-devel] [PATCH v5 10/13] iotests.py: Allow concurrent qemu instances Max Reitz
2016-10-25 13:11 ` [Qemu-devel] [PATCH v5 11/13] socket_scm_helper: Accept fd directly Max Reitz
2016-10-25 13:11 ` [Qemu-devel] [PATCH v5 12/13] iotests: Add assert_json_filename_equal() method Max Reitz
2016-10-26 10:41   ` Kevin Wolf
2016-10-26 14:24     ` Max Reitz
2016-10-25 13:11 ` [Qemu-devel] [PATCH v5 13/13] iotests: Add test for NBD's blockdev-add interface Max Reitz
2016-10-25 14:41   ` Markus Armbruster
2016-10-26 14:25     ` Max Reitz
2016-10-26 13:08   ` Kevin Wolf
2016-10-25 13:16 ` [Qemu-devel] [PATCH v5 00/13] qapi: Allow blockdev-add for NBD Max Reitz
2016-10-27 17:08 ` 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).