[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 02/10] qcow2: Fix error handling in qcow_save_vms
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH v2 02/10] qcow2: Fix error handling in qcow_save_vmstate |
Date: |
Wed, 20 Jan 2010 15:02:59 +0100 |
Don't assume success but pass the bdrv_pwrite return value on.
Signed-off-by: Kevin Wolf <address@hidden>
---
block/qcow2.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/block/qcow2.c b/block/qcow2.c
index 6622eba..e06f4dd 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,
--
1.6.5.2
- [Qemu-devel] [PATCH v2 00/10] qcow2 error path fixes, Kevin Wolf, 2010/01/20
- [Qemu-devel] [PATCH v2 01/10] qcow2: Fix error handling in qcow2_grow_l1_table, Kevin Wolf, 2010/01/20
- [Qemu-devel] [PATCH v2 02/10] qcow2: Fix error handling in qcow_save_vmstate,
Kevin Wolf <=
- [Qemu-devel] [PATCH v2 03/10] qcow2: Return 0/-errno in get_cluster_table, Kevin Wolf, 2010/01/20
- [Qemu-devel] [PATCH v2 05/10] block: Return original error codes in bdrv_pread/write, Kevin Wolf, 2010/01/20
- [Qemu-devel] [PATCH v2 06/10] qcow2: Fix error handling in grow_refcount_table, Kevin Wolf, 2010/01/20
- [Qemu-devel] [PATCH v2 04/10] qcow2: Return 0/-errno in qcow2_alloc_cluster_offset, Kevin Wolf, 2010/01/20
- [Qemu-devel] [PATCH v2 07/10] qcow2: Improve error handling in update_refcount, Kevin Wolf, 2010/01/20
- [Qemu-devel] [PATCH v2 08/10] qcow2: Allow updating no refcounts, Kevin Wolf, 2010/01/20
- [Qemu-devel] [PATCH v2 09/10] qcow2: Don't ignore update_refcount return value, Kevin Wolf, 2010/01/20
- [Qemu-devel] [PATCH v2 10/10] qcow2: Don't ignore qcow2_alloc_clusters return value, Kevin Wolf, 2010/01/20