]> Git Repo - qemu.git/commitdiff
qcow2: Return 0/-errno in write_l2_entries
authorKevin Wolf <[email protected]>
Tue, 23 Mar 2010 11:49:17 +0000 (12:49 +0100)
committerKevin Wolf <[email protected]>
Fri, 23 Apr 2010 14:08:46 +0000 (16:08 +0200)
Change write_l2_entries to return the real error code instead of -1.

Signed-off-by: Kevin Wolf <[email protected]>
block/qcow2-cluster.c

index 8cb4b38d20770602cc62e1c8e6d7572647a83630..2f37acdb6b935ff89059de6e5099ee52d4813a9f 100644 (file)
@@ -627,12 +627,13 @@ static int write_l2_entries(BDRVQcowState *s, uint64_t *l2_table,
     int start_offset = (8 * l2_index) & ~511;
     int end_offset = (8 * (l2_index + num) + 511) & ~511;
     size_t len = end_offset - start_offset;
+    int ret;
 
     BLKDBG_EVENT(s->hd, BLKDBG_L2_UPDATE);
-    if (bdrv_pwrite(s->hd, l2_offset + start_offset, &l2_table[l2_start_index],
-        len) != len)
-    {
-        return -1;
+    ret = bdrv_pwrite(s->hd, l2_offset + start_offset,
+        &l2_table[l2_start_index], len);
+    if (ret < 0) {
+        return ret;
     }
 
     return 0;
This page took 0.028524 seconds and 4 git commands to generate.