qcow2: Fix error handling in qcow_save_vmstate
Don't assume success but pass the bdrv_pwrite return value on.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 1d36e3aae3
)
This commit is contained in:
parent
cb2ae96bf6
commit
f48aba6de7
|
@ -1056,12 +1056,13 @@ static int qcow_save_vmstate(BlockDriverState *bs, const uint8_t *buf,
|
||||||
{
|
{
|
||||||
BDRVQcowState *s = bs->opaque;
|
BDRVQcowState *s = bs->opaque;
|
||||||
int growable = bs->growable;
|
int growable = bs->growable;
|
||||||
|
int ret;
|
||||||
|
|
||||||
bs->growable = 1;
|
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;
|
bs->growable = growable;
|
||||||
|
|
||||||
return size;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int qcow_load_vmstate(BlockDriverState *bs, uint8_t *buf,
|
static int qcow_load_vmstate(BlockDriverState *bs, uint8_t *buf,
|
||||||
|
|
Loading…
Reference in New Issue