diff options
author | Kevin Wolf <kwolf@redhat.com> | 2010-03-23 17:28:22 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2010-04-23 16:08:46 +0200 |
commit | f7defcb62792eff05fa8a7ffec6a927a88087b83 (patch) | |
tree | c595fe71fa7e6bf22cf9eef056f094b2552c8877 /block/qcow2-cluster.c | |
parent | c835d00fc8d6c23af7e9182981ef7a07f1c6d12c (diff) |
qcow2: Return 0/-errno in write_l1_entry
Change write_l1_entry to return the real error code instead of -1.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/qcow2-cluster.c')
-rw-r--r-- | 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 d2774d19ca..d5c52a9bfa 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; |