Patchwork qcow2: Don't ignore failure to clear autoclear flags

login
register
mail settings
Submitter Kevin Wolf
Date May 11, 2012, 1:43 p.m.
Message ID <1336743829-15951-1-git-send-email-kwolf@redhat.com>
Download mbox | patch
Permalink /patch/158525/
State New
Headers show

Comments

Kevin Wolf - May 11, 2012, 1:43 p.m.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/qcow2.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

Patch

diff --git a/block/qcow2.c b/block/qcow2.c
index 3bae2d8..655799c 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -300,7 +300,10 @@  static int qcow2_open(BlockDriverState *bs, int flags)
 
     if (!bs->read_only && s->autoclear_features != 0) {
         s->autoclear_features = 0;
-        qcow2_update_header(bs);
+        ret = qcow2_update_header(bs);
+        if (ret < 0) {
+            goto fail;
+        }
     }
 
     /* Check support for various header values */