qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] propagate write_refcount_block_entries error
@ 2010-06-01 14:11 Juan Quintela
  2010-06-01 14:38 ` [Qemu-devel] " Kevin Wolf
  0 siblings, 1 reply; 2+ messages in thread
From: Juan Quintela @ 2010-06-01 14:11 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf


Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 block/qcow2-refcount.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c
index 744107c..4226dce 100644
--- a/block/qcow2-refcount.c
+++ b/block/qcow2-refcount.c
@@ -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;
         }
     }

-- 
1.6.6.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Qemu-devel] Re: [PATCH] propagate write_refcount_block_entries error
  2010-06-01 14:11 [Qemu-devel] [PATCH] propagate write_refcount_block_entries error Juan Quintela
@ 2010-06-01 14:38 ` Kevin Wolf
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Wolf @ 2010-06-01 14:38 UTC (permalink / raw)
  To: Juan Quintela; +Cc: qemu-devel

Am 01.06.2010 16:11, schrieb Juan Quintela:
> Signed-off-by: Juan Quintela <quintela@redhat.com>
> ---
>  block/qcow2-refcount.c |   16 ++++++++--------
>  1 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c
> index 744107c..4226dce 100644
> --- a/block/qcow2-refcount.c
> +++ b/block/qcow2-refcount.c
> @@ -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;
>          }
>      }
> 

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-06-01 14:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-01 14:11 [Qemu-devel] [PATCH] propagate write_refcount_block_entries error Juan Quintela
2010-06-01 14:38 ` [Qemu-devel] " Kevin Wolf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).