qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 12/12] commit: Implement .bdrv_refresh_filename
Date: Mon, 13 Mar 2017 15:55:08 +0100	[thread overview]
Message-ID: <1489416908-3771-13-git-send-email-kwolf@redhat.com> (raw)
In-Reply-To: <1489416908-3771-1-git-send-email-kwolf@redhat.com>

We want query-block to return the right filename, even if a commit job
put a bdrv_commit_top on top of the actual image format driver. Let
bdrv_commit_top.bdrv_refresh_filename get the filename from its backing
file.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
---
 block/commit.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/block/commit.c b/block/commit.c
index 932d1e6..2832482 100644
--- a/block/commit.c
+++ b/block/commit.c
@@ -13,6 +13,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/cutils.h"
 #include "trace.h"
 #include "block/block_int.h"
 #include "block/blockjob_int.h"
@@ -242,6 +243,12 @@ static int64_t coroutine_fn bdrv_commit_top_get_block_status(
            (sector_num << BDRV_SECTOR_BITS);
 }
 
+static void bdrv_commit_top_refresh_filename(BlockDriverState *bs, QDict *opts)
+{
+    bdrv_refresh_filename(bs->backing->bs);
+    pstrcpy(bs->exact_filename, sizeof(bs->exact_filename),
+            bs->backing->bs->filename);
+}
 
 static void bdrv_commit_top_close(BlockDriverState *bs)
 {
@@ -262,6 +269,7 @@ static BlockDriver bdrv_commit_top = {
     .format_name                = "commit_top",
     .bdrv_co_preadv             = bdrv_commit_top_preadv,
     .bdrv_co_get_block_status   = bdrv_commit_top_get_block_status,
+    .bdrv_refresh_filename      = bdrv_commit_top_refresh_filename,
     .bdrv_close                 = bdrv_commit_top_close,
     .bdrv_child_perm            = bdrv_commit_top_child_perm,
 };
-- 
1.8.3.1

  parent reply	other threads:[~2017-03-13 14:55 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-13 14:54 [Qemu-devel] [PULL 00/12] Block layer fixes for 2.9.0-rc1 Kevin Wolf
2017-03-13 14:54 ` [Qemu-devel] [PULL 01/12] backup: allow target without .bdrv_get_info Kevin Wolf
2017-03-13 14:54 ` [Qemu-devel] [PULL 02/12] file-posix: Consider max_segments for BlockLimits.max_transfer Kevin Wolf
2017-03-13 14:54 ` [Qemu-devel] [PULL 03/12] block: Drop unmaintained 'archipelago' driver Kevin Wolf
2017-03-13 14:55 ` [Qemu-devel] [PULL 04/12] backup: React to bdrv_is_allocated() errors Kevin Wolf
2017-03-13 14:55 ` [Qemu-devel] [PULL 05/12] vvfat: " Kevin Wolf
2017-03-13 14:55 ` [Qemu-devel] [PULL 06/12] migration: Document handling of " Kevin Wolf
2017-03-13 14:55 ` [Qemu-devel] [PULL 07/12] block: Remove check_new_perm from bdrv_replace_child() Kevin Wolf
2017-03-13 14:55 ` [Qemu-devel] [PULL 08/12] block: Request block status from *file for BDRV_BLOCK_RAW Kevin Wolf
2017-03-13 14:55 ` [Qemu-devel] [PULL 09/12] commit: Implement bdrv_commit_top.bdrv_co_get_block_status Kevin Wolf
2017-03-13 14:55 ` [Qemu-devel] [PULL 10/12] block: Refresh filename after changing backing file Kevin Wolf
2017-03-13 14:55 ` [Qemu-devel] [PULL 11/12] mirror: Implement .bdrv_refresh_filename Kevin Wolf
2017-03-13 14:55 ` Kevin Wolf [this message]
2017-03-13 18:05 ` [Qemu-devel] [PULL 00/12] Block layer fixes for 2.9.0-rc1 Peter Maydell
2017-03-14  9:29   ` Kevin Wolf
2017-03-14  9:51     ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1489416908-3771-13-git-send-email-kwolf@redhat.com \
    --to=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).