All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org
Subject: [PULL 02/15] block: implement bdrv_snapshot_goto for blkreplay
Date: Mon, 14 Oct 2019 18:03:36 +0200	[thread overview]
Message-ID: <20191014160343.8211-3-kwolf@redhat.com> (raw)
In-Reply-To: <20191014160343.8211-1-kwolf@redhat.com>

From: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>

This patch enables making snapshots with blkreplay used in
block devices.
This function is required to make bdrv_snapshot_goto without
calling .bdrv_open which is not implemented.

Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
Acked-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/blkreplay.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/block/blkreplay.c b/block/blkreplay.c
index 2b7931b940..c96ac8f4bc 100644
--- a/block/blkreplay.c
+++ b/block/blkreplay.c
@@ -126,6 +126,12 @@ static int coroutine_fn blkreplay_co_flush(BlockDriverState *bs)
     return ret;
 }
 
+static int blkreplay_snapshot_goto(BlockDriverState *bs,
+                                   const char *snapshot_id)
+{
+    return bdrv_snapshot_goto(bs->file->bs, snapshot_id, NULL);
+}
+
 static BlockDriver bdrv_blkreplay = {
     .format_name            = "blkreplay",
     .instance_size          = 0,
@@ -140,6 +146,8 @@ static BlockDriver bdrv_blkreplay = {
     .bdrv_co_pwrite_zeroes  = blkreplay_co_pwrite_zeroes,
     .bdrv_co_pdiscard       = blkreplay_co_pdiscard,
     .bdrv_co_flush          = blkreplay_co_flush,
+
+    .bdrv_snapshot_goto     = blkreplay_snapshot_goto,
 };
 
 static void bdrv_blkreplay_init(void)
-- 
2.20.1



  parent reply	other threads:[~2019-10-14 16:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-14 16:03 [PULL 00/15] Block layer patches Kevin Wolf
2019-10-14 16:03 ` [PULL 01/15] block/vhdx: add check for truncated image files Kevin Wolf
2019-10-14 16:03 ` Kevin Wolf [this message]
2019-10-14 16:03 ` [PULL 03/15] replay: disable default snapshot for record/replay Kevin Wolf
2019-10-14 16:03 ` [PULL 04/15] replay: update docs for record/replay with block devices Kevin Wolf
2019-10-14 16:03 ` [PULL 05/15] replay: don't drain/flush bdrv queue while RR is working Kevin Wolf
2019-10-14 16:03 ` [PULL 06/15] replay: finish record/replay before closing the disks Kevin Wolf
2019-10-14 16:03 ` [PULL 07/15] replay: add BH oneshot event for block layer Kevin Wolf
2019-10-14 16:03 ` [PULL 08/15] block: Reject misaligned write requests with BDRV_REQ_NO_FALLBACK Kevin Wolf
2019-10-14 16:03 ` [PULL 09/15] iotests/028: Fix for long $TEST_DIRs Kevin Wolf
2019-10-15 16:09 ` [PULL 00/15] Block layer patches Peter Maydell

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=20191014160343.8211-3-kwolf@redhat.com \
    --to=kwolf@redhat.com \
    --cc=peter.maydell@linaro.org \
    --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.