diff mbox series

[01/22] blockdev: Allow external snapshots everywhere

Message ID 20190920152804.12875-2-mreitz@redhat.com (mailing list archive)
State New, archived
Headers show
Series block: Fix check_to_replace_node() | expand

Commit Message

Max Reitz Sept. 20, 2019, 3:27 p.m. UTC
There is no good reason why we would allow external snapshots only on
the first non-filter node in a chain.  Parent BDSs should not care
whether their child is replaced by a snapshot.  (If they do care, they
should announce that via freezing the chain, which is checked in
bdrv_append() through bdrv_set_backing_hd().)

Before we had bdrv_is_first_non_filter() here (since 212a5a8f095), there
was a special function bdrv_check_ext_snapshot() that allowed snapshots
by default, but block drivers could override this.  Only blkverify did
so, however.

It is not clear to me why blkverify would do so; maybe just so that the
testee block driver would not be replaced.  The introducing commit
f6186f49e2c does not explain why.  Maybe because 08b24cfe376 would have
been the correct solution?  (Which adds a .supports_backing check.)

Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 blockdev.c | 5 -----
 1 file changed, 5 deletions(-)

Comments

Vladimir Sementsov-Ogievskiy Sept. 25, 2019, 11:45 a.m. UTC | #1
20.09.2019 18:27, Max Reitz wrote:
> There is no good reason why we would allow external snapshots only on
> the first non-filter node in a chain.  Parent BDSs should not care
> whether their child is replaced by a snapshot.  (If they do care, they
> should announce that via freezing the chain, which is checked in
> bdrv_append() through bdrv_set_backing_hd().)
> 
> Before we had bdrv_is_first_non_filter() here (since 212a5a8f095), there
> was a special function bdrv_check_ext_snapshot() that allowed snapshots
> by default, but block drivers could override this.  Only blkverify did
> so, however.
> 
> It is not clear to me why blkverify would do so; maybe just so that the
> testee block driver would not be replaced.  The introducing commit
> f6186f49e2c does not explain why.  Maybe because 08b24cfe376 would have
> been the correct solution?  (Which adds a .supports_backing check.)
> 
> Signed-off-by: Max Reitz<mreitz@redhat.com>

Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
diff mbox series

Patch

diff --git a/blockdev.c b/blockdev.c
index f89e48fc79..b62b33dc03 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -1596,11 +1596,6 @@  static void external_snapshot_prepare(BlkActionState *common,
         }
     }
 
-    if (!bdrv_is_first_non_filter(state->old_bs)) {
-        error_setg(errp, QERR_FEATURE_DISABLED, "snapshot");
-        goto out;
-    }
-
     if (action->type == TRANSACTION_ACTION_KIND_BLOCKDEV_SNAPSHOT_SYNC) {
         BlockdevSnapshotSync *s = action->u.blockdev_snapshot_sync.data;
         const char *format = s->has_format ? s->format : "qcow2";