{"id":1072852,"url":"http://patchwork.ozlabs.org/api/patches/1072852/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20190401140903.19186-2-eblake@redhat.com/","project":{"id":14,"url":"http://patchwork.ozlabs.org/api/projects/14/?format=json","name":"QEMU Development","link_name":"qemu-devel","list_id":"qemu-devel.nongnu.org","list_email":"qemu-devel@nongnu.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20190401140903.19186-2-eblake@redhat.com>","list_archive_url":null,"date":"2019-04-01T14:08:50","name":"[PULL,01/14] qemu-img: Report bdrv_block_status failures","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"c652defc347622def03f646a1606daada6b59754","submitter":{"id":6591,"url":"http://patchwork.ozlabs.org/api/people/6591/?format=json","name":"Eric Blake","email":"eblake@redhat.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20190401140903.19186-2-eblake@redhat.com/mbox/","series":[{"id":100345,"url":"http://patchwork.ozlabs.org/api/series/100345/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/list/?series=100345","date":"2019-04-01T14:08:49","name":"[PULL,01/14] qemu-img: Report bdrv_block_status failures","version":1,"mbox":"http://patchwork.ozlabs.org/series/100345/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/1072852/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/1072852/checks/","tags":{},"related":[],"headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=209.51.188.17; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdmarc=fail (p=none dis=none) header.from=redhat.com"],"Received":["from lists.gnu.org (lists.gnu.org [209.51.188.17])\n\t(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 44Xvct3MTYz9sPp\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  2 Apr 2019 01:20:14 +1100 (AEDT)","from localhost ([127.0.0.1]:35928 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1hAxnI-0005P8-C8\n\tfor incoming@patchwork.ozlabs.org; Mon, 01 Apr 2019 10:20:12 -0400","from eggs.gnu.org ([209.51.188.92]:45730)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1hAxcc-0001r1-Nj\n\tfor qemu-devel@nongnu.org; Mon, 01 Apr 2019 10:09:11 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1hAxcb-0004hh-Qo\n\tfor qemu-devel@nongnu.org; Mon, 01 Apr 2019 10:09:10 -0400","from mx1.redhat.com ([209.132.183.28]:3697)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <eblake@redhat.com>)\n\tid 1hAxcZ-0004fq-BB; Mon, 01 Apr 2019 10:09:07 -0400","from smtp.corp.redhat.com\n\t(int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id A4B39307D981;\n\tMon,  1 Apr 2019 14:09:06 +0000 (UTC)","from blue.redhat.com (ovpn-116-75.phx2.redhat.com [10.3.116.75])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id F271B19C7C;\n\tMon,  1 Apr 2019 14:09:05 +0000 (UTC)"],"From":"Eric Blake <eblake@redhat.com>","To":"qemu-devel@nongnu.org","Date":"Mon,  1 Apr 2019 09:08:50 -0500","Message-Id":"<20190401140903.19186-2-eblake@redhat.com>","In-Reply-To":"<20190401140903.19186-1-eblake@redhat.com>","References":"<20190401140903.19186-1-eblake@redhat.com>","MIME-Version":"1.0","X-Scanned-By":"MIMEDefang 2.84 on 10.5.11.23","X-Greylist":"Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.48]);\n\tMon, 01 Apr 2019 14:09:06 +0000 (UTC)","Content-Transfer-Encoding":"quoted-printable","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]","X-Received-From":"209.132.183.28","Subject":"[Qemu-devel] [PULL 01/14] qemu-img: Report bdrv_block_status\n\tfailures","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"Kevin Wolf <kwolf@redhat.com>,\n\tVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,\n\t\"Richard W . M . Jones\" <rjones@redhat.com>,\n\t\"open list:Block layer core\" <qemu-block@nongnu.org>,\n\tMax Reitz <mreitz@redhat.com>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"},"content":"If bdrv_block_status_above() fails, we are aborting the convert\nprocess but failing to print an error message.  Broken in commit\n690c7301 (v2.4) when rewriting convert's logic.\n\nDiscovered when teaching nbdkit to support NBD_CMD_BLOCK_STATUS, and\naccidentally violating the protocol by returning more than one extent\nin spite of qemu asking for NBD_CMD_FLAG_REQ_ONE.  The qemu NBD code\nshould probably handle the server's non-compliance more gracefully\nthan failing with EINVAL, but qemu-img shouldn't be silently\nsquelching any block status failures. It doesn't help that qemu 3.1\nmasks the qemu-img bug with extra noise that the nbd code is dumping\nto stderr (that noise was cleaned up in d8b4bad8).\n\nReported-by: Richard W.M. Jones <rjones@redhat.com>\nSigned-off-by: Eric Blake <eblake@redhat.com>\nMessage-Id: <20190323212639.579-2-eblake@redhat.com>\nReviewed-by: Kevin Wolf <kwolf@redhat.com>\nReviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>\n---\n qemu-img.c | 2 ++\n 1 file changed, 2 insertions(+)","diff":"diff --git a/qemu-img.c b/qemu-img.c\nindex 8ee63daeaeb..03a9a10dec1 100644\n--- a/qemu-img.c\n+++ b/qemu-img.c\n@@ -1630,6 +1630,8 @@ static int convert_iteration_sectors(ImgConvertState *s, int64_t sector_num)\n                                           count, &count, NULL, NULL);\n         }\n         if (ret < 0) {\n+            error_report(\"error while reading block status of sector %\" PRId64\n+                         \": %s\", sector_num, strerror(-ret));\n             return ret;\n         }\n         n = DIV_ROUND_UP(count, BDRV_SECTOR_SIZE);\n","prefixes":["PULL","01/14"]}