From nobody Mon Feb 9 23:01:15 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1522773376043613.2439897750668; Tue, 3 Apr 2018 09:36:16 -0700 (PDT) Received: from localhost ([::1]:47480 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3Out-000832-3Q for importer@patchew.org; Tue, 03 Apr 2018 12:36:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55253) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3Osy-0006mI-Sw for qemu-devel@nongnu.org; Tue, 03 Apr 2018 12:34:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f3Osx-0006Y7-Qj for qemu-devel@nongnu.org; Tue, 03 Apr 2018 12:34:16 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:40016 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f3Ost-0006V3-Iq; Tue, 03 Apr 2018 12:34:11 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F03CA40241FB; Tue, 3 Apr 2018 16:34:08 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.36.118.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2816E10B2B22; Tue, 3 Apr 2018 16:34:08 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 3 Apr 2018 18:33:52 +0200 Message-Id: <20180403163400.6307-2-kwolf@redhat.com> In-Reply-To: <20180403163400.6307-1-kwolf@redhat.com> References: <20180403163400.6307-1-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 03 Apr 2018 16:34:09 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Tue, 03 Apr 2018 16:34:09 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'kwolf@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 1/9] gluster: Fix blockdev-add with server.N.type=unix X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The legacy command line interface gets the socket path from an option called 'socket'. QAPI in contract uses SocketAddress, where the corresponding option is called 'path'. Fix the gluster block driver to accept both 'socket' and 'path', with 'path' being the preferred syntax. https://bugzilla.redhat.com/show_bug.cgi?id=3D1545155 Cc: qemu-stable@nongnu.org Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake --- block/gluster.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/block/gluster.c b/block/gluster.c index 296e036b3d..4adc1a875b 100644 --- a/block/gluster.c +++ b/block/gluster.c @@ -167,7 +167,12 @@ static QemuOptsList runtime_unix_opts =3D { { .name =3D GLUSTER_OPT_SOCKET, .type =3D QEMU_OPT_STRING, - .help =3D "socket file path)", + .help =3D "socket file path (legacy)", + }, + { + .name =3D GLUSTER_OPT_PATH, + .type =3D QEMU_OPT_STRING, + .help =3D "socket file path (QAPI)", }, { /* end of list */ } }, @@ -615,10 +620,18 @@ static int qemu_gluster_parse_json(BlockdevOptionsGlu= ster *gconf, goto out; } =20 - ptr =3D qemu_opt_get(opts, GLUSTER_OPT_SOCKET); + ptr =3D qemu_opt_get(opts, GLUSTER_OPT_PATH); + if (!ptr) { + ptr =3D qemu_opt_get(opts, GLUSTER_OPT_SOCKET); + } else if (qemu_opt_get(opts, GLUSTER_OPT_SOCKET)) { + error_setg(&local_err, + "Conflicting parameters 'path' and 'socket'"); + error_append_hint(&local_err, GERR_INDEX_HINT, i); + goto out; + } if (!ptr) { error_setg(&local_err, QERR_MISSING_PARAMETER, - GLUSTER_OPT_SOCKET); + GLUSTER_OPT_PATH); error_append_hint(&local_err, GERR_INDEX_HINT, i); goto out; } @@ -684,7 +697,7 @@ static int qemu_gluster_parse(BlockdevOptionsGluster *g= conf, "file.server.0.host=3D1.2.3.4," "file.server.0.port=3D24007," "file.server.1.transport=3Dunix," - "file.server.1.socket=3D/var/run/glusterd.soc= ket ..." + "file.server.1.path=3D/var/run/glusterd.socke= t ..." "\n"); return ret; } --=20 2.13.6 From nobody Mon Feb 9 23:01:15 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1522773384924995.1110520894498; Tue, 3 Apr 2018 09:36:24 -0700 (PDT) Received: from localhost ([::1]:47484 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3Ov2-0008Cs-1d for importer@patchew.org; Tue, 03 Apr 2018 12:36:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55255) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3Osy-0006mM-UX for qemu-devel@nongnu.org; Tue, 03 Apr 2018 12:34:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f3Osx-0006Xu-Mw for qemu-devel@nongnu.org; Tue, 03 Apr 2018 12:34:16 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:58598 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f3Ost-0006V2-Ie; Tue, 03 Apr 2018 12:34:11 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F2C1C4072CFC; Tue, 3 Apr 2018 16:34:09 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.36.118.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3077F10B2B22; Tue, 3 Apr 2018 16:34:09 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 3 Apr 2018 18:33:53 +0200 Message-Id: <20180403163400.6307-3-kwolf@redhat.com> In-Reply-To: <20180403163400.6307-1-kwolf@redhat.com> References: <20180403163400.6307-1-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 03 Apr 2018 16:34:10 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 03 Apr 2018 16:34:10 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'kwolf@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 2/9] block: handle invalid lseek returns gracefully X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Jeff Cody In commit 223a23c198787328ae75bc65d84edf5fde33c0b6, we implemented a workaround in the gluster driver to handle invalid values returned for SEEK_DATA or SEEK_HOLE. In some instances, these same invalid values can be seen in the posix file handler as well - for example, it has been reported on FUSE gluster mounts. Calling assert() for these invalid values is overly harsh; we can safely return -EIO and allow this case to be treated as a "learned nothing" case (e.g., D4 / H4, as commented in the code). This patch does the same thing that 223a23c198787 did for gluster.c, except in file-posix.c Signed-off-by: Jeff Cody Reviewed-by: Eric Blake Signed-off-by: Kevin Wolf --- block/file-posix.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/block/file-posix.c b/block/file-posix.c index d7fb772c14..a2f6d8a8c8 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -2114,7 +2114,12 @@ static int find_allocation(BlockDriverState *bs, off= _t start, if (offs < 0) { return -errno; /* D3 or D4 */ } - assert(offs >=3D start); + + if (offs < start) { + /* This is not a valid return by lseek(). We are safe to just ret= urn + * -EIO in this case, and we'll treat it like D4. */ + return -EIO; + } =20 if (offs > start) { /* D2: in hole, next data at offs */ @@ -2146,7 +2151,12 @@ static int find_allocation(BlockDriverState *bs, off= _t start, if (offs < 0) { return -errno; /* D1 and (H3 or H4) */ } - assert(offs >=3D start); + + if (offs < start) { + /* This is not a valid return by lseek(). We are safe to just ret= urn + * -EIO in this case, and we'll treat it like H4. */ + return -EIO; + } =20 if (offs > start) { /* --=20 2.13.6 From nobody Mon Feb 9 23:01:16 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 152277341724868.84432815612797; Tue, 3 Apr 2018 09:36:57 -0700 (PDT) Received: from localhost ([::1]:47494 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3OvY-0000AD-As for importer@patchew.org; Tue, 03 Apr 2018 12:36:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55258) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3Osz-0006mg-3h for qemu-devel@nongnu.org; Tue, 03 Apr 2018 12:34:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f3Osx-0006YJ-Vy for qemu-devel@nongnu.org; Tue, 03 Apr 2018 12:34:17 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:44226 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f3Osu-0006Vo-Lc; Tue, 03 Apr 2018 12:34:12 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3D1D14040853; Tue, 3 Apr 2018 16:34:12 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.36.118.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3988010B2B22; Tue, 3 Apr 2018 16:34:10 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 3 Apr 2018 18:33:54 +0200 Message-Id: <20180403163400.6307-4-kwolf@redhat.com> In-Reply-To: <20180403163400.6307-1-kwolf@redhat.com> References: <20180403163400.6307-1-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 03 Apr 2018 16:34:12 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 03 Apr 2018 16:34:12 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'kwolf@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 3/9] iotests: Update 051 and 186 after commit 1454509726719e0933c X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Alberto Garcia SCSI controllers are no longer created automatically for -drive if=3Dscsi, so this patch updates the tests that relied on that. Signed-off-by: Alberto Garcia Reviewed-by: Eric Blake Cc: Thomas Huth Signed-off-by: Kevin Wolf --- tests/qemu-iotests/051.pc.out | 20 -------------------- tests/qemu-iotests/186 | 4 ---- tests/qemu-iotests/186.out | 28 ---------------------------- 3 files changed, 52 deletions(-) diff --git a/tests/qemu-iotests/051.pc.out b/tests/qemu-iotests/051.pc.out index 830c11880a..b01f9a90d7 100644 --- a/tests/qemu-iotests/051.pc.out +++ b/tests/qemu-iotests/051.pc.out @@ -117,20 +117,10 @@ Testing: -drive if=3Dide,media=3Dcdrom QEMU X.Y.Z monitor - type 'help' for more information (qemu) quit =20 -Testing: -drive if=3Dscsi,media=3Dcdrom -QEMU X.Y.Z monitor - type 'help' for more information -(qemu) QEMU_PROG: -drive if=3Dscsi,media=3Dcdrom: warning: bus=3D0,unit=3D= 0 is deprecated with this machine type -quit - Testing: -drive if=3Dide QEMU X.Y.Z monitor - type 'help' for more information (qemu) QEMU_PROG: Initialization of device ide-hd failed: Device needs med= ia, but drive is empty =20 -Testing: -drive if=3Dscsi -QEMU X.Y.Z monitor - type 'help' for more information -(qemu) QEMU_PROG: -drive if=3Dscsi: warning: bus=3D0,unit=3D0 is deprecate= d with this machine type -QEMU_PROG: -drive if=3Dscsi: Device needs media, but drive is empty - Testing: -drive if=3Dvirtio QEMU X.Y.Z monitor - type 'help' for more information (qemu) QEMU_PROG: -drive if=3Dvirtio: Device needs media, but drive is emp= ty @@ -170,20 +160,10 @@ Testing: -drive file=3DTEST_DIR/t.qcow2,if=3Dide,medi= a=3Dcdrom,readonly=3Don QEMU X.Y.Z monitor - type 'help' for more information (qemu) quit =20 -Testing: -drive file=3DTEST_DIR/t.qcow2,if=3Dscsi,media=3Dcdrom,readonly= =3Don -QEMU X.Y.Z monitor - type 'help' for more information -(qemu) QEMU_PROG: -drive file=3DTEST_DIR/t.qcow2,if=3Dscsi,media=3Dcdrom,r= eadonly=3Don: warning: bus=3D0,unit=3D0 is deprecated with this machine type -quit - Testing: -drive file=3DTEST_DIR/t.qcow2,if=3Dide,readonly=3Don QEMU X.Y.Z monitor - type 'help' for more information (qemu) QEMU_PROG: Initialization of device ide-hd failed: Block node is re= ad-only =20 -Testing: -drive file=3DTEST_DIR/t.qcow2,if=3Dscsi,readonly=3Don -QEMU X.Y.Z monitor - type 'help' for more information -(qemu) QEMU_PROG: -drive file=3DTEST_DIR/t.qcow2,if=3Dscsi,readonly=3Don: = warning: bus=3D0,unit=3D0 is deprecated with this machine type -quit - Testing: -drive file=3DTEST_DIR/t.qcow2,if=3Dvirtio,readonly=3Don QEMU X.Y.Z monitor - type 'help' for more information (qemu) quit diff --git a/tests/qemu-iotests/186 b/tests/qemu-iotests/186 index 44cc01ed87..9687243d34 100755 --- a/tests/qemu-iotests/186 +++ b/tests/qemu-iotests/186 @@ -133,10 +133,6 @@ check_info_block -drive if=3Dide,driver=3Dnull-co check_info_block -drive if=3Dide,media=3Dcdrom check_info_block -drive if=3Dide,driver=3Dnull-co,media=3Dcdrom =20 -check_info_block -drive if=3Dscsi,driver=3Dnull-co -check_info_block -drive if=3Dscsi,media=3Dcdrom -check_info_block -drive if=3Dscsi,driver=3Dnull-co,media=3Dcdrom - check_info_block -drive if=3Dvirtio,driver=3Dnull-co =20 check_info_block -drive if=3Dpflash,driver=3Dnull-co,size=3D1M diff --git a/tests/qemu-iotests/186.out b/tests/qemu-iotests/186.out index c8377fe146..ec75c0fc60 100644 --- a/tests/qemu-iotests/186.out +++ b/tests/qemu-iotests/186.out @@ -442,34 +442,6 @@ ide0-cd0 (NODE_NAME): null-co:// (null-co, read-only) Cache mode: writeback (qemu) quit =20 -Testing: -drive if=3Dscsi,driver=3Dnull-co -QEMU X.Y.Z monitor - type 'help' for more information -(qemu) QEMU_PROG: -drive if=3Dscsi,driver=3Dnull-co: warning: bus=3D0,unit= =3D0 is deprecated with this machine type -info block -scsi0-hd0 (NODE_NAME): null-co:// (null-co) - Attached to: /machine/unattached/device[27]/scsi.0/legacy[0] - Cache mode: writeback -(qemu) quit - -Testing: -drive if=3Dscsi,media=3Dcdrom -QEMU X.Y.Z monitor - type 'help' for more information -(qemu) QEMU_PROG: -drive if=3Dscsi,media=3Dcdrom: warning: bus=3D0,unit=3D= 0 is deprecated with this machine type -info block -scsi0-cd0: [not inserted] - Attached to: /machine/unattached/device[27]/scsi.0/legacy[0] - Removable device: not locked, tray closed -(qemu) quit - -Testing: -drive if=3Dscsi,driver=3Dnull-co,media=3Dcdrom -QEMU X.Y.Z monitor - type 'help' for more information -(qemu) QEMU_PROG: -drive if=3Dscsi,driver=3Dnull-co,media=3Dcdrom: warning= : bus=3D0,unit=3D0 is deprecated with this machine type -info block -scsi0-cd0 (NODE_NAME): null-co:// (null-co, read-only) - Attached to: /machine/unattached/device[27]/scsi.0/legacy[0] - Removable device: not locked, tray closed - Cache mode: writeback -(qemu) quit - Testing: -drive if=3Dvirtio,driver=3Dnull-co QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block --=20 2.13.6 From nobody Mon Feb 9 23:01:16 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1522773703710802.1302523094889; Tue, 3 Apr 2018 09:41:43 -0700 (PDT) Received: from localhost ([::1]:47728 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3P0A-0004YP-Lj for importer@patchew.org; Tue, 03 Apr 2018 12:41:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55338) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3Ot1-0006qC-Lu for qemu-devel@nongnu.org; Tue, 03 Apr 2018 12:34:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f3Osz-0006Zj-Tk for qemu-devel@nongnu.org; Tue, 03 Apr 2018 12:34:19 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:44984 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f3Osv-0006WR-NP; Tue, 03 Apr 2018 12:34:13 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 463B98182D0A; Tue, 3 Apr 2018 16:34:13 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.36.118.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7779710B2B22; Tue, 3 Apr 2018 16:34:12 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 3 Apr 2018 18:33:55 +0200 Message-Id: <20180403163400.6307-5-kwolf@redhat.com> In-Reply-To: <20180403163400.6307-1-kwolf@redhat.com> References: <20180403163400.6307-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 03 Apr 2018 16:34:13 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 03 Apr 2018 16:34:13 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'kwolf@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 4/9] iotests: Update 186 after commit ac64273c66ab136c44043259162 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Alberto Garcia Commit ac64273c66ab136c44 modified the output of iotest 186, changing the QOM path of floppy drives from /machine/unattached/device[17] to /machine/unattached/device[13]. Instead of updating the test output to reflect this change, this patch adds a new filter that hides all QOM paths from the 'Attached to:' line of the 'info block' command. Signed-off-by: Alberto Garcia Cc: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Kevin Wolf --- tests/qemu-iotests/186 | 2 +- tests/qemu-iotests/186.out | 56 ++++++++++++++++++++----------------= ---- tests/qemu-iotests/common.filter | 5 ++++ 3 files changed, 34 insertions(+), 29 deletions(-) diff --git a/tests/qemu-iotests/186 b/tests/qemu-iotests/186 index 9687243d34..0aa4395a57 100755 --- a/tests/qemu-iotests/186 +++ b/tests/qemu-iotests/186 @@ -64,7 +64,7 @@ function check_info_block() { echo "info block" | do_run_qemu "$@" | _filter_win32 | _filter_hmp | _filter_qemu | - _filter_generated_node_ids + _filter_generated_node_ids | _filter_qom_path } =20 =20 diff --git a/tests/qemu-iotests/186.out b/tests/qemu-iotests/186.out index ec75c0fc60..716b01ac3d 100644 --- a/tests/qemu-iotests/186.out +++ b/tests/qemu-iotests/186.out @@ -7,7 +7,7 @@ Testing: -device floppy QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block /machine/peripheral-anon/device[1]: [not inserted] - Attached to: /machine/peripheral-anon/device[1] + Attached to: PATH Removable device: not locked, tray closed (qemu) quit =20 @@ -23,7 +23,7 @@ Testing: -device ide-cd QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block /machine/peripheral-anon/device[1]: [not inserted] - Attached to: /machine/peripheral-anon/device[1] + Attached to: PATH Removable device: not locked, tray closed (qemu) quit =20 @@ -39,7 +39,7 @@ Testing: -device scsi-cd QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block /machine/peripheral-anon/device[1]: [not inserted] - Attached to: /machine/peripheral-anon/device[1] + Attached to: PATH Removable device: not locked, tray closed (qemu) quit =20 @@ -58,7 +58,7 @@ Testing: -blockdev driver=3Dnull-co,node-name=3Dnull -dev= ice ide-hd,drive=3Dnull QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block null: null-co:// (null-co) - Attached to: /machine/peripheral-anon/device[1] + Attached to: PATH Cache mode: writeback (qemu) quit =20 @@ -74,7 +74,7 @@ Testing: -blockdev driver=3Dnull-co,node-name=3Dnull -dev= ice scsi-hd,drive=3Dnull QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block null: null-co:// (null-co) - Attached to: /machine/peripheral-anon/device[1] + Attached to: PATH Cache mode: writeback (qemu) quit =20 @@ -90,7 +90,7 @@ Testing: -blockdev driver=3Dnull-co,node-name=3Dnull -dev= ice virtio-blk-pci,drive=3Dnu QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block null: null-co:// (null-co) - Attached to: /machine/peripheral-anon/device[1]/virtio-backend + Attached to: PATH Cache mode: writeback (qemu) quit =20 @@ -98,7 +98,7 @@ Testing: -blockdev driver=3Dnull-co,node-name=3Dnull -dev= ice virtio-blk-pci,drive=3Dnu QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block null: null-co:// (null-co) - Attached to: /machine/peripheral/qdev_id/virtio-backend + Attached to: PATH Cache mode: writeback (qemu) quit =20 @@ -106,7 +106,7 @@ Testing: -blockdev driver=3Dnull-co,node-name=3Dnull -d= evice floppy,drive=3Dnull QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block null: null-co:// (null-co) - Attached to: /machine/peripheral-anon/device[1] + Attached to: PATH Removable device: not locked, tray closed Cache mode: writeback (qemu) quit @@ -124,7 +124,7 @@ Testing: -blockdev driver=3Dnull-co,node-name=3Dnull -d= evice ide-cd,drive=3Dnull QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block null: null-co:// (null-co) - Attached to: /machine/peripheral-anon/device[1] + Attached to: PATH Removable device: not locked, tray closed Cache mode: writeback (qemu) quit @@ -142,7 +142,7 @@ Testing: -blockdev driver=3Dnull-co,node-name=3Dnull -d= evice scsi-cd,drive=3Dnull QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block null: null-co:// (null-co) - Attached to: /machine/peripheral-anon/device[1] + Attached to: PATH Removable device: not locked, tray closed Cache mode: writeback (qemu) quit @@ -191,7 +191,7 @@ none0 (null): null-co:// (null-co) Cache mode: writeback =20 null: null-co:// (null-co) - Attached to: /machine/peripheral/qdev_id/virtio-backend + Attached to: PATH Cache mode: writeback (qemu) quit =20 @@ -241,7 +241,7 @@ Testing: -drive if=3Dnone,driver=3Dnull-co,node-name=3D= null -device ide-hd,drive=3Dnone0 QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block none0 (null): null-co:// (null-co) - Attached to: /machine/peripheral-anon/device[1] + Attached to: PATH Cache mode: writeback (qemu) quit =20 @@ -257,7 +257,7 @@ Testing: -drive if=3Dnone,driver=3Dnull-co,node-name=3D= null -device scsi-hd,drive=3Dnone QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block none0 (null): null-co:// (null-co) - Attached to: /machine/peripheral-anon/device[1] + Attached to: PATH Cache mode: writeback (qemu) quit =20 @@ -273,7 +273,7 @@ Testing: -drive if=3Dnone,driver=3Dnull-co,node-name=3D= null -device virtio-blk-pci,dri QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block none0 (null): null-co:// (null-co) - Attached to: /machine/peripheral-anon/device[1]/virtio-backend + Attached to: PATH Cache mode: writeback (qemu) quit =20 @@ -281,7 +281,7 @@ Testing: -drive if=3Dnone,driver=3Dnull-co,node-name=3D= null -device virtio-blk-pci,dri QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block none0 (null): null-co:// (null-co) - Attached to: /machine/peripheral/qdev_id/virtio-backend + Attached to: PATH Cache mode: writeback (qemu) quit =20 @@ -289,7 +289,7 @@ Testing: -drive if=3Dnone,driver=3Dnull-co,node-name=3D= null -device floppy,drive=3Dnone0 QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block none0 (null): null-co:// (null-co) - Attached to: /machine/peripheral-anon/device[1] + Attached to: PATH Removable device: not locked, tray closed Cache mode: writeback (qemu) quit @@ -307,7 +307,7 @@ Testing: -drive if=3Dnone,driver=3Dnull-co,node-name=3D= null -device ide-cd,drive=3Dnone0 QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block none0 (null): null-co:// (null-co) - Attached to: /machine/peripheral-anon/device[1] + Attached to: PATH Removable device: not locked, tray closed Cache mode: writeback (qemu) quit @@ -325,7 +325,7 @@ Testing: -drive if=3Dnone,driver=3Dnull-co,node-name=3D= null -device scsi-cd,drive=3Dnone QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block none0 (null): null-co:// (null-co) - Attached to: /machine/peripheral-anon/device[1] + Attached to: PATH Removable device: not locked, tray closed Cache mode: writeback (qemu) quit @@ -353,7 +353,7 @@ Testing: -drive if=3Dnone -device floppy,drive=3Dnone0 QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block none0: [not inserted] - Attached to: /machine/peripheral-anon/device[1] + Attached to: PATH Removable device: not locked, tray closed (qemu) quit =20 @@ -369,7 +369,7 @@ Testing: -drive if=3Dnone -device ide-cd,drive=3Dnone0 QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block none0: [not inserted] - Attached to: /machine/peripheral-anon/device[1] + Attached to: PATH Removable device: not locked, tray closed (qemu) quit =20 @@ -385,7 +385,7 @@ Testing: -drive if=3Dnone -device scsi-cd,drive=3Dnone0 QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block none0: [not inserted] - Attached to: /machine/peripheral-anon/device[1] + Attached to: PATH Removable device: not locked, tray closed (qemu) quit =20 @@ -404,7 +404,7 @@ Testing: -drive if=3Dfloppy QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block floppy0: [not inserted] - Attached to: /machine/unattached/device[17] + Attached to: PATH Removable device: not locked, tray closed (qemu) quit =20 @@ -412,7 +412,7 @@ Testing: -drive if=3Dfloppy,driver=3Dnull-co QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block floppy0 (NODE_NAME): null-co:// (null-co) - Attached to: /machine/unattached/device[17] + Attached to: PATH Removable device: not locked, tray closed Cache mode: writeback (qemu) quit @@ -421,7 +421,7 @@ Testing: -drive if=3Dide,driver=3Dnull-co QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block ide0-hd0 (NODE_NAME): null-co:// (null-co) - Attached to: /machine/unattached/device[18] + Attached to: PATH Cache mode: writeback (qemu) quit =20 @@ -429,7 +429,7 @@ Testing: -drive if=3Dide,media=3Dcdrom QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block ide0-cd0: [not inserted] - Attached to: /machine/unattached/device[18] + Attached to: PATH Removable device: not locked, tray closed (qemu) quit =20 @@ -437,7 +437,7 @@ Testing: -drive if=3Dide,driver=3Dnull-co,media=3Dcdrom QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block ide0-cd0 (NODE_NAME): null-co:// (null-co, read-only) - Attached to: /machine/unattached/device[18] + Attached to: PATH Removable device: not locked, tray closed Cache mode: writeback (qemu) quit @@ -446,7 +446,7 @@ Testing: -drive if=3Dvirtio,driver=3Dnull-co QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block virtio0 (NODE_NAME): null-co:// (null-co) - Attached to: /machine/peripheral-anon/device[1]/virtio-backend + Attached to: PATH Cache mode: writeback (qemu) quit =20 @@ -454,7 +454,7 @@ Testing: -drive if=3Dpflash,driver=3Dnull-co,size=3D1M QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block pflash0 (NODE_NAME): json:{"driver": "null-co", "size": "1M"} (null-co) - Attached to: /machine/unattached/device[2] + Attached to: PATH Cache mode: writeback (qemu) quit =20 diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.f= ilter index cb2be23340..c5f4bcf578 100644 --- a/tests/qemu-iotests/common.filter +++ b/tests/qemu-iotests/common.filter @@ -32,6 +32,11 @@ _filter_generated_node_ids() sed -re 's/\#block[0-9]{3,}/NODE_NAME/' } =20 +_filter_qom_path() +{ + sed -e 's#\(Attached to: *\) /.*#\1 PATH#' +} + # replace occurrences of the actual TEST_DIR value with TEST_DIR _filter_testdir() { --=20 2.13.6 From nobody Mon Feb 9 23:01:16 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1522773541422448.8789475247753; Tue, 3 Apr 2018 09:39:01 -0700 (PDT) Received: from localhost ([::1]:47547 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3OxP-0001oR-PS for importer@patchew.org; Tue, 03 Apr 2018 12:38:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55413) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3Ot6-0006s4-EG for qemu-devel@nongnu.org; Tue, 03 Apr 2018 12:34:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f3Ot5-0006dv-Mk for qemu-devel@nongnu.org; Tue, 03 Apr 2018 12:34:24 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:46416 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f3Osw-0006XC-Nn; Tue, 03 Apr 2018 12:34:14 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4F5FCEAEA9; Tue, 3 Apr 2018 16:34:14 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.36.118.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id 80DDC10B2B22; Tue, 3 Apr 2018 16:34:13 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 3 Apr 2018 18:33:56 +0200 Message-Id: <20180403163400.6307-6-kwolf@redhat.com> In-Reply-To: <20180403163400.6307-1-kwolf@redhat.com> References: <20180403163400.6307-1-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 03 Apr 2018 16:34:14 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 03 Apr 2018 16:34:14 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'kwolf@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 5/9] iotests: fix 208 for luks format X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy Support luks images creatins like in 205 Signed-off-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Kevin Wolf --- tests/qemu-iotests/208 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/208 b/tests/qemu-iotests/208 index 4e82b96c82..18f59ada94 100755 --- a/tests/qemu-iotests/208 +++ b/tests/qemu-iotests/208 @@ -28,7 +28,7 @@ with iotests.FilePath('disk.img') as disk_img_path, \ iotests.VM() as vm: =20 img_size =3D '10M' - iotests.qemu_img_pipe('create', '-f', iotests.imgfmt, disk_img_path, i= mg_size) + iotests.qemu_img_create('-f', iotests.imgfmt, disk_img_path, img_size) =20 iotests.log('Launching VM...') (vm.add_drive(disk_img_path, 'node-name=3Ddrive0-node', interface=3D'n= one') --=20 2.13.6 From nobody Mon Feb 9 23:01:16 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 152277388008253.50850850625113; Tue, 3 Apr 2018 09:44:40 -0700 (PDT) Received: from localhost ([::1]:47982 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3P2y-0006bh-AF for importer@patchew.org; Tue, 03 Apr 2018 12:44:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55319) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3Ot1-0006pm-6Q for qemu-devel@nongnu.org; Tue, 03 Apr 2018 12:34:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f3Ot0-0006Zz-0O for qemu-devel@nongnu.org; Tue, 03 Apr 2018 12:34:19 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:46420 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f3Osx-0006Xj-Nl; Tue, 03 Apr 2018 12:34:15 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 592FEEAEA9; Tue, 3 Apr 2018 16:34:15 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.36.118.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id 89F5110B2B22; Tue, 3 Apr 2018 16:34:14 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 3 Apr 2018 18:33:57 +0200 Message-Id: <20180403163400.6307-7-kwolf@redhat.com> In-Reply-To: <20180403163400.6307-1-kwolf@redhat.com> References: <20180403163400.6307-1-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 03 Apr 2018 16:34:15 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 03 Apr 2018 16:34:15 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'kwolf@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 6/9] block/file-posix: Fix fully preallocated truncate X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Max Reitz Storing the lseek() result in an int results in it overflowing when the file is at least 2 GB big. Then, we have a 50 % chance of the result being "negative" and thus thinking an error occurred when actually everything went just fine. So we should use the correct type for storing the result: off_t. Reported-by: Daniel P. Berrange Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=3D1549231 Cc: qemu-stable@nongnu.org Signed-off-by: Max Reitz Message-id: 20180228131315.30194-2-mreitz@redhat.com Reviewed-by: Eric Blake Signed-off-by: Max Reitz --- block/file-posix.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/block/file-posix.c b/block/file-posix.c index a2f6d8a8c8..3794c0007a 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -1701,6 +1701,7 @@ static int raw_regular_truncate(int fd, int64_t offse= t, PreallocMode prealloc, case PREALLOC_MODE_FULL: { int64_t num =3D 0, left =3D offset - current_length; + off_t seek_result; =20 /* * Knowing the final size from the beginning could allow the file @@ -1715,8 +1716,8 @@ static int raw_regular_truncate(int fd, int64_t offse= t, PreallocMode prealloc, =20 buf =3D g_malloc0(65536); =20 - result =3D lseek(fd, current_length, SEEK_SET); - if (result < 0) { + seek_result =3D lseek(fd, current_length, SEEK_SET); + if (seek_result < 0) { result =3D -errno; error_setg_errno(errp, -result, "Failed to seek to the old end of file"); --=20 2.13.6 From nobody Mon Feb 9 23:01:16 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1522773573198450.76832073954097; Tue, 3 Apr 2018 09:39:33 -0700 (PDT) Received: from localhost ([::1]:47561 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3Oy4-0002R0-6c for importer@patchew.org; Tue, 03 Apr 2018 12:39:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55357) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3Ot2-0006qE-8r for qemu-devel@nongnu.org; Tue, 03 Apr 2018 12:34:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f3Ot1-0006as-2J for qemu-devel@nongnu.org; Tue, 03 Apr 2018 12:34:20 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:58604 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f3Osy-0006Ya-PA; Tue, 03 Apr 2018 12:34:16 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 638C34072CF7; Tue, 3 Apr 2018 16:34:16 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.36.118.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9401610B2B22; Tue, 3 Apr 2018 16:34:15 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 3 Apr 2018 18:33:58 +0200 Message-Id: <20180403163400.6307-8-kwolf@redhat.com> In-Reply-To: <20180403163400.6307-1-kwolf@redhat.com> References: <20180403163400.6307-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 03 Apr 2018 16:34:16 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 03 Apr 2018 16:34:16 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'kwolf@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 7/9] iotests: Test preallocated truncate of 2G image X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Max Reitz Signed-off-by: Max Reitz Message-id: 20180228131315.30194-3-mreitz@redhat.com Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Eric Blake Signed-off-by: Max Reitz --- tests/qemu-iotests/106 | 24 ++++++++++++++++++++++++ tests/qemu-iotests/106.out | 10 ++++++++++ 2 files changed, 34 insertions(+) diff --git a/tests/qemu-iotests/106 b/tests/qemu-iotests/106 index bfe71f4e60..5e51f88a78 100755 --- a/tests/qemu-iotests/106 +++ b/tests/qemu-iotests/106 @@ -86,6 +86,30 @@ for growth_mode in falloc full off; do $QEMU_IMG resize -f "$IMGFMT" --shrink --preallocation=3D$growth_mode = "$TEST_IMG" -${GROWTH_SIZE}K done =20 +echo +echo '=3D=3D=3D Testing image growth on 2G empty image =3D=3D=3D' + +for growth_mode in falloc full; do + echo + echo "--- growth_mode=3D$growth_mode ---" + + # Maybe we want to do an lseek() to the end of the file before the + # preallocation; if the file has a length of 2 GB, that would + # return an integer that overflows to negative when put into a + # plain int. We should use the correct type for the result, and + # this tests we do. + + _make_test_img 2G + $QEMU_IMG resize -f "$IMGFMT" --preallocation=3D$growth_mode "$TEST_IM= G" +${GROWTH_SIZE}K + + actual_size=3D$($QEMU_IMG info -f "$IMGFMT" "$TEST_IMG" | grep 'disk s= ize') + actual_size=3D$(echo "$actual_size" | sed -e 's/^[^0-9]*\([0-9]\+\).*$= /\1/') + + if [ $actual_size -lt $GROWTH_SIZE ]; then + echo "ERROR: Image should have at least ${GROWTH_SIZE}K, but has $= {actual_size}K" + fi +done + # success, all done echo '*** done' rm -f $seq.full diff --git a/tests/qemu-iotests/106.out b/tests/qemu-iotests/106.out index 0a42312301..c459957660 100644 --- a/tests/qemu-iotests/106.out +++ b/tests/qemu-iotests/106.out @@ -47,4 +47,14 @@ qemu-img: Preallocation can only be used for growing ima= ges =20 --- growth_mode=3Doff --- Image resized. + +=3D=3D=3D Testing image growth on 2G empty image =3D=3D=3D + +--- growth_mode=3Dfalloc --- +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D2147483648 +Image resized. + +--- growth_mode=3Dfull --- +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D2147483648 +Image resized. *** done --=20 2.13.6 From nobody Mon Feb 9 23:01:16 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1522773538121626.7171900194667; Tue, 3 Apr 2018 09:38:58 -0700 (PDT) Received: from localhost ([::1]:47548 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3OxQ-0001ok-9T for importer@patchew.org; Tue, 03 Apr 2018 12:38:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55415) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3Ot6-0006sB-GU for qemu-devel@nongnu.org; Tue, 03 Apr 2018 12:34:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f3Ot5-0006dq-LP for qemu-devel@nongnu.org; Tue, 03 Apr 2018 12:34:24 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:44988 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f3Osz-0006ZV-RP; Tue, 03 Apr 2018 12:34:17 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6CD4F8182D0A; Tue, 3 Apr 2018 16:34:17 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.36.118.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9E76110B2B22; Tue, 3 Apr 2018 16:34:16 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 3 Apr 2018 18:33:59 +0200 Message-Id: <20180403163400.6307-9-kwolf@redhat.com> In-Reply-To: <20180403163400.6307-1-kwolf@redhat.com> References: <20180403163400.6307-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 03 Apr 2018 16:34:17 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 03 Apr 2018 16:34:17 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'kwolf@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 8/9] qemu-iotests: Use ppc64 qemu_arch on ppc64le host X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Luk=C3=A1=C5=A1 Doktor The qemu target does not always correspond to the host machine type. For example ppc64le machine target is ppc64. Let's introduce "qemu_arch" variable to store the matching qemu architecture related to the current architecture and use it when auto-detecting the default qemu binary. Signed-off-by: Luk=C3=A1=C5=A1 Doktor Message-id: 20180329112053.5399-2-ldoktor@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/check | 4 ++-- tests/qemu-iotests/common.config | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index ec8033350d..aa94c6c7ea 100755 --- a/tests/qemu-iotests/check +++ b/tests/qemu-iotests/check @@ -538,8 +538,8 @@ if [ -z "$QEMU_PROG" ] then if [ -x "$build_iotests/qemu" ]; then export QEMU_PROG=3D"$build_iotests/qemu" - elif [ -x "$build_root/$arch-softmmu/qemu-system-$arch" ]; then - export QEMU_PROG=3D"$build_root/$arch-softmmu/qemu-system-$arch" + elif [ -x "$build_root/${qemu_arch}-softmmu/qemu-system-${qemu_arch}" = ]; then + export QEMU_PROG=3D"$build_root/${qemu_arch}-softmmu/qemu-system-$= {qemu_arch}" else pushd "$build_root" > /dev/null for binary in *-softmmu/qemu-system-* diff --git a/tests/qemu-iotests/common.config b/tests/qemu-iotests/common.c= onfig index cdcda54546..102aa6878a 100644 --- a/tests/qemu-iotests/common.config +++ b/tests/qemu-iotests/common.config @@ -23,6 +23,7 @@ PATH=3D".:$PATH" =20 HOSTOS=3D`uname -s` arch=3D`uname -m` +[[ "$arch" =3D~ "ppc64" ]] && qemu_arch=3Dppc64 || qemu_arch=3D"$arch" =20 export PWD=3D`pwd` =20 --=20 2.13.6 From nobody Mon Feb 9 23:01:16 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1522773664191737.8596399304139; Tue, 3 Apr 2018 09:41:04 -0700 (PDT) Received: from localhost ([::1]:47705 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3OzX-000407-CU for importer@patchew.org; Tue, 03 Apr 2018 12:41:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55436) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f3Ot7-0006tN-9s for qemu-devel@nongnu.org; Tue, 03 Apr 2018 12:34:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f3Ot5-0006e0-P3 for qemu-devel@nongnu.org; Tue, 03 Apr 2018 12:34:25 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:58608 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f3Ot0-0006aS-Sg; Tue, 03 Apr 2018 12:34:18 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 752334072CF7; Tue, 3 Apr 2018 16:34:18 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.36.118.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id A7C3410B2B22; Tue, 3 Apr 2018 16:34:17 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 3 Apr 2018 18:34:00 +0200 Message-Id: <20180403163400.6307-10-kwolf@redhat.com> In-Reply-To: <20180403163400.6307-1-kwolf@redhat.com> References: <20180403163400.6307-1-kwolf@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 03 Apr 2018 16:34:18 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 03 Apr 2018 16:34:18 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'kwolf@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL 9/9] iotests: Test abnormally large size in compressed cluster descriptor X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Alberto Garcia L2 entries for compressed clusters have a field that indicates the number of sectors used to store the data in the image. That's however not the size of the compressed data itself, just the number of sectors where that data is located. The actual data size is usually not a multiple of the sector size, and therefore cannot be represented with this field. The way it works is that QEMU reads all the specified sectors and starts decompressing the data until there's enough to recover the original uncompressed cluster. If there are any bytes left that haven't been decompressed they are simply ignored. One consequence of this is that even if the size field is larger than it needs to be QEMU can handle it just fine: it will read more data from disk but it will ignore the extra bytes. This test creates an image with two compressed clusters that use 5 sectors (2.5 KB) each, increases the size field to the maximum (8192 sectors, or 4 MB) and verifies that the data can be read without problems. This test is important because while the decompressed data takes exactly one cluster, the maximum value allowed in the compressed size field is twice the cluster size. So although QEMU won't produce images with such large values we need to make sure that it can handle them. Another effect of increasing the size field is that it can make it include data from the following host cluster(s). In this case 'qemu-img check' will detect that the refcounts are not correct, and we'll need to rebuild them. Additionally, this patch also tests that decreasing the size corrupts the image since the original data can no longer be recovered. In this case QEMU returns an error when trying to read the compressed data, but 'qemu-img check' doesn't see anything wrong if the refcounts are consistent. One possible task for the future is to make 'qemu-img check' verify the sizes of the compressed clusters, by trying to decompress the data and checking that the size stored in the L2 entry is correct. Signed-off-by: Alberto Garcia Message-id: 20180329120745.11154-1-berto@igalia.com Reviewed-by: Eric Blake Signed-off-by: Max Reitz --- tests/qemu-iotests/122 | 47 ++++++++++++++++++++++++++++++++++++++++++= ++++ tests/qemu-iotests/122.out | 33 ++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+) diff --git a/tests/qemu-iotests/122 b/tests/qemu-iotests/122 index 45b359c2ba..6cf4fcb866 100755 --- a/tests/qemu-iotests/122 +++ b/tests/qemu-iotests/122 @@ -130,6 +130,53 @@ $QEMU_IO -c "read -P 0 1024k 1022k" "$TEST_IMG" 2>&= 1 | _filter_qemu_io | _fil =20 =20 echo +echo "=3D=3D=3D Corrupted size field in compressed cluster descriptor =3D= =3D=3D" +echo +# Create an empty image and fill half of it with compressed data. +# The L2 entries of the two compressed clusters are located at +# 0x800000 and 0x800008, their original values are 0x4008000000a00000 +# and 0x4008000000a00802 (5 sectors for compressed data each). +_make_test_img 8M -o cluster_size=3D2M +$QEMU_IO -c "write -c -P 0x11 0 2M" -c "write -c -P 0x11 2M 2M" "$TEST_IMG= " \ + 2>&1 | _filter_qemu_io | _filter_testdir + +# Reduce size of compressed data to 4 sectors: this corrupts the image. +poke_file "$TEST_IMG" $((0x800000)) "\x40\x06" +$QEMU_IO -c "read -P 0x11 0 4M" "$TEST_IMG" 2>&1 | _filter_qemu_io | _fil= ter_testdir + +# 'qemu-img check' however doesn't see anything wrong because it +# doesn't try to decompress the data and the refcounts are consistent. +# TODO: update qemu-img so this can be detected. +_check_test_img + +# Increase size of compressed data to the maximum (8192 sectors). +# This makes QEMU read more data (8192 sectors instead of 5, host +# addresses [0xa00000, 0xdfffff]), but the decompression algorithm +# stops once we have enough to restore the uncompressed cluster, so +# the rest of the data is ignored. +poke_file "$TEST_IMG" $((0x800000)) "\x7f\xfe" +# Do it also for the second compressed cluster (L2 entry at 0x800008). +# In this case the compressed data would span 3 host clusters +# (host addresses: [0xa00802, 0xe00801]) +poke_file "$TEST_IMG" $((0x800008)) "\x7f\xfe" + +# Here the image is too small so we're asking QEMU to read beyond the +# end of the image. +$QEMU_IO -c "read -P 0x11 0 4M" "$TEST_IMG" 2>&1 | _filter_qemu_io | _fi= lter_testdir +# But if we grow the image we won't be reading beyond its end anymore. +$QEMU_IO -c "write -P 0x22 4M 4M" "$TEST_IMG" 2>&1 | _filter_qemu_io | _fi= lter_testdir +$QEMU_IO -c "read -P 0x11 0 4M" "$TEST_IMG" 2>&1 | _filter_qemu_io | _fi= lter_testdir + +# The refcount data is however wrong because due to the increased size +# of the compressed data it now reaches the following host clusters. +# This can be repaired by qemu-img check by increasing the refcount of +# those clusters. +# TODO: update qemu-img to correct the compressed cluster size instead. +_check_test_img -r all +$QEMU_IO -c "read -P 0x11 0 4M" "$TEST_IMG" 2>&1 | _filter_qemu_io | _fi= lter_testdir +$QEMU_IO -c "read -P 0x22 4M 4M" "$TEST_IMG" 2>&1 | _filter_qemu_io | _fi= lter_testdir + +echo echo "=3D=3D=3D Full allocation with -S 0 =3D=3D=3D" echo =20 diff --git a/tests/qemu-iotests/122.out b/tests/qemu-iotests/122.out index 47d8656db8..a6b7fe007e 100644 --- a/tests/qemu-iotests/122.out +++ b/tests/qemu-iotests/122.out @@ -99,6 +99,39 @@ read 1024/1024 bytes at offset 1047552 read 1046528/1046528 bytes at offset 1048576 1022 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) =20 +=3D=3D=3D Corrupted size field in compressed cluster descriptor =3D=3D=3D + +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D8388608 +wrote 2097152/2097152 bytes at offset 0 +2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote 2097152/2097152 bytes at offset 2097152 +2 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +read failed: Input/output error +No errors were found on the image. +read 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote 4194304/4194304 bytes at offset 4194304 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +read 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +ERROR cluster 6 refcount=3D1 reference=3D3 +ERROR cluster 7 refcount=3D1 reference=3D2 +Repairing cluster 6 refcount=3D1 reference=3D3 +Repairing cluster 7 refcount=3D1 reference=3D2 +Repairing OFLAG_COPIED data cluster: l2_entry=3D8000000000c00000 refcount= =3D3 +Repairing OFLAG_COPIED data cluster: l2_entry=3D8000000000e00000 refcount= =3D2 +The following inconsistencies were found and repaired: + + 0 leaked clusters + 4 corruptions + +Double checking the fixed image now... +No errors were found on the image. +read 4194304/4194304 bytes at offset 0 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +read 4194304/4194304 bytes at offset 4194304 +4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + =3D=3D=3D Full allocation with -S 0 =3D=3D=3D =20 Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 --=20 2.13.6