propagate write_refcount_block_entries error
PATCH 1/1 propagate write_refcount_block_entries error
Signed-off-by Juan Quintela <[email protected]>
--- block/qcow2-refcount.c | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-)
block/qcow2-refcount.c +8 -8
@@ -460,10 +460,10 @@ static int QEMU_WARN_UNUSED_RESULT update_refcount(BlockDriverState *bs, table_index = cluster_index >> (s->cluster_bits -REFCOUNT_SHIFT );if ((old_table_index >=0 ) && (table_index != old_table_index)) { -if (write_refcount_block_entries (bs, refcount_block_offset, - first_index, last_index) <0 ) - { -return -EIO ; + ret =write_refcount_block_entries (bs, refcount_block_offset, + first_index, last_index); +if (ret <0 ) { +return ret; } first_index =-1 ;
@@ -505,10 +505,10 @@ fail:/* Write last changed block to disk */ if (refcount_block_offset !=0 ) { -if (write_refcount_block_entries (bs, refcount_block_offset, - first_index, last_index) <0 ) - { -return ret <0 ? ret : -EIO ; +int write_ret =write_refcount_block_entries (bs, refcount_block_offset, + first_index, last_index); +if (write_ret <0 ){ +return ret <0 ? ret : write_ret; } }
Signature · 1 line
1.6.6.1
Am 01.06.2010 16:11, schrieb Juan Quintela:
Quoted 29 lines
Signed-off-by Juan Quintela <[email protected]>--- block/qcow2-refcount.c | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-)block/qcow2-refcount.c +4
-5@@ -460,10 +460,10 @@ static int QEMU_WARN_UNUSED_RESULT update_refcount(BlockDriverState *bs, table_index = cluster_index >> (s->cluster_bits -REFCOUNT_SHIFT );if ((old_table_index >=0 ) && (table_index != old_table_index)) { -if (write_refcount_block_entries (bs, refcount_block_offset, - first_index, last_index) <0 ) - { -return -EIO ; + ret =write_refcount_block_entries (bs, refcount_block_offset, + first_index, last_index); +if (ret <0 ) { +return ret; } first_index =-1 ;@@ -505,10 +505,10 @@ fail:/* Write last changed block to disk */ if (refcount_block_offset !=0 ) { - if (write_refcount_block_entries(bs, refcount_block_offset,
block/qcow2-refcount.c fail: · line 514
Quoted 10 lines
block/qcow2-refcount.c +4
-3- first_index, last_index) < 0) - { -return ret <0 ? ret : -EIO ; +int write_ret =write_refcount_block_entries (bs, refcount_block_offset, + first_index, last_index); +if (write_ret <0 ){ +return ret <0 ? ret : write_ret; } }
Something similar (but more complete) is already queued:
http://repo.or.cz/w/qemu/kevin.git/commitdiff/b10200c1
Thanks anyway, the idea is the right one. :-)
Kevin