From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NwGQ5-0005hy-6R for qemu-devel@nongnu.org; Mon, 29 Mar 2010 10:58:25 -0400 Received: from [140.186.70.92] (port=46641 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NwGM2-0005JF-E2 for qemu-devel@nongnu.org; Mon, 29 Mar 2010 10:58:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NwGLF-0002cb-U2 for qemu-devel@nongnu.org; Mon, 29 Mar 2010 10:53:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:22665) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NwGLF-0002cN-Ly for qemu-devel@nongnu.org; Mon, 29 Mar 2010 10:53:25 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2TErOOl010040 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 29 Mar 2010 10:53:24 -0400 From: Kevin Wolf Date: Mon, 29 Mar 2010 16:52:41 +0200 Message-Id: <1269874368-31011-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH v2 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 write failed: Input/output error Changes in comparison to the RFC: - Had to rebase qemu-config changes - Code cleanup (including resolving TODOs and FIXMEs) - More events all over qcow2 - No debug messages on stderr any more v2: - Another rebase - Fixed memleak in blkdebug_open 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 | 12 ++ block.h | 53 ++++++ block/blkdebug.c | 475 ++++++++++++++++++++++++++++++++++++++++++++++++ block/qcow2-cluster.c | 15 ++ block/qcow2-refcount.c | 18 ++ block/qcow2.c | 6 + block_int.h | 2 + hw/qdev-properties.c | 19 ++- hw/qdev.h | 1 - qemu-config.c | 48 +++--- qemu-config.h | 4 +- vl.c | 38 ++--- 13 files changed, 644 insertions(+), 53 deletions(-) create mode 100644 block/blkdebug.c