Blame SOURCES/kvm-block-Add-Error-parameter-to-bdrv_amend_options.patch

1bdc94
From e01a2ccba2a784caad5192f8d1e4b37ae1d65bed Mon Sep 17 00:00:00 2001
1bdc94
From: Max Reitz <mreitz@redhat.com>
1bdc94
Date: Mon, 18 Jun 2018 14:59:38 +0200
1bdc94
Subject: [PATCH 04/89] block: Add Error parameter to bdrv_amend_options
1bdc94
1bdc94
RH-Author: Max Reitz <mreitz@redhat.com>
1bdc94
Message-id: <20180618145943.4489-3-mreitz@redhat.com>
1bdc94
Patchwork-id: 80755
1bdc94
O-Subject: [RHV-7.6 qemu-kvm-rhev PATCH 2/7] block: Add Error parameter to bdrv_amend_options
1bdc94
Bugzilla: 1537956
1bdc94
RH-Acked-by: John Snow <jsnow@redhat.com>
1bdc94
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
1bdc94
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
1bdc94
1bdc94
Looking at the qcow2 code that is riddled with error_report() calls,
1bdc94
this is really how it should have been from the start.
1bdc94
1bdc94
Along the way, turn the target_version/current_version comparisons at
1bdc94
the beginning of qcow2_downgrade() into assertions (the caller has to
1bdc94
make sure these conditions are met), and rephrase the error message on
1bdc94
using compat=1.1 to get refcount widths other than 16 bits.
1bdc94
1bdc94
Signed-off-by: Max Reitz <mreitz@redhat.com>
1bdc94
Message-id: 20180509210023.20283-3-mreitz@redhat.com
1bdc94
Reviewed-by: Eric Blake <eblake@redhat.com>
1bdc94
Reviewed-by: John Snow <jsnow@redhat.com>
1bdc94
Signed-off-by: Max Reitz <mreitz@redhat.com>
1bdc94
(cherry picked from commit d1402b502691142b9cebadd5cb993dc8858e9071)
1bdc94
Signed-off-by: Max Reitz <mreitz@redhat.com>
1bdc94
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
1bdc94
---
1bdc94
 block.c                    |  8 ++++--
1bdc94
 block/qcow2.c              | 72 ++++++++++++++++++++++++++--------------------
1bdc94
 include/block/block.h      |  3 +-
1bdc94
 include/block/block_int.h  |  3 +-
1bdc94
 qemu-img.c                 |  4 +--
1bdc94
 tests/qemu-iotests/060.out |  4 +--
1bdc94
 tests/qemu-iotests/061.out |  7 -----
1bdc94
 tests/qemu-iotests/080.out |  4 +--
1bdc94
 tests/qemu-iotests/112.out |  5 +---
1bdc94
 9 files changed, 58 insertions(+), 52 deletions(-)
1bdc94
1bdc94
diff --git a/block.c b/block.c
1bdc94
index 982d54e..d991a09 100644
1bdc94
--- a/block.c
1bdc94
+++ b/block.c
1bdc94
@@ -5008,15 +5008,19 @@ void bdrv_remove_aio_context_notifier(BlockDriverState *bs,
1bdc94
 }
1bdc94
 
1bdc94
 int bdrv_amend_options(BlockDriverState *bs, QemuOpts *opts,
1bdc94
-                       BlockDriverAmendStatusCB *status_cb, void *cb_opaque)
1bdc94
+                       BlockDriverAmendStatusCB *status_cb, void *cb_opaque,
1bdc94
+                       Error **errp)
1bdc94
 {
1bdc94
     if (!bs->drv) {
1bdc94
+        error_setg(errp, "Node is ejected");
1bdc94
         return -ENOMEDIUM;
1bdc94
     }
1bdc94
     if (!bs->drv->bdrv_amend_options) {
1bdc94
+        error_setg(errp, "Block driver '%s' does not support option amendment",
1bdc94
+                   bs->drv->format_name);
1bdc94
         return -ENOTSUP;
1bdc94
     }
1bdc94
-    return bs->drv->bdrv_amend_options(bs, opts, status_cb, cb_opaque);
1bdc94
+    return bs->drv->bdrv_amend_options(bs, opts, status_cb, cb_opaque, errp);
1bdc94
 }
1bdc94
 
1bdc94
 /* This function will be called by the bdrv_recurse_is_first_non_filter method
1bdc94
diff --git a/block/qcow2.c b/block/qcow2.c
1bdc94
index 26a6a7f..092db81 100644
1bdc94
--- a/block/qcow2.c
1bdc94
+++ b/block/qcow2.c
1bdc94
@@ -4039,22 +4039,21 @@ static int qcow2_load_vmstate(BlockDriverState *bs, QEMUIOVector *qiov,
1bdc94
  * have to be removed.
1bdc94
  */
1bdc94
 static int qcow2_downgrade(BlockDriverState *bs, int target_version,
1bdc94
-                           BlockDriverAmendStatusCB *status_cb, void *cb_opaque)
1bdc94
+                           BlockDriverAmendStatusCB *status_cb, void *cb_opaque,
1bdc94
+                           Error **errp)
1bdc94
 {
1bdc94
     BDRVQcow2State *s = bs->opaque;
1bdc94
     int current_version = s->qcow_version;
1bdc94
     int ret;
1bdc94
 
1bdc94
-    if (target_version == current_version) {
1bdc94
-        return 0;
1bdc94
-    } else if (target_version > current_version) {
1bdc94
-        return -EINVAL;
1bdc94
-    } else if (target_version != 2) {
1bdc94
-        return -EINVAL;
1bdc94
-    }
1bdc94
+    /* This is qcow2_downgrade(), not qcow2_upgrade() */
1bdc94
+    assert(target_version < current_version);
1bdc94
+
1bdc94
+    /* There are no other versions (now) that you can downgrade to */
1bdc94
+    assert(target_version == 2);
1bdc94
 
1bdc94
     if (s->refcount_order != 4) {
1bdc94
-        error_report("compat=0.10 requires refcount_bits=16");
1bdc94
+        error_setg(errp, "compat=0.10 requires refcount_bits=16");
1bdc94
         return -ENOTSUP;
1bdc94
     }
1bdc94
 
1bdc94
@@ -4062,6 +4061,7 @@ static int qcow2_downgrade(BlockDriverState *bs, int target_version,
1bdc94
     if (s->incompatible_features & QCOW2_INCOMPAT_DIRTY) {
1bdc94
         ret = qcow2_mark_clean(bs);
1bdc94
         if (ret < 0) {
1bdc94
+            error_setg_errno(errp, -ret, "Failed to make the image clean");
1bdc94
             return ret;
1bdc94
         }
1bdc94
     }
1bdc94
@@ -4071,6 +4071,8 @@ static int qcow2_downgrade(BlockDriverState *bs, int target_version,
1bdc94
      * best thing to do anyway */
1bdc94
 
1bdc94
     if (s->incompatible_features) {
1bdc94
+        error_setg(errp, "Cannot downgrade an image with incompatible features "
1bdc94
+                   "%#" PRIx64 " set", s->incompatible_features);
1bdc94
         return -ENOTSUP;
1bdc94
     }
1bdc94
 
1bdc94
@@ -4084,6 +4086,7 @@ static int qcow2_downgrade(BlockDriverState *bs, int target_version,
1bdc94
 
1bdc94
     ret = qcow2_expand_zero_clusters(bs, status_cb, cb_opaque);
1bdc94
     if (ret < 0) {
1bdc94
+        error_setg_errno(errp, -ret, "Failed to turn zero into data clusters");
1bdc94
         return ret;
1bdc94
     }
1bdc94
 
1bdc94
@@ -4091,6 +4094,7 @@ static int qcow2_downgrade(BlockDriverState *bs, int target_version,
1bdc94
     ret = qcow2_update_header(bs);
1bdc94
     if (ret < 0) {
1bdc94
         s->qcow_version = current_version;
1bdc94
+        error_setg_errno(errp, -ret, "Failed to update the image header");
1bdc94
         return ret;
1bdc94
     }
1bdc94
     return 0;
1bdc94
@@ -4168,7 +4172,8 @@ static void qcow2_amend_helper_cb(BlockDriverState *bs,
1bdc94
 
1bdc94
 static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts,
1bdc94
                                BlockDriverAmendStatusCB *status_cb,
1bdc94
-                               void *cb_opaque)
1bdc94
+                               void *cb_opaque,
1bdc94
+                               Error **errp)
1bdc94
 {
1bdc94
     BDRVQcow2State *s = bs->opaque;
1bdc94
     int old_version = s->qcow_version, new_version = old_version;
1bdc94
@@ -4180,7 +4185,6 @@ static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts,
1bdc94
     bool encrypt;
1bdc94
     int encformat;
1bdc94
     int refcount_bits = s->refcount_bits;
1bdc94
-    Error *local_err = NULL;
1bdc94
     int ret;
1bdc94
     QemuOptDesc *desc = opts->list->desc;
1bdc94
     Qcow2AmendHelperCBInfo helper_cb_info;
1bdc94
@@ -4201,11 +4205,11 @@ static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts,
1bdc94
             } else if (!strcmp(compat, "1.1")) {
1bdc94
                 new_version = 3;
1bdc94
             } else {
1bdc94
-                error_report("Unknown compatibility level %s", compat);
1bdc94
+                error_setg(errp, "Unknown compatibility level %s", compat);
1bdc94
                 return -EINVAL;
1bdc94
             }
1bdc94
         } else if (!strcmp(desc->name, BLOCK_OPT_PREALLOC)) {
1bdc94
-            error_report("Cannot change preallocation mode");
1bdc94
+            error_setg(errp, "Cannot change preallocation mode");
1bdc94
             return -ENOTSUP;
1bdc94
         } else if (!strcmp(desc->name, BLOCK_OPT_SIZE)) {
1bdc94
             new_size = qemu_opt_get_size(opts, BLOCK_OPT_SIZE, 0);
1bdc94
@@ -4218,7 +4222,8 @@ static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts,
1bdc94
                                         !!s->crypto);
1bdc94
 
1bdc94
             if (encrypt != !!s->crypto) {
1bdc94
-                error_report("Changing the encryption flag is not supported");
1bdc94
+                error_setg(errp,
1bdc94
+                           "Changing the encryption flag is not supported");
1bdc94
                 return -ENOTSUP;
1bdc94
             }
1bdc94
         } else if (!strcmp(desc->name, BLOCK_OPT_ENCRYPT_FORMAT)) {
1bdc94
@@ -4226,17 +4231,19 @@ static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts,
1bdc94
                 qemu_opt_get(opts, BLOCK_OPT_ENCRYPT_FORMAT));
1bdc94
 
1bdc94
             if (encformat != s->crypt_method_header) {
1bdc94
-                error_report("Changing the encryption format is not supported");
1bdc94
+                error_setg(errp,
1bdc94
+                           "Changing the encryption format is not supported");
1bdc94
                 return -ENOTSUP;
1bdc94
             }
1bdc94
         } else if (g_str_has_prefix(desc->name, "encrypt.")) {
1bdc94
-            error_report("Changing the encryption parameters is not supported");
1bdc94
+            error_setg(errp,
1bdc94
+                       "Changing the encryption parameters is not supported");
1bdc94
             return -ENOTSUP;
1bdc94
         } else if (!strcmp(desc->name, BLOCK_OPT_CLUSTER_SIZE)) {
1bdc94
             cluster_size = qemu_opt_get_size(opts, BLOCK_OPT_CLUSTER_SIZE,
1bdc94
                                              cluster_size);
1bdc94
             if (cluster_size != s->cluster_size) {
1bdc94
-                error_report("Changing the cluster size is not supported");
1bdc94
+                error_setg(errp, "Changing the cluster size is not supported");
1bdc94
                 return -ENOTSUP;
1bdc94
             }
1bdc94
         } else if (!strcmp(desc->name, BLOCK_OPT_LAZY_REFCOUNTS)) {
1bdc94
@@ -4249,8 +4256,8 @@ static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts,
1bdc94
             if (refcount_bits <= 0 || refcount_bits > 64 ||
1bdc94
                 !is_power_of_2(refcount_bits))
1bdc94
             {
1bdc94
-                error_report("Refcount width must be a power of two and may "
1bdc94
-                             "not exceed 64 bits");
1bdc94
+                error_setg(errp, "Refcount width must be a power of two and "
1bdc94
+                           "may not exceed 64 bits");
1bdc94
                 return -EINVAL;
1bdc94
             }
1bdc94
         } else {
1bdc94
@@ -4275,6 +4282,7 @@ static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts,
1bdc94
         ret = qcow2_update_header(bs);
1bdc94
         if (ret < 0) {
1bdc94
             s->qcow_version = old_version;
1bdc94
+            error_setg_errno(errp, -ret, "Failed to update the image header");
1bdc94
             return ret;
1bdc94
         }
1bdc94
     }
1bdc94
@@ -4283,18 +4291,17 @@ static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts,
1bdc94
         int refcount_order = ctz32(refcount_bits);
1bdc94
 
1bdc94
         if (new_version < 3 && refcount_bits != 16) {
1bdc94
-            error_report("Different refcount widths than 16 bits require "
1bdc94
-                         "compatibility level 1.1 or above (use compat=1.1 or "
1bdc94
-                         "greater)");
1bdc94
+            error_setg(errp, "Refcount widths other than 16 bits require "
1bdc94
+                       "compatibility level 1.1 or above (use compat=1.1 or "
1bdc94
+                       "greater)");
1bdc94
             return -EINVAL;
1bdc94
         }
1bdc94
 
1bdc94
         helper_cb_info.current_operation = QCOW2_CHANGING_REFCOUNT_ORDER;
1bdc94
         ret = qcow2_change_refcount_order(bs, refcount_order,
1bdc94
                                           &qcow2_amend_helper_cb,
1bdc94
-                                          &helper_cb_info, &local_err);
1bdc94
+                                          &helper_cb_info, errp);
1bdc94
         if (ret < 0) {
1bdc94
-            error_report_err(local_err);
1bdc94
             return ret;
1bdc94
         }
1bdc94
     }
1bdc94
@@ -4304,6 +4311,7 @@ static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts,
1bdc94
                     backing_file ?: s->image_backing_file,
1bdc94
                     backing_format ?: s->image_backing_format);
1bdc94
         if (ret < 0) {
1bdc94
+            error_setg_errno(errp, -ret, "Failed to change the backing file");
1bdc94
             return ret;
1bdc94
         }
1bdc94
     }
1bdc94
@@ -4311,14 +4319,16 @@ static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts,
1bdc94
     if (s->use_lazy_refcounts != lazy_refcounts) {
1bdc94
         if (lazy_refcounts) {
1bdc94
             if (new_version < 3) {
1bdc94
-                error_report("Lazy refcounts only supported with compatibility "
1bdc94
-                             "level 1.1 and above (use compat=1.1 or greater)");
1bdc94
+                error_setg(errp, "Lazy refcounts only supported with "
1bdc94
+                           "compatibility level 1.1 and above (use compat=1.1 "
1bdc94
+                           "or greater)");
1bdc94
                 return -EINVAL;
1bdc94
             }
1bdc94
             s->compatible_features |= QCOW2_COMPAT_LAZY_REFCOUNTS;
1bdc94
             ret = qcow2_update_header(bs);
1bdc94
             if (ret < 0) {
1bdc94
                 s->compatible_features &= ~QCOW2_COMPAT_LAZY_REFCOUNTS;
1bdc94
+                error_setg_errno(errp, -ret, "Failed to update the image header");
1bdc94
                 return ret;
1bdc94
             }
1bdc94
             s->use_lazy_refcounts = true;
1bdc94
@@ -4326,6 +4336,7 @@ static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts,
1bdc94
             /* make image clean first */
1bdc94
             ret = qcow2_mark_clean(bs);
1bdc94
             if (ret < 0) {
1bdc94
+                error_setg_errno(errp, -ret, "Failed to make the image clean");
1bdc94
                 return ret;
1bdc94
             }
1bdc94
             /* now disallow lazy refcounts */
1bdc94
@@ -4333,6 +4344,7 @@ static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts,
1bdc94
             ret = qcow2_update_header(bs);
1bdc94
             if (ret < 0) {
1bdc94
                 s->compatible_features |= QCOW2_COMPAT_LAZY_REFCOUNTS;
1bdc94
+                error_setg_errno(errp, -ret, "Failed to update the image header");
1bdc94
                 return ret;
1bdc94
             }
1bdc94
             s->use_lazy_refcounts = false;
1bdc94
@@ -4341,17 +4353,15 @@ static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts,
1bdc94
 
1bdc94
     if (new_size) {
1bdc94
         BlockBackend *blk = blk_new(BLK_PERM_RESIZE, BLK_PERM_ALL);
1bdc94
-        ret = blk_insert_bs(blk, bs, &local_err);
1bdc94
+        ret = blk_insert_bs(blk, bs, errp);
1bdc94
         if (ret < 0) {
1bdc94
-            error_report_err(local_err);
1bdc94
             blk_unref(blk);
1bdc94
             return ret;
1bdc94
         }
1bdc94
 
1bdc94
-        ret = blk_truncate(blk, new_size, PREALLOC_MODE_OFF, &local_err);
1bdc94
+        ret = blk_truncate(blk, new_size, PREALLOC_MODE_OFF, errp);
1bdc94
         blk_unref(blk);
1bdc94
         if (ret < 0) {
1bdc94
-            error_report_err(local_err);
1bdc94
             return ret;
1bdc94
         }
1bdc94
     }
1bdc94
@@ -4360,7 +4370,7 @@ static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts,
1bdc94
     if (new_version < old_version) {
1bdc94
         helper_cb_info.current_operation = QCOW2_DOWNGRADING;
1bdc94
         ret = qcow2_downgrade(bs, new_version, &qcow2_amend_helper_cb,
1bdc94
-                              &helper_cb_info);
1bdc94
+                              &helper_cb_info, errp);
1bdc94
         if (ret < 0) {
1bdc94
             return ret;
1bdc94
         }
1bdc94
diff --git a/include/block/block.h b/include/block/block.h
1bdc94
index 06cd772..2d17b09 100644
1bdc94
--- a/include/block/block.h
1bdc94
+++ b/include/block/block.h
1bdc94
@@ -343,7 +343,8 @@ int bdrv_check(BlockDriverState *bs, BdrvCheckResult *res, BdrvCheckMode fix);
1bdc94
 typedef void BlockDriverAmendStatusCB(BlockDriverState *bs, int64_t offset,
1bdc94
                                       int64_t total_work_size, void *opaque);
1bdc94
 int bdrv_amend_options(BlockDriverState *bs_new, QemuOpts *opts,
1bdc94
-                       BlockDriverAmendStatusCB *status_cb, void *cb_opaque);
1bdc94
+                       BlockDriverAmendStatusCB *status_cb, void *cb_opaque,
1bdc94
+                       Error **errp);
1bdc94
 
1bdc94
 /* external snapshots */
1bdc94
 bool bdrv_recurse_is_first_non_filter(BlockDriverState *bs,
1bdc94
diff --git a/include/block/block_int.h b/include/block/block_int.h
1bdc94
index c4dd1d4..d913ed1 100644
1bdc94
--- a/include/block/block_int.h
1bdc94
+++ b/include/block/block_int.h
1bdc94
@@ -324,7 +324,8 @@ struct BlockDriver {
1bdc94
 
1bdc94
     int (*bdrv_amend_options)(BlockDriverState *bs, QemuOpts *opts,
1bdc94
                               BlockDriverAmendStatusCB *status_cb,
1bdc94
-                              void *cb_opaque);
1bdc94
+                              void *cb_opaque,
1bdc94
+                              Error **errp);
1bdc94
 
1bdc94
     void (*bdrv_debug_event)(BlockDriverState *bs, BlkdebugEvent event);
1bdc94
 
1bdc94
diff --git a/qemu-img.c b/qemu-img.c
1bdc94
index 2f7c491..e40d6ff 100644
1bdc94
--- a/qemu-img.c
1bdc94
+++ b/qemu-img.c
1bdc94
@@ -3761,10 +3761,10 @@ static int img_amend(int argc, char **argv)
1bdc94
 
1bdc94
     /* In case the driver does not call amend_status_cb() */
1bdc94
     qemu_progress_print(0.f, 0);
1bdc94
-    ret = bdrv_amend_options(bs, opts, &amend_status_cb, NULL);
1bdc94
+    ret = bdrv_amend_options(bs, opts, &amend_status_cb, NULL, &err;;
1bdc94
     qemu_progress_print(100.f, 0);
1bdc94
     if (ret < 0) {
1bdc94
-        error_report("Error while amending options: %s", strerror(-ret));
1bdc94
+        error_report_err(err);
1bdc94
         goto out;
1bdc94
     }
1bdc94
 
1bdc94
diff --git a/tests/qemu-iotests/060.out b/tests/qemu-iotests/060.out
1bdc94
index 99234fb..bff023d 100644
1bdc94
--- a/tests/qemu-iotests/060.out
1bdc94
+++ b/tests/qemu-iotests/060.out
1bdc94
@@ -129,7 +129,7 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
1bdc94
 wrote 65536/65536 bytes at offset 0
1bdc94
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
1bdc94
 qcow2: Marking image as corrupt: L2 table offset 0x42a00 unaligned (L1 index: 0); further corruption events will be suppressed
1bdc94
-qemu-img: Error while amending options: Input/output error
1bdc94
+qemu-img: Failed to turn zero into data clusters: Input/output error
1bdc94
 
1bdc94
 === Testing unaligned L2 entry ===
1bdc94
 
1bdc94
@@ -145,7 +145,7 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
1bdc94
 wrote 65536/65536 bytes at offset 0
1bdc94
 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
1bdc94
 qcow2: Marking image as corrupt: Cluster allocation offset 0x52a00 unaligned (L2 offset: 0x40000, L2 index: 0); further corruption events will be suppressed
1bdc94
-qemu-img: Error while amending options: Input/output error
1bdc94
+qemu-img: Failed to turn zero into data clusters: Input/output error
1bdc94
 
1bdc94
 === Testing unaligned reftable entry ===
1bdc94
 
1bdc94
diff --git a/tests/qemu-iotests/061.out b/tests/qemu-iotests/061.out
1bdc94
index e857ef9..183f7dd 100644
1bdc94
--- a/tests/qemu-iotests/061.out
1bdc94
+++ b/tests/qemu-iotests/061.out
1bdc94
@@ -358,18 +358,12 @@ No errors were found on the image.
1bdc94
 
1bdc94
 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
1bdc94
 qemu-img: Lazy refcounts only supported with compatibility level 1.1 and above (use compat=1.1 or greater)
1bdc94
-qemu-img: Error while amending options: Invalid argument
1bdc94
 qemu-img: Lazy refcounts only supported with compatibility level 1.1 and above (use compat=1.1 or greater)
1bdc94
-qemu-img: Error while amending options: Invalid argument
1bdc94
 qemu-img: Unknown compatibility level 0.42
1bdc94
-qemu-img: Error while amending options: Invalid argument
1bdc94
 qemu-img: Invalid parameter 'foo'
1bdc94
 qemu-img: Changing the cluster size is not supported
1bdc94
-qemu-img: Error while amending options: Operation not supported
1bdc94
 qemu-img: Changing the encryption flag is not supported
1bdc94
-qemu-img: Error while amending options: Operation not supported
1bdc94
 qemu-img: Cannot change preallocation mode
1bdc94
-qemu-img: Error while amending options: Operation not supported
1bdc94
 
1bdc94
 === Testing correct handling of unset value ===
1bdc94
 
1bdc94
@@ -377,7 +371,6 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
1bdc94
 Should work:
1bdc94
 Should not work:
1bdc94
 qemu-img: Changing the cluster size is not supported
1bdc94
-qemu-img: Error while amending options: Operation not supported
1bdc94
 
1bdc94
 === Testing zero expansion on inactive clusters ===
1bdc94
 
1bdc94
diff --git a/tests/qemu-iotests/080.out b/tests/qemu-iotests/080.out
1bdc94
index 4e0f7f7..281c7e0 100644
1bdc94
--- a/tests/qemu-iotests/080.out
1bdc94
+++ b/tests/qemu-iotests/080.out
1bdc94
@@ -65,7 +65,7 @@ wrote 512/512 bytes at offset 0
1bdc94
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
1bdc94
 qemu-img: Failed to load snapshot: Snapshot L1 table offset invalid
1bdc94
 qemu-img: Snapshot L1 table offset invalid
1bdc94
-qemu-img: Error while amending options: Invalid argument
1bdc94
+qemu-img: Failed to turn zero into data clusters: Invalid argument
1bdc94
 Failed to flush the refcount block cache: Invalid argument
1bdc94
 write failed: Invalid argument
1bdc94
 qemu-img: Snapshot L1 table offset invalid
1bdc94
@@ -88,7 +88,7 @@ wrote 512/512 bytes at offset 0
1bdc94
 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
1bdc94
 qemu-img: Failed to load snapshot: Snapshot L1 table too large
1bdc94
 qemu-img: Snapshot L1 table too large
1bdc94
-qemu-img: Error while amending options: File too large
1bdc94
+qemu-img: Failed to turn zero into data clusters: File too large
1bdc94
 Failed to flush the refcount block cache: File too large
1bdc94
 write failed: File too large
1bdc94
 qemu-img: Snapshot L1 table too large
1bdc94
diff --git a/tests/qemu-iotests/112.out b/tests/qemu-iotests/112.out
1bdc94
index 86f0410..ae0318c 100644
1bdc94
--- a/tests/qemu-iotests/112.out
1bdc94
+++ b/tests/qemu-iotests/112.out
1bdc94
@@ -99,13 +99,11 @@ refcount bits: 64
1bdc94
 === Amend to compat=0.10 ===
1bdc94
 
1bdc94
 qemu-img: compat=0.10 requires refcount_bits=16
1bdc94
-qemu-img: Error while amending options: Operation not supported
1bdc94
 refcount bits: 64
1bdc94
 No errors were found on the image.
1bdc94
 refcount bits: 16
1bdc94
 refcount bits: 16
1bdc94
-qemu-img: Different refcount widths than 16 bits require compatibility level 1.1 or above (use compat=1.1 or greater)
1bdc94
-qemu-img: Error while amending options: Invalid argument
1bdc94
+qemu-img: Refcount widths other than 16 bits require compatibility level 1.1 or above (use compat=1.1 or greater)
1bdc94
 refcount bits: 16
1bdc94
 
1bdc94
 === Amend with snapshot ===
1bdc94
@@ -113,7 +111,6 @@ refcount bits: 16
1bdc94
 wrote 16777216/16777216 bytes at offset 0
1bdc94
 16 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
1bdc94
 qemu-img: Cannot decrease refcount entry width to 1 bits: Cluster at offset 0x50000 has a refcount of 2
1bdc94
-qemu-img: Error while amending options: Invalid argument
1bdc94
 No errors were found on the image.
1bdc94
 refcount bits: 16
1bdc94
 No errors were found on the image.
1bdc94
-- 
1bdc94
1.8.3.1
1bdc94