qcow2: Fix error path in qcow2_snapshot_load_tmp
authorKevin Wolf <kwolf@redhat.com>
Wed, 16 Nov 2011 16:30:33 +0000 (17:30 +0100)
committerKevin Wolf <kwolf@redhat.com>
Mon, 5 Dec 2011 13:51:36 +0000 (14:51 +0100)
commite3f652b33228e16e117a93fb919c4e1e4753f5a5
treeed0bc47d5b8fad689779ac4935bc18d6fdcf4497
parent9a4767809fe9ac184806bef38be2e2a84e451a65
qcow2: Fix error path in qcow2_snapshot_load_tmp

If the bdrv_read() of the snapshot's L1 table fails, return the right
error code and make sure that the old L1 table is still loaded and we
don't break the BlockDriverState completely.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
block/qcow2-snapshot.c