Skip to content
Snippets Groups Projects
Commit 065abf9f authored by Alberto Garcia's avatar Alberto Garcia Committed by Kevin Wolf
Browse files

commit: Make base read-only if there is an early failure


You can reproduce this by passing an invalid filter-node-name (like
"1234") to block-commit. In this case the base image is put in
read-write mode but is never reset back to read-only.

Signed-off-by: default avatarAlberto Garcia <berto@igalia.com>
Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
parent 265a7e54
No related branches found
No related tags found
No related merge requests found
......@@ -383,6 +383,9 @@ fail:
if (s->top) {
blk_unref(s->top);
}
if (s->base_read_only) {
bdrv_reopen_set_read_only(base, true, NULL);
}
job_early_fail(&s->common.job);
/* commit_top_bs has to be replaced after deleting the block job,
* otherwise this would fail because of lack of permissions. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment