Skip to contentSkip to conversation

NBD patches for 2018-03-13 (2.12 softfreeze)

GIT PULL Applied Eric Blake 2 participants 3 messages Mar 13, 2018 – Mar 16, 2018 Block layer

lore
Share & tools
lore

Eric Blake

author
#0 lore raw

The following changes since commit 026aaf47c02b79036feb830206cfebb2a726510d:

Merge remote-tracking branch 'remotes/ehabkost/tags/python-next-pull-request' into staging (2018-03-13 16:26:44 +0000)

are available in the Git repository at:

git://repo.or.cz/qemu/ericb.git tags/pull-nbd-2018-03-13-v2

for you to fetch changes up to 65374c1aa6263a4e2b566d15a9fd9b2105954a1b:

iotests: new test 209 for NBD BLOCK_STATUS (2018-03-13 15:44:09 -0500)

In v2: fix uninitialized variable warning [patchew] (only mailing patches that changed since v1)

----------------------------------------------------------------
nbd patches for 2018-03-13

- Eric Blake: iotests: Fix stuck NBD process on 33
- Vladimir Sementsov-Ogievskiy: 0/5 nbd server fixing and refactoring before BLOCK_STATUS
- Eric Blake: nbd/server: Honor FUA request on NBD_CMD_TRIM
- Stefan Hajnoczi: 0/2 block: fix nbd-server-stop crash after blockdev-snapshot-sync
- Vladimir Sementsov-Ogievskiy: nbd block status base:allocation

----------------------------------------------------------------
Eric Blake (2):
iotests: Fix stuck NBD process on 33 nbd/server: Honor FUA request on NBD_CMD_TRIM

Stefan Hajnoczi (2):
block: let blk_add/remove_aio_context_notifier() tolerate BDS changes
iotests: add 208 nbd-server + blockdev-snapshot-sync test case

Vladimir Sementsov-Ogievskiy (13):
nbd/server: move nbd_co_send_structured_error up nbd/server: fix sparse read
nbd/server: fix: check client->closing before sending reply nbd/server: refactor nbd_trip: cmd_read and generic reply nbd/server: refactor nbd_trip: split out nbd_handle_request nbd/server: add nbd_opt_invalid helper
nbd/server: add nbd_read_opt_name helper
nbd: BLOCK_STATUS for standard get_block_status function: server part block/nbd-client: save first fatal error in nbd_iter_error
nbd: BLOCK_STATUS for standard get_block_status function: client part iotests.py: tiny refactor: move system imports up
iotests: add file_path helper
iotests: new test 209 for NBD BLOCK_STATUS

 block/nbd-client.h            |   6 +
 include/block/nbd.h           |   3 +
 block/block-backend.c         |  63 ++++
 block/nbd-client.c            | 154 ++++++++-
 block/nbd.c                   |   3 +
 nbd/client.c                  | 117 +++++++
 nbd/server.c                  | 725 ++++++++++++++++++++++++++++++++----------
 block/trace-events            |   2 +
 tests/qemu-iotests/033        |   1 +
 tests/qemu-iotests/208        |  55 ++++
 tests/qemu-iotests/208.out    |   9 +
 tests/qemu-iotests/209        |  34 ++
 tests/qemu-iotests/209.out    |   2 +
 tests/qemu-iotests/group      |   2 +
 tests/qemu-iotests/iotests.py |  37 ++-
 15 files changed, 1047 insertions(+), 166 deletions(-)
 create mode 100755 tests/qemu-iotests/208
 create mode 100644 tests/qemu-iotests/208.out
 create mode 100755 tests/qemu-iotests/209
 create mode 100644 tests/qemu-iotests/209.out
Signature · 1 line
2.14.3
author
#1 lore raw

[Qemu-devel] [PULL v2 14/17] nbd: BLOCK_STATUS for standard get_block_status function: client part

From: Vladimir Sementsov-Ogievskiy <[email protected]>

Minimal realization: only one extent in server answer is supported. Flag NBD_CMD_FLAG_REQ_ONE is used to force this behavior.

Message-Id: <[email protected]>

[eblake: grammar tweaks, fix min_block check and 32-bit cap, use -1 instead of errno on failure in nbd_negotiate_simple_meta_context, ensure that block status makes progress on success]

---
 block/nbd-client.h  |   6 +++
 include/block/nbd.h |   3 ++
 block/nbd-client.c  | 150 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 block/nbd.c         |   3 ++
 nbd/client.c        | 117 ++++++++++++++++++++++++++++++++++++++++
 5 files changed, 279 insertions(+)
block/nbd-client.h +6 -0
index 612c4c21a0c..0ece76e5aff 100644
@@ -61,4 +61,10 @@ void nbd_client_detach_aio_context(BlockDriverState *bs);
 void nbd_client_attach_aio_context(BlockDriverState *bs,
                                    AioContext *new_context);
 
+int coroutine_fn nbd_client_co_block_status(BlockDriverState *bs,
+                                            bool want_zero,
+                                            int64_t offset, int64_t bytes,
+                                            int64_t *pnum, int64_t *map,
+                                            BlockDriverState **file);
+
 #endif /* NBD_CLIENT_H */
include/block/nbd.h +3 -0
index 2285637e673..fcdcd545023 100644
@@ -260,6 +260,7 @@ struct NBDExportInfo {
     /* In-out fields, set by client before nbd_receive_negotiate() and
      * updated by server results during nbd_receive_negotiate() */
     bool structured_reply;
+    bool base_allocation; /* base:allocation context for NBD_CMD_BLOCK_STATUS */
 
     /* Set by server results during nbd_receive_negotiate() */
     uint64_t size;
@@ -267,6 +268,8 @@ struct NBDExportInfo {
     uint32_t min_block;
     uint32_t opt_block;
     uint32_t max_block;
+
+    uint32_t meta_base_allocation_id;
 };
 typedef struct NBDExportInfo NBDExportInfo;
 
block/nbd-client.c +150 -0

174 lines not on this page · raw message

block/nbd.c +3 -0
index d4e4172c08c..1e2b3ba2d3b 100644
@@ -585,6 +585,7 @@ static BlockDriver bdrv_nbd = {
     .bdrv_detach_aio_context    = nbd_detach_aio_context,
     .bdrv_attach_aio_context    = nbd_attach_aio_context,
     .bdrv_refresh_filename      = nbd_refresh_filename,
+    .bdrv_co_block_status       = nbd_client_co_block_status,
 };
 
 static BlockDriver bdrv_nbd_tcp = {
@@ -604,6 +605,7 @@ static BlockDriver bdrv_nbd_tcp = {
     .bdrv_detach_aio_context    = nbd_detach_aio_context,
     .bdrv_attach_aio_context    = nbd_attach_aio_context,
     .bdrv_refresh_filename      = nbd_refresh_filename,
+    .bdrv_co_block_status       = nbd_client_co_block_status,
 };
 
 static BlockDriver bdrv_nbd_unix = {
@@ -623,6 +625,7 @@ static BlockDriver bdrv_nbd_unix = {
     .bdrv_detach_aio_context    = nbd_detach_aio_context,
     .bdrv_attach_aio_context    = nbd_attach_aio_context,
     .bdrv_refresh_filename      = nbd_refresh_filename,
+    .bdrv_co_block_status       = nbd_client_co_block_status,
 };
 
 static void bdrv_nbd_init(void)
nbd/client.c +117 -0

139 lines not on this page · raw message

Signature · 1 line
2.14.3
#2 lore raw
In reply to Eric Blake
Quoted 15 lines · Eric Blake

The following changes since commit 026aaf47c02b79036feb830206cfebb2a726510d:

Merge remote-tracking branch 'remotes/ehabkost/tags/python-next-pull-request' into staging (2018-03-13 16:26:44 +0000)

are available in the Git repository at:

git://repo.or.cz/qemu/ericb.git tags/pull-nbd-2018-03-13-v2

for you to fetch changes up to 65374c1aa6263a4e2b566d15a9fd9b2105954a1b:

iotests: new test 209 for NBD BLOCK_STATUS (2018-03-13 15:44:09 -0500)

In v2: fix uninitialized variable warning [patchew] (only mailing patches that changed since v1)

Quoted 9 lines

----------------------------------------------------------------
nbd patches for 2018-03-13

- Eric Blake: iotests: Fix stuck NBD process on 33
- Vladimir Sementsov-Ogievskiy: 0/5 nbd server fixing and refactoring before BLOCK_STATUS
- Eric Blake: nbd/server: Honor FUA request on NBD_CMD_TRIM
- Stefan Hajnoczi: 0/2 block: fix nbd-server-stop crash after blockdev-snapshot-sync
- Vladimir Sementsov-Ogievskiy: nbd block status base:allocation

Applied, thanks.

-- PMM