Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1072859/?format=api
{ "id": 1072859, "url": "http://patchwork.ozlabs.org/api/patches/1072859/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20190401140903.19186-8-eblake@redhat.com/", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/projects/14/?format=api", "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-8-eblake@redhat.com>", "list_archive_url": null, "date": "2019-04-01T14:08:56", "name": "[PULL,07/14] iotests: Add 241 to test NBD on unaligned images", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "d63d4c1074b64cf61f140e25cc0751ff5cac0dda", "submitter": { "id": 6591, "url": "http://patchwork.ozlabs.org/api/people/6591/?format=api", "name": "Eric Blake", "email": "eblake@redhat.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20190401140903.19186-8-eblake@redhat.com/mbox/", "series": [ { "id": 100345, "url": "http://patchwork.ozlabs.org/api/series/100345/?format=api", "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/1072859/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1072859/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 44XvjL1sBlz9sPB\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 2 Apr 2019 01:24:06 +1100 (AEDT)", "from localhost ([127.0.0.1]:36917 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 1hAxr2-0000LP-77\n\tfor incoming@patchwork.ozlabs.org; Mon, 01 Apr 2019 10:24:04 -0400", "from eggs.gnu.org ([209.51.188.92]:46010)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1hAxcs-0002B8-2x\n\tfor qemu-devel@nongnu.org; Mon, 01 Apr 2019 10:09:27 -0400", "from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1hAxco-0004wP-JT\n\tfor qemu-devel@nongnu.org; Mon, 01 Apr 2019 10:09:24 -0400", "from mx1.redhat.com ([209.132.183.28]:48524)\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 1hAxch-0004km-0N; Mon, 01 Apr 2019 10:09:15 -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 4FB0530BA356;\n\tMon, 1 Apr 2019 14:09:14 +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 A8A1D19C70;\n\tMon, 1 Apr 2019 14:09:13 +0000 (UTC)" ], "From": "Eric Blake <eblake@redhat.com>", "To": "qemu-devel@nongnu.org", "Date": "Mon, 1 Apr 2019 09:08:56 -0500", "Message-Id": "<20190401140903.19186-8-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.49]);\n\tMon, 01 Apr 2019 14:09:14 +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 07/14] iotests: Add 241 to test NBD on unaligned\n\timages", "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\"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": "Add a test for the NBD client workaround in the previous patch. It's\nnot really feasible for an iotest to assume a specific tracing engine,\nso we can't really probe trace_nbd_parse_blockstatus_compliance to see\nif the server was fixed vs. whether the client just worked around the\nserver (other than by rearranging order between code patches and this\ntest). But having a successful exchange sure beats the previous state\nof an error message. Since format probing can change alignment, we can\nuse that as an easy way to test several configurations.\n\nNot tested yet, but worth adding to this test in future patches: an\nNBD server that can advertise a non-sector-aligned size (such as\nnbdkit) causes qemu as the NBD client to misbehave when it rounds the\nsize up and accesses beyond the advertised size. Qemu as NBD server\nnever advertises a non-sector-aligned size (since bdrv_getlength()\ncurrently rounds up to sector boundaries); until qemu can act as such\na server, testing that flaw will have to rely on external binaries.\n\nSigned-off-by: Eric Blake <eblake@redhat.com>\nMessage-Id: <20190329042750.14704-2-eblake@redhat.com>\nTested-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>\nReviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>\n[eblake: add forced-512 alignment, and nbdkit reproducer comment]\n---\n tests/qemu-iotests/241 | 100 +++++++++++++++++++++++++++++++++++++\n tests/qemu-iotests/241.out | 26 ++++++++++\n tests/qemu-iotests/group | 1 +\n 3 files changed, 127 insertions(+)\n create mode 100755 tests/qemu-iotests/241\n create mode 100644 tests/qemu-iotests/241.out", "diff": "diff --git a/tests/qemu-iotests/241 b/tests/qemu-iotests/241\nnew file mode 100755\nindex 00000000000..4b196857387\n--- /dev/null\n+++ b/tests/qemu-iotests/241\n@@ -0,0 +1,100 @@\n+#!/bin/bash\n+#\n+# Test qemu-nbd vs. unaligned images\n+#\n+# Copyright (C) 2018-2019 Red Hat, Inc.\n+#\n+# This program is free software; you can redistribute it and/or modify\n+# it under the terms of the GNU General Public License as published by\n+# the Free Software Foundation; either version 2 of the License, or\n+# (at your option) any later version.\n+#\n+# This program is distributed in the hope that it will be useful,\n+# but WITHOUT ANY WARRANTY; without even the implied warranty of\n+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n+# GNU General Public License for more details.\n+#\n+# You should have received a copy of the GNU General Public License\n+# along with this program. If not, see <http://www.gnu.org/licenses/>.\n+#\n+\n+seq=\"$(basename $0)\"\n+echo \"QA output created by $seq\"\n+\n+status=1 # failure is the default!\n+\n+nbd_unix_socket=$TEST_DIR/test_qemu_nbd_socket\n+\n+_cleanup()\n+{\n+ _cleanup_test_img\n+ nbd_server_stop\n+}\n+trap \"_cleanup; exit \\$status\" 0 1 2 3 15\n+\n+# get standard environment, filters and checks\n+. ./common.rc\n+. ./common.filter\n+. ./common.nbd\n+\n+_supported_fmt raw\n+_supported_proto nbd\n+_supported_os Linux\n+_require_command QEMU_NBD\n+\n+# can't use _make_test_img, because qemu-img rounds image size up,\n+# and because we want to use Unix socket rather than TCP port. Likewise,\n+# we have to redirect TEST_IMG to our server.\n+# This tests that we can deal with the hole at the end of an unaligned\n+# raw file (either because the server doesn't advertise alignment too\n+# large, or because the client ignores the server's noncompliance - even\n+# though we can't actually wire iotests into checking trace messages).\n+printf %01000d 0 > \"$TEST_IMG_FILE\"\n+TEST_IMG=\"nbd:unix:$nbd_unix_socket\"\n+\n+echo\n+echo \"=== Exporting unaligned raw image, natural alignment ===\"\n+echo\n+\n+nbd_server_start_unix_socket -f $IMGFMT \"$TEST_IMG_FILE\"\n+\n+$QEMU_NBD_PROG --list -k $nbd_unix_socket | grep '\\(size\\|min\\)'\n+$QEMU_IMG map -f raw --output=json \"$TEST_IMG\" | _filter_qemu_img_map\n+$QEMU_IO -f raw -c map \"$TEST_IMG\"\n+nbd_server_stop\n+\n+echo\n+echo \"=== Exporting unaligned raw image, forced server sector alignment ===\"\n+echo\n+\n+# Intentionally omit '-f' to force image probing, which in turn forces\n+# sector alignment, here at the server.\n+nbd_server_start_unix_socket \"$TEST_IMG_FILE\"\n+\n+$QEMU_NBD_PROG --list -k $nbd_unix_socket | grep '\\(size\\|min\\)'\n+$QEMU_IMG map -f raw --output=json \"$TEST_IMG\" | _filter_qemu_img_map\n+$QEMU_IO -f raw -c map \"$TEST_IMG\"\n+nbd_server_stop\n+\n+echo\n+echo \"=== Exporting unaligned raw image, forced client sector alignment ===\"\n+echo\n+\n+# Now force sector alignment at the client.\n+nbd_server_start_unix_socket -f $IMGFMT \"$TEST_IMG_FILE\"\n+\n+$QEMU_NBD_PROG --list -k $nbd_unix_socket | grep '\\(size\\|min\\)'\n+$QEMU_IMG map --output=json \"$TEST_IMG\" | _filter_qemu_img_map\n+$QEMU_IO -c map \"$TEST_IMG\"\n+nbd_server_stop\n+\n+# Not tested yet: we also want to ensure that qemu as NBD client does\n+# not access beyond the end of a server's advertised unaligned size:\n+# nbdkit -U - memory size=513 --run 'qemu-io -f raw -c \"r 512 512\" $nbd'\n+# However, since qemu as server always rounds up to a sector alignment,\n+# we would have to use nbdkit to provoke the current client failures.\n+\n+# success, all done\n+echo '*** done'\n+rm -f $seq.full\n+status=0\ndiff --git a/tests/qemu-iotests/241.out b/tests/qemu-iotests/241.out\nnew file mode 100644\nindex 00000000000..b76a6234d72\n--- /dev/null\n+++ b/tests/qemu-iotests/241.out\n@@ -0,0 +1,26 @@\n+QA output created by 241\n+\n+=== Exporting unaligned raw image, natural alignment ===\n+\n+ size: 1024\n+ min block: 512\n+[{ \"start\": 0, \"length\": 1024, \"depth\": 0, \"zero\": false, \"data\": true}]\n+1 KiB (0x400) bytes allocated at offset 0 bytes (0x0)\n+\n+=== Exporting unaligned raw image, forced server sector alignment ===\n+\n+WARNING: Image format was not specified for '/home/eblake/qemu/tests/qemu-iotests/scratch/t.raw' and probing guessed raw.\n+ Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.\n+ Specify the 'raw' format explicitly to remove the restrictions.\n+ size: 1024\n+ min block: 512\n+[{ \"start\": 0, \"length\": 1024, \"depth\": 0, \"zero\": false, \"data\": true}]\n+1 KiB (0x400) bytes allocated at offset 0 bytes (0x0)\n+\n+=== Exporting unaligned raw image, forced client sector alignment ===\n+\n+ size: 1024\n+ min block: 512\n+[{ \"start\": 0, \"length\": 1024, \"depth\": 0, \"zero\": false, \"data\": true}]\n+1 KiB (0x400) bytes allocated at offset 0 bytes (0x0)\n+*** done\ndiff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group\nindex 41da10c6cf5..bae77183809 100644\n--- a/tests/qemu-iotests/group\n+++ b/tests/qemu-iotests/group\n@@ -240,6 +240,7 @@\n 238 auto quick\n 239 rw auto quick\n 240 auto quick\n+241 rw auto quick\n 242 rw auto quick\n 243 rw auto quick\n 244 rw auto quick\n", "prefixes": [ "PULL", "07/14" ] }