[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 14/26] qcow2: Return 0/-errno in write_l1_entry
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 14/26] qcow2: Return 0/-errno in write_l1_entry |
Date: |
Fri, 23 Apr 2010 17:30:46 +0200 |
Change write_l1_entry to return the real error code instead of -1.
Signed-off-by: Kevin Wolf <address@hidden>
---
block/qcow2-cluster.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
index d2774d1..d5c52a9 100644
--- a/block/qcow2-cluster.c
+++ b/block/qcow2-cluster.c
@@ -193,7 +193,7 @@ static int write_l1_entry(BDRVQcowState *s, int l1_index)
{
uint64_t buf[L1_ENTRIES_PER_SECTOR];
int l1_start_index;
- int i;
+ int i, ret;
l1_start_index = l1_index & ~(L1_ENTRIES_PER_SECTOR - 1);
for (i = 0; i < L1_ENTRIES_PER_SECTOR; i++) {
@@ -201,10 +201,10 @@ static int write_l1_entry(BDRVQcowState *s, int l1_index)
}
BLKDBG_EVENT(s->hd, BLKDBG_L1_UPDATE);
- if (bdrv_pwrite(s->hd, s->l1_table_offset + 8 * l1_start_index,
- buf, sizeof(buf)) != sizeof(buf))
- {
- return -1;
+ ret = bdrv_pwrite(s->hd, s->l1_table_offset + 8 * l1_start_index,
+ buf, sizeof(buf));
+ if (ret < 0) {
+ return ret;
}
return 0;
--
1.6.6.1
- [Qemu-devel] [PATCH 05/26] Make qemu-config available for tools, (continued)
- [Qemu-devel] [PATCH 05/26] Make qemu-config available for tools, Kevin Wolf, 2010/04/23
- [Qemu-devel] [PATCH 06/26] blkdebug: Add events and rules, Kevin Wolf, 2010/04/23
- [Qemu-devel] [PATCH 08/26] qcow2: Fix creation of large images, Kevin Wolf, 2010/04/23
- [Qemu-devel] [PATCH 09/26] Replace calls of old bdrv_open, Kevin Wolf, 2010/04/23
- [Qemu-devel] [PATCH 13/26] qcow2: Fix error return code in qcow2_alloc_cluster_link_l2, Kevin Wolf, 2010/04/23
- [Qemu-devel] [PATCH 10/26] block: get rid of the BDRV_O_FILE flag, Kevin Wolf, 2010/04/23
- [Qemu-devel] [PATCH 12/26] qcow2: Return 0/-errno in write_l2_entries, Kevin Wolf, 2010/04/23
- [Qemu-devel] [PATCH 07/26] qcow2: Trigger blkdebug events, Kevin Wolf, 2010/04/23
- [Qemu-devel] [PATCH 11/26] block: split raw_getlength, Kevin Wolf, 2010/04/23
- [Qemu-devel] [PATCH 15/26] qcow2: Return 0/-errno in l2_allocate, Kevin Wolf, 2010/04/23
- [Qemu-devel] [PATCH 14/26] qcow2: Return 0/-errno in write_l1_entry,
Kevin Wolf <=
- [Qemu-devel] [PATCH 17/26] block: Do not export bdrv_first, Kevin Wolf, 2010/04/23
- [Qemu-devel] [PATCH 16/26] cleanup block driver option handling in vl.c, Kevin Wolf, 2010/04/23
- [Qemu-devel] [PATCH 18/26] block: Convert bdrv_first to QTAILQ, Kevin Wolf, 2010/04/23
- [Qemu-devel] [PATCH 21/26] block: Convert first_drv to QLIST, Kevin Wolf, 2010/04/23
- [Qemu-devel] [PATCH 19/26] Remove un-needed code, Kevin Wolf, 2010/04/23
- [Qemu-devel] [PATCH 20/26] block.h: bdrv_create2 doesn't exist any more, Kevin Wolf, 2010/04/23
- [Qemu-devel] [PATCH 22/26] qemu-img: Eliminate bdrv_new_open() code duplication, Kevin Wolf, 2010/04/23
- [Qemu-devel] [PATCH 23/26] qemu-img: Fix BRDV_O_FLAGS typo, Kevin Wolf, 2010/04/23
- [Qemu-devel] [PATCH 24/26] linux-aio: Fix typo in read() EINTR check, Kevin Wolf, 2010/04/23
- [Qemu-devel] [PATCH 25/26] qcow2: Use QLIST_FOREACH_SAFE macro, Kevin Wolf, 2010/04/23