|
|
9ae3a8 |
From 43c5d1b9be611a87ca71b75f5a7e1d4ec3056117 Mon Sep 17 00:00:00 2001
|
|
|
9ae3a8 |
From: Max Reitz <mreitz@redhat.com>
|
|
|
9ae3a8 |
Date: Tue, 11 Nov 2014 16:27:43 +0100
|
|
|
9ae3a8 |
Subject: [PATCH 13/19] qemu-img: fix img_compare() flags error path
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Message-id: <1415723263-31710-1-git-send-email-mreitz@redhat.com>
|
|
|
9ae3a8 |
Patchwork-id: 62277
|
|
|
9ae3a8 |
O-Subject: [RHEL-7.1 qemu-kvm PATCH v2 5/4] qemu-img: fix img_compare() flags error path
|
|
|
9ae3a8 |
Bugzilla: 1138691
|
|
|
9ae3a8 |
RH-Acked-by: Kevin Wolf <kwolf@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Markus Armbruster <armbru@redhat.com>
|
|
|
9ae3a8 |
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
From: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
If img_compare() fails to parse the cache flags the goto out3 code path
|
|
|
9ae3a8 |
will call qemu_progress_end(). Make sure we actually call
|
|
|
9ae3a8 |
qemu_progress_init() first.
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Reported-by: Markus Armbruster <armbru@redhat.com>
|
|
|
9ae3a8 |
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
9ae3a8 |
Reviewed-by: Max Reitz <mreitz@redhat.com>
|
|
|
9ae3a8 |
(cherry picked from commit cbda016d94017fad3be1c657f0ad98f88395c12a)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
Signed-off-by: Max Reitz <mreitz@redhat.com>
|
|
|
9ae3a8 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
9ae3a8 |
---
|
|
|
9ae3a8 |
qemu-img.c | 6 +++---
|
|
|
9ae3a8 |
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
diff --git a/qemu-img.c b/qemu-img.c
|
|
|
9ae3a8 |
index 39d7e05..f14890f 100644
|
|
|
9ae3a8 |
--- a/qemu-img.c
|
|
|
9ae3a8 |
+++ b/qemu-img.c
|
|
|
9ae3a8 |
@@ -983,6 +983,9 @@ static int img_compare(int argc, char **argv)
|
|
|
9ae3a8 |
filename1 = argv[optind++];
|
|
|
9ae3a8 |
filename2 = argv[optind++];
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
+ /* Initialize before goto out */
|
|
|
9ae3a8 |
+ qemu_progress_init(progress, 2.0);
|
|
|
9ae3a8 |
+
|
|
|
9ae3a8 |
flags = BDRV_O_FLAGS;
|
|
|
9ae3a8 |
ret = bdrv_parse_cache_flags(cache, &flags);
|
|
|
9ae3a8 |
if (ret < 0) {
|
|
|
9ae3a8 |
@@ -991,9 +994,6 @@ static int img_compare(int argc, char **argv)
|
|
|
9ae3a8 |
goto out3;
|
|
|
9ae3a8 |
}
|
|
|
9ae3a8 |
|
|
|
9ae3a8 |
- /* Initialize before goto out */
|
|
|
9ae3a8 |
- qemu_progress_init(progress, 2.0);
|
|
|
9ae3a8 |
-
|
|
|
9ae3a8 |
bs1 = bdrv_new_open("image 1", filename1, fmt1, flags, true, quiet);
|
|
|
9ae3a8 |
if (!bs1) {
|
|
|
9ae3a8 |
error_report("Can't open file %s", filename1);
|
|
|
9ae3a8 |
--
|
|
|
9ae3a8 |
1.8.3.1
|
|
|
9ae3a8 |
|