[Qemu-devel] [PATCH v2 1/3] block: implement bdrv_snapshot_goto for blkreplay

Pavel Dovgalyuk posted 3 patches 8 years, 8 months ago
[Qemu-devel] [PATCH v2 1/3] block: implement bdrv_snapshot_goto for blkreplay
Posted by Pavel Dovgalyuk 8 years, 8 months ago
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.

v2: updated commit message

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

diff --git a/block/blkreplay.c b/block/blkreplay.c
index cfc8c5b..ddcf344 100644
--- a/block/blkreplay.c
+++ b/block/blkreplay.c
@@ -130,6 +130,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);
+}
+
 static BlockDriver bdrv_blkreplay = {
     .format_name            = "blkreplay",
     .protocol_name          = "blkreplay",
@@ -145,6 +151,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)


Re: [Qemu-devel] [PATCH v2 1/3] block: implement bdrv_snapshot_goto for blkreplay
Posted by Eric Blake 8 years, 8 months ago
On 02/28/2017 04:55 AM, Pavel Dovgalyuk wrote:

[meta-comment]

> 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.
> 
> v2: updated commit message

The v2 information...

> 
> Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>
> ---

...fits best here. Anything after the --- is stripped by 'git am',
making it ideal for information that is useful to the reviewers but not
important to a long-term reader (a year from now, we won't care if it
was v2 or v10 that was committed, because git only stores the version
that was checked in, and not the iterations prior to it).

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org