aboutsummaryrefslogtreecommitdiff
path: root/block/blkreplay.c
diff options
context:
space:
mode:
authorPavel Dovgalyuk <pavel.dovgaluk@ispras.ru>2019-09-17 14:57:51 +0300
committerKevin Wolf <kwolf@redhat.com>2019-10-14 17:12:48 +0200
commit3c6c4348f23131155846dc53ce19aca309796fda (patch)
tree16a418e813921e08d980fe23c87096833fd5b8cf /block/blkreplay.c
parent6caaad46de02c02fb1eeaae64fcdc74f9e0a5eb0 (diff)
block: implement bdrv_snapshot_goto for blkreplay
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>
Diffstat (limited to 'block/blkreplay.c')
-rw-r--r--block/blkreplay.c8
1 files changed, 8 insertions, 0 deletions
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)