qcow2: Return real error code in qcow2_read_snapshots

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
This commit is contained in:
Kevin Wolf 2011-11-16 11:43:28 +01:00
parent a968168c58
commit 42deb29fed
2 changed files with 23 additions and 7 deletions

View file

@ -273,8 +273,9 @@ static int qcow2_open(BlockDriverState *bs, int flags)
}
bs->backing_file[len] = '\0';
}
if (qcow2_read_snapshots(bs) < 0) {
ret = -EINVAL;
ret = qcow2_read_snapshots(bs);
if (ret < 0) {
goto fail;
}