qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 4/7] copy-on-read: Support refreshing filename


From: Andrey Shinkevich
Subject: [PATCH 4/7] copy-on-read: Support refreshing filename
Date: Mon, 20 Apr 2020 21:36:43 +0300

Signed-off-by: Andrey Shinkevich <address@hidden>
---
 block/copy-on-read.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/block/copy-on-read.c b/block/copy-on-read.c
index ad6577d..e45eab9 100644
--- a/block/copy-on-read.c
+++ b/block/copy-on-read.c
@@ -21,6 +21,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/cutils.h"
 #include "block/block_int.h"
 #include "qemu/module.h"
 
@@ -141,6 +142,11 @@ static bool 
cor_recurse_is_first_non_filter(BlockDriverState *bs,
     return bdrv_recurse_is_first_non_filter(bs->file->bs, candidate);
 }
 
+static void cor_refresh_filename(BlockDriverState *bs)
+{
+    pstrcpy(bs->exact_filename, sizeof(bs->exact_filename),
+            bs->file->bs->filename);
+}
 
 static BlockDriver bdrv_copy_on_read = {
     .format_name                        = "copy-on-read",
@@ -161,6 +167,7 @@ static BlockDriver bdrv_copy_on_read = {
     .bdrv_lock_medium                   = cor_lock_medium,
 
     .bdrv_recurse_is_first_non_filter   = cor_recurse_is_first_non_filter,
+    .bdrv_refresh_filename              = cor_refresh_filename,
 
     .has_variable_length                = true,
     .is_filter                          = true,
-- 
1.8.3.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]