Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NrDn6-0004LW-74 for qemu-devel@nongnu.org; Mon, 15 Mar 2010 13:09:20 -0400 Received: from [199.232.76.173] (port=60308 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NrDn4-0004LO-TM for qemu-devel@nongnu.org; Mon, 15 Mar 2010 13:09:18 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NrDn3-0005qI-BQ for qemu-devel@nongnu.org; Mon, 15 Mar 2010 13:09:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:10113) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NrDn2-0005py-Ub for qemu-devel@nongnu.org; Mon, 15 Mar 2010 13:09:17 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2FH9Fip004968 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 15 Mar 2010 13:09:15 -0400 From: Kevin Wolf Date: Mon, 15 Mar 2010 18:08:28 +0100 Message-Id: <1268672915-12233-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [RFC][PATCH 0/7] blkdebug List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com This patch series introduces a new block driver which acts as a protocol and whose purpose it is to fail requests. To be more precise, I want it to fail in configurable places, so that qemu-iotests can be extended with tests for the error paths (for example for the case when something with metadata writes goes wrong deep in qcow2). It works like this (I think this is self-explanatory): $ cat /tmp/blkdebug.cfg [inject-error] event = "l1_update" errno = "5" immediately = "on" $ qemu-io blkdebug:/tmp/blkdebug.cfg:/tmp/empty.qcow2 qemu-io> read 0 4k read 4096/4096 bytes at offset 0 4 KiB, 1 ops; 0.0000 sec (195.312 MiB/sec and 50000.0000 ops/sec) qemu-io> write 0 4k bdrv_debug_event: 4 blkdebug_debug_event: 4 write failed: Input/output error Basically what I think is left to do is: - Resolve TODOs and FIXMEs left in the code - Require blkdebug to be explicitly enabled before compiling in event generation (not sure if it really matters) - Add more events, they are only added for qcow2-clusters so far - Address your comments (if any) Kevin Wolf (7): qemu-config: qemu_read_config_file() reads the normal config file qemu-config: Make qemu_config_parse more generic blkdebug: Basic request passthrough blkdebug: Inject errors Make qemu-config available for tools blkdebug: Add events and rules qcow2: Trigger blkdebug events Makefile.objs | 6 +- block.c | 13 ++ block.h | 28 ++++ block/blkdebug.c | 423 +++++++++++++++++++++++++++++++++++++++++++++++++ block/qcow2-cluster.c | 15 ++ block_int.h | 2 + hw/qdev-properties.c | 19 ++- hw/qdev.h | 1 - qemu-config.c | 45 +++--- qemu-config.h | 4 +- vl.c | 34 ++--- 11 files changed, 540 insertions(+), 50 deletions(-) create mode 100644 block/blkdebug.c