|
@@ -4646,6 +4646,7 @@ static int img_bitmap(int argc, char **argv)
|
|
|
QSIMPLEQ_HEAD(, ImgBitmapAction) actions;
|
|
|
ImgBitmapAction *act, *act_next;
|
|
|
const char *op;
|
|
|
+ int inactivate_ret;
|
|
|
|
|
|
QSIMPLEQ_INIT(&actions);
|
|
|
|
|
@@ -4830,6 +4831,16 @@ static int img_bitmap(int argc, char **argv)
|
|
|
ret = 0;
|
|
|
|
|
|
out:
|
|
|
+ /*
|
|
|
+ * Manually inactivate the images first because this way we can know whether
|
|
|
+ * an error occurred. blk_unref() doesn't tell us about failures.
|
|
|
+ */
|
|
|
+ inactivate_ret = bdrv_inactivate_all();
|
|
|
+ if (inactivate_ret < 0) {
|
|
|
+ error_report("Error while closing the image: %s", strerror(-inactivate_ret));
|
|
|
+ ret = 1;
|
|
|
+ }
|
|
|
+
|
|
|
blk_unref(src);
|
|
|
blk_unref(blk);
|
|
|
qemu_opts_del(opts);
|