Skip to content

Commit

Permalink
blockdev: check for BLOCK_OP_TYPE_INTERNAL_SNAPSHOT
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Max Reitz <[email protected]>
Message-id: [email protected]
Signed-off-by: Kevin Wolf <[email protected]>
  • Loading branch information
stefanhaRH authored and kevmw committed Dec 10, 2014
1 parent 5d6e96e commit 3dc7ca3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions blockdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3dc7ca3

Please sign in to comment.