Skip to content

Commit

Permalink
block: implement bdrv_snapshot_goto for blkreplay
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dovgalyuk authored and kevmw committed Oct 14, 2019
1 parent 6caaad4 commit 3c6c434
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions block/blkreplay.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)
Expand Down

0 comments on commit 3c6c434

Please sign in to comment.