Blame SOURCES/kvm-qemu-img-Report-bdrv_block_status-failures.patch

7711c0
From 1df02b6de7da262eb8349560f27f6c41d85953cd Mon Sep 17 00:00:00 2001
7711c0
From: John Snow <jsnow@redhat.com>
7711c0
Date: Mon, 6 May 2019 17:56:11 +0200
7711c0
Subject: [PATCH 01/53] qemu-img: Report bdrv_block_status failures
7711c0
7711c0
RH-Author: John Snow <jsnow@redhat.com>
7711c0
Message-id: <20190506175629.11079-2-jsnow@redhat.com>
7711c0
Patchwork-id: 87181
7711c0
O-Subject: [RHEL-7.7 qemu-kvm-rhev PATCH 01/19] qemu-img: Report bdrv_block_status failures
7711c0
Bugzilla: 1692018
7711c0
RH-Acked-by: Max Reitz <mreitz@redhat.com>
7711c0
RH-Acked-by: Stefano Garzarella <sgarzare@redhat.com>
7711c0
RH-Acked-by: Thomas Huth <thuth@redhat.com>
7711c0
7711c0
From: Eric Blake <eblake@redhat.com>
7711c0
7711c0
If bdrv_block_status_above() fails, we are aborting the convert
7711c0
process but failing to print an error message.  Broken in commit
7711c0
690c7301 (v2.4) when rewriting convert's logic.
7711c0
7711c0
Discovered when teaching nbdkit to support NBD_CMD_BLOCK_STATUS, and
7711c0
accidentally violating the protocol by returning more than one extent
7711c0
in spite of qemu asking for NBD_CMD_FLAG_REQ_ONE.  The qemu NBD code
7711c0
should probably handle the server's non-compliance more gracefully
7711c0
than failing with EINVAL, but qemu-img shouldn't be silently
7711c0
squelching any block status failures. It doesn't help that qemu 3.1
7711c0
masks the qemu-img bug with extra noise that the nbd code is dumping
7711c0
to stderr (that noise was cleaned up in d8b4bad8).
7711c0
7711c0
Reported-by: Richard W.M. Jones <rjones@redhat.com>
7711c0
Signed-off-by: Eric Blake <eblake@redhat.com>
7711c0
Message-Id: <20190323212639.579-2-eblake@redhat.com>
7711c0
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
7711c0
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
7711c0
(cherry picked from commit 2058c2ad261de7f58fae01d63d3d0efa484caf2a)
7711c0
Signed-off-by: John Snow <jsnow@redhat.com>
7711c0
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
7711c0
---
7711c0
 qemu-img.c | 2 ++
7711c0
 1 file changed, 2 insertions(+)
7711c0
7711c0
diff --git a/qemu-img.c b/qemu-img.c
7711c0
index 3b147ca..096e844 100644
7711c0
--- a/qemu-img.c
7711c0
+++ b/qemu-img.c
7711c0
@@ -1607,6 +1607,8 @@ static int convert_iteration_sectors(ImgConvertState *s, int64_t sector_num)
7711c0
                                           count, &count, NULL, NULL);
7711c0
         }
7711c0
         if (ret < 0) {
7711c0
+            error_report("error while reading block status of sector %" PRId64
7711c0
+                         ": %s", sector_num, strerror(-ret));
7711c0
             return ret;
7711c0
         }
7711c0
         n = DIV_ROUND_UP(count, BDRV_SECTOR_SIZE);
7711c0
-- 
7711c0
1.8.3.1
7711c0