Message ID | 1587407806-109784-5-git-send-email-andrey.shinkevich@virtuozzo.com |
---|---|
State | New |
Headers | show |
Series | Apply COR-filter to the block-stream permanently | expand |
Some information about why we need it would be nice. Still I see same function in commit.c, so most probably it's OK. 20.04.2020 21:36, Andrey Shinkevich wrote: > Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com> > --- > 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, >
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,
Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com> --- block/copy-on-read.c | 7 +++++++ 1 file changed, 7 insertions(+)