diff options
author | Kevin Wolf <kwolf@redhat.com> | 2010-01-20 15:02:59 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2010-01-26 14:59:19 -0600 |
commit | 1d36e3aae338a71ba449f561b6343bb313f70968 (patch) | |
tree | f9133da3306512ae817f6dc84a3804f0274d7c00 /block/qcow2.c | |
parent | fb8fa77ce143b0911658b4bcbe641c869e26ceee (diff) |
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>
Diffstat (limited to 'block/qcow2.c')
-rw-r--r-- | block/qcow2.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/block/qcow2.c b/block/qcow2.c index 6622ebadb0..e06f4dd3c1 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -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, |