Skip to content

nbd: fix issues when connection breaks

Stefan Hajnoczi qemu-devel 2 versions – Applied

Status from this message: Applied to my block tree:

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 4 repliesApplied
  2. v13 patches 4 repliesSuperseded

Changes in v2 from the cover letter

* Use qemu-iotests 083 test number to avoid conflicts [kwolf]
* Test class negotiation without export name [lupine]
* Test short replies from the server [lupine]

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/3nbd: close socket if connection breaksblock/nbd-client.c+18 -150 replies
2/3tests: add nbd-fault-injector.py utilitytests/qemu-iotests/nbd-fault-injector.py+264 -00 replies
3/3qemu-iotests: add 083 NBD client disconnect teststests/qemu-iotests/083 tests/qemu-iotests/083.out tests/qemu-iotests/group+293 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [Qemu-devel] [PATCH v2 0/3] nbd: fix issues when connection breaks

v2:
* Use qemu-iotests 083 test number to avoid conflicts [kwolf]
* Test class negotiation without export name [lupine]
* Test short replies from the server [lupine]

The first patch ensures the nbd_receive_reply() fd handler is unregistered when the connection to the server breaks. This avoids high CPU consumption and flooding error messages.

The second patch introduces an NBD server fault injection script. Using this fake NBD server it is possible to exercise error handling code paths in the NBD client.

The third patch adds qemu-iotests test case 083 to verify qemu-io exits with an error at each point where the connection can break.

Stefan Hajnoczi (3):
nbd: close socket if connection breaks
tests: add nbd-fault-injector.py utility
qemu-iotests: add 083 NBD client disconnect tests

 block/nbd-client.c                       |  33 ++--
 tests/qemu-iotests/083                   | 129 +++++++++++++++
 tests/qemu-iotests/083.out               | 163 +++++++++++++++++++
 tests/qemu-iotests/group                 |   1 +
 tests/qemu-iotests/nbd-fault-injector.py | 264 +++++++++++++++++++++++++++++++
 5 files changed, 575 insertions(+), 15 deletions(-)
 create mode 100755 tests/qemu-iotests/083
 create mode 100644 tests/qemu-iotests/083.out
 create mode 100755 tests/qemu-iotests/nbd-fault-injector.py
Signature · 1 line
1.8.5.3