Received: from eggs.gnu.org ([2001:4830:134:3::10]:56582) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WIEyC-00070H-Tn for qemu-devel@nongnu.org; Tue, 25 Feb 2014 05:10:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WIEy7-00071V-HI for qemu-devel@nongnu.org; Tue, 25 Feb 2014 05:10:36 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51797) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WIEy7-00071N-9Z for qemu-devel@nongnu.org; Tue, 25 Feb 2014 05:10:31 -0500 From: Stefan Hajnoczi Date: Tue, 25 Feb 2014 11:09:55 +0100 Message-Id: <1393322998-10289-1-git-send-email-stefanha@redhat.com> Subject: [Qemu-devel] [PATCH 0/3] nbd: fix issues when connection breaks List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Paolo Bonzini , bluewindow@h3c.com, nick@bytemark.co.uk 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 080 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 080 NBD client disconnect tests block/nbd-client.c | 33 +++-- tests/qemu-iotests/080 | 91 ++++++++++++ tests/qemu-iotests/080.out | 73 ++++++++++ tests/qemu-iotests/group | 1 + tests/qemu-iotests/nbd-fault-injector.py | 231 +++++++++++++++++++++++++++++++ 5 files changed, 414 insertions(+), 15 deletions(-) create mode 100755 tests/qemu-iotests/080 create mode 100644 tests/qemu-iotests/080.out create mode 100755 tests/qemu-iotests/nbd-fault-injector.py -- 1.8.5.3