mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
block: Add BlockDriver.bdrv_check_ext_snapshot.
This field is used by blkverify to disable external snapshots creation. It will also be used by block filters like quorum to disable external snapshot creation. Signed-off-by: Benoit Canet <benoit@irqsave.net> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
92bc50a5ad
commit
f6186f49e2
5 changed files with 46 additions and 0 deletions
19
block.c
19
block.c
|
@ -4647,3 +4647,22 @@ int bdrv_amend_options(BlockDriverState *bs, QEMUOptionParameter *options)
|
|||
}
|
||||
return bs->drv->bdrv_amend_options(bs, options);
|
||||
}
|
||||
|
||||
ExtSnapshotPerm bdrv_check_ext_snapshot(BlockDriverState *bs)
|
||||
{
|
||||
if (bs->drv->bdrv_check_ext_snapshot) {
|
||||
return bs->drv->bdrv_check_ext_snapshot(bs);
|
||||
}
|
||||
|
||||
if (bs->file && bs->file->drv && bs->file->drv->bdrv_check_ext_snapshot) {
|
||||
return bs->file->drv->bdrv_check_ext_snapshot(bs);
|
||||
}
|
||||
|
||||
/* external snapshots are allowed by default */
|
||||
return EXT_SNAPSHOT_ALLOWED;
|
||||
}
|
||||
|
||||
ExtSnapshotPerm bdrv_check_ext_snapshot_forbidden(BlockDriverState *bs)
|
||||
{
|
||||
return EXT_SNAPSHOT_FORBIDDEN;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue