From: Stefan Hajnoczi <stefa...@redhat.com> The BLOCK_OP_TYPE_INTERNAL_SNAPSHOT op blocker exists but was never used! Let's fix that so internal snapshots can be blocked.
[Fixed s/external/internal/ typo as pointed out by Paolo Bonzini and Max Reitz. --Stefan] Signed-off-by: Stefan Hajnoczi <stefa...@redhat.com> Reviewed-by: Max Reitz <mre...@redhat.com> Message-id: 1416566940-4430-5-git-send-email-stefa...@redhat.com Signed-off-by: Kevin Wolf <kw...@redhat.com> --- blockdev.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/blockdev.c b/blockdev.c index ea59c39..5651a8e 100644 --- a/blockdev.c +++ b/blockdev.c @@ -1250,6 +1250,10 @@ static void internal_snapshot_prepare(BlkTransactionState *common, return; } + if (bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_INTERNAL_SNAPSHOT, errp)) { + return; + } + if (bdrv_is_read_only(bs)) { error_set(errp, QERR_DEVICE_IS_READ_ONLY, device); return; -- 1.8.3.1