[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 04/35] qemu-img: fix img_compare() flags error path
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL 04/35] qemu-img: fix img_compare() flags error path |
Date: |
Fri, 29 Aug 2014 17:29:32 +0100 |
If img_compare() fails to parse the cache flags the goto out3 code path
will call qemu_progress_end(). Make sure we actually call
qemu_progress_init() first.
Reported-by: Markus Armbruster <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
---
qemu-img.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/qemu-img.c b/qemu-img.c
index 863798e..a761c36 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -999,6 +999,9 @@ static int img_compare(int argc, char **argv)
filename1 = argv[optind++];
filename2 = argv[optind++];
+ /* Initialize before goto out */
+ qemu_progress_init(progress, 2.0);
+
flags = BDRV_O_FLAGS;
ret = bdrv_parse_cache_flags(cache, &flags);
if (ret < 0) {
@@ -1007,9 +1010,6 @@ static int img_compare(int argc, char **argv)
goto out3;
}
- /* Initialize before goto out */
- qemu_progress_init(progress, 2.0);
-
bs1 = bdrv_new_open("image 1", filename1, fmt1, flags, true, quiet);
if (!bs1) {
error_report("Can't open file %s", filename1);
--
1.9.3
- [Qemu-devel] [PULL 00/35] Block patches, Stefan Hajnoczi, 2014/08/29
- [Qemu-devel] [PULL 01/35] ide: Fix bootindex for bus_id > 9, Stefan Hajnoczi, 2014/08/29
- [Qemu-devel] [PULL 02/35] block.curl: adding 'timeout' option, Stefan Hajnoczi, 2014/08/29
- [Qemu-devel] [PULL 03/35] qemu-img: fix img_commit() error return value, Stefan Hajnoczi, 2014/08/29
- [Qemu-devel] [PULL 04/35] qemu-img: fix img_compare() flags error path,
Stefan Hajnoczi <=
- [Qemu-devel] [PULL 05/35] qemu-img: always goto out in img_snapshot() error paths, Stefan Hajnoczi, 2014/08/29
- [Qemu-devel] [PULL 08/35] qapi: add read-pattern enum for quorum, Stefan Hajnoczi, 2014/08/29
- [Qemu-devel] [PULL 10/35] coroutine: Drop co_sleep_ns, Stefan Hajnoczi, 2014/08/29
- [Qemu-devel] [PULL 09/35] block/quorum: add simple read pattern support, Stefan Hajnoczi, 2014/08/29
- [Qemu-devel] [PULL 11/35] blockdev: fix drive-mirror 'granularity' error message, Stefan Hajnoczi, 2014/08/29
- [Qemu-devel] [PULL 12/35] AioContext: take bottom halves into account when computing aio_poll timeout, Stefan Hajnoczi, 2014/08/29
- [Qemu-devel] [PULL 07/35] sheepdog: improve error handling for a case of failed lock, Stefan Hajnoczi, 2014/08/29
- [Qemu-devel] [PULL 13/35] aio-win32: Evaluate timers after handles, Stefan Hajnoczi, 2014/08/29
- [Qemu-devel] [PULL 06/35] sheepdog: adopting protocol update for VDI locking, Stefan Hajnoczi, 2014/08/29