block: qcow2: remove the created file on initialization error
commit6094cbeb72117204f3302a4581415ee1dc33a879
authorMaxim Levitsky <mlevitsk@redhat.com>
Thu, 17 Dec 2020 17:09:04 +0000 (17 19:09 +0200)
committerKevin Wolf <kwolf@redhat.com>
Mon, 15 Feb 2021 14:10:14 +0000 (15 15:10 +0100)
tree2581645d9cb03b067cb8b3906f4929d02db83771
parenta890f08e586fd81946c51dae6a878d64486b1364
block: qcow2: remove the created file on initialization error

If the qcow initialization fails, we should remove the file if it was
already created, to avoid leaving stale files around.

We already do this for luks raw images.

Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Message-Id: <20201217170904.946013-4-mlevitsk@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/qcow2.c