All of lore.kernel.org
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com>,
	Kevin Wolf <kwolf@redhat.com>, Eric Blake <eblake@redhat.com>,
	Markus Armbruster <armbru@redhat.com>
Subject: [Qemu-devel] [PATCH for-next 5/6] blkdebug: Inject errors on .bdrv_co_block_status()
Date: Mon,  3 Dec 2018 18:52:10 +0100	[thread overview]
Message-ID: <20181203175211.8230-6-mreitz@redhat.com> (raw)
In-Reply-To: <20181203175211.8230-1-mreitz@redhat.com>

Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 qapi/block-core.json | 5 ++++-
 block/blkdebug.c     | 8 ++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/qapi/block-core.json b/qapi/block-core.json
index 045206196b..bfe48f71f4 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -3041,10 +3041,13 @@
 #
 # @flush: .bdrv_co_flush_to_disk()
 #
+# @block-status: .bdrv_co_block_status()
+#
 # Since: 4.0
 ##
 { 'enum': 'BlkdebugIOType',
-  'data': [ 'read', 'write', 'write-zeroes', 'discard', 'flush' ] }
+  'data': [ 'read', 'write', 'write-zeroes', 'discard', 'flush',
+            'block-status' ] }
 
 ##
 # @BlkdebugInjectErrorOptions:
diff --git a/block/blkdebug.c b/block/blkdebug.c
index 51f07648ba..b86dfe58b5 100644
--- a/block/blkdebug.c
+++ b/block/blkdebug.c
@@ -670,7 +670,15 @@ static int coroutine_fn blkdebug_co_block_status(BlockDriverState *bs,
                                                  int64_t *map,
                                                  BlockDriverState **file)
 {
+    int err;
+
     assert(QEMU_IS_ALIGNED(offset | bytes, bs->bl.request_alignment));
+
+    err = rule_check(bs, offset, bytes, BLKDEBUGIO_TYPE_BLOCK_STATUS);
+    if (err) {
+        return err;
+    }
+
     return bdrv_co_block_status_from_file(bs, want_zero, offset, bytes,
                                           pnum, map, file);
 }
-- 
2.19.2

  parent reply	other threads:[~2018-12-03 17:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-03 17:52 [Qemu-devel] [PATCH for-next 0/6] qemu-img: Add salvaging mode to convert Max Reitz
2018-12-03 17:52 ` [Qemu-devel] [PATCH for-next 1/6] qemu-img: Move quiet into ImgConvertState Max Reitz
2019-02-14  2:31   ` Eric Blake
2018-12-03 17:52 ` [Qemu-devel] [PATCH for-next 2/6] qemu-img: Add salvaging mode to convert Max Reitz
2018-12-03 17:52 ` [Qemu-devel] [PATCH for-next 3/6] blkdebug: Add @iotype error option Max Reitz
2019-02-14  2:35   ` Eric Blake
2019-02-15 16:59     ` Max Reitz
2018-12-03 17:52 ` [Qemu-devel] [PATCH for-next 4/6] blkdebug: Add "none" event Max Reitz
2019-02-14  2:36   ` Eric Blake
2018-12-03 17:52 ` Max Reitz [this message]
2019-02-14  2:38   ` [Qemu-devel] [PATCH for-next 5/6] blkdebug: Inject errors on .bdrv_co_block_status() Eric Blake
2018-12-03 17:52 ` [Qemu-devel] [PATCH for-next 6/6] iotests: Test qemu-img convert --salvage Max Reitz
2018-12-04  3:39 ` [Qemu-devel] [PATCH for-next 0/6] qemu-img: Add salvaging mode to convert no-reply
2018-12-04 15:27   ` Eric Blake
2019-02-13 22:55 ` Max Reitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181203175211.8230-6-mreitz@redhat.com \
    --to=mreitz@redhat.com \
    --cc=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.