提交 1d36e3aa 编写于 作者: K Kevin Wolf 提交者: Anthony Liguori

qcow2: Fix error handling in qcow_save_vmstate

Don't assume success but pass the bdrv_pwrite return value on.
Signed-off-by: NKevin Wolf <kwolf@redhat.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 fb8fa77c
......@@ -1163,12 +1163,13 @@ static int qcow_save_vmstate(BlockDriverState *bs, const uint8_t *buf,
{
BDRVQcowState *s = bs->opaque;
int growable = bs->growable;
int ret;
bs->growable = 1;
bdrv_pwrite(bs, qcow_vm_state_offset(s) + pos, buf, size);
ret = bdrv_pwrite(bs, qcow_vm_state_offset(s) + pos, buf, size);
bs->growable = growable;
return size;
return ret;
}
static int qcow_load_vmstate(BlockDriverState *bs, uint8_t *buf,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册