From nobody Mon May 5 17:12:59 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1566930412; cv=none; d=zoho.com; s=zohoarc; b=MKTcSnnfU0pzTPsx8UoY5fck1DkGY/iFVMnmg6/Wm7OK7NxSwp2KG04Qr6Zxc2dbpxbKJdhvzShGXrErX7INw3T6QGVWXOMN1SYWkccoZDCxIcN/ssdR2AWiH+fx+V3mt02Gz+drTSBSApvJrZ95RYmOOgbWu+0TNc9e+WyE+cA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566930412; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=g0rlLWVrgGQ5xAjXPzyPGFwWe2tUjQ5AGD41fYZbVgo=; b=UwkyrCpJzeUR38ILukMB+p7FOhLYDDZh4RShuO/PptiKQ/T1jlL6qNEa2klnvHrEW6qlHjbIo575h4sOAnMOmcRSUCGlpyyztTuBtzqDG1CAFQO1dL+LnY37KRkcJ7puC7wMFiLPmDiZ6YhaF4sfkNLLzPA0iuHTSBKaZavO5XA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from=<mreitz@redhat.com> (p=none dis=none) header.from=<mreitz@redhat.com> Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1566930412101118.45096738564712; Tue, 27 Aug 2019 11:26:52 -0700 (PDT) Received: from localhost ([::1]:55304 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+importer=patchew.org@nongnu.org>) id 1i2gB7-0004bQ-5I for importer@patchew.org; Tue, 27 Aug 2019 14:26:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53071) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <mreitz@redhat.com>) id 1i2g7n-0002Y3-He for qemu-devel@nongnu.org; Tue, 27 Aug 2019 14:23:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <mreitz@redhat.com>) id 1i2g7m-0005IN-1j for qemu-devel@nongnu.org; Tue, 27 Aug 2019 14:23:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38809) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <mreitz@redhat.com>) id 1i2g7j-0005GY-7h; Tue, 27 Aug 2019 14:23:19 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6DB4318C8917; Tue, 27 Aug 2019 18:23:18 +0000 (UTC) Received: from localhost (unknown [10.40.205.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0631C5D9E2; Tue, 27 Aug 2019 18:23:17 +0000 (UTC) From: Max Reitz <mreitz@redhat.com> To: qemu-block@nongnu.org Date: Tue, 27 Aug 2019 20:22:59 +0200 Message-Id: <20190827182313.25983-2-mreitz@redhat.com> In-Reply-To: <20190827182313.25983-1-mreitz@redhat.com> References: <20190827182313.25983-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.70]); Tue, 27 Aug 2019 18:23:18 +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/15] qemu-io: add pattern file for write command X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://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>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com> Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+importer=patchew.org@nongnu.org> Content-Type: text/plain; charset="utf-8" From: Denis Plotnikov <dplotnikov@virtuozzo.com> The patch allows to provide a pattern file for write command. There was no similar ability before. Signed-off-by: Denis Plotnikov <dplotnikov@virtuozzo.com> Message-id: 20190820164616.4072-1-dplotnikov@virtuozzo.com Reviewed-by: Eric Blake <eblake@redhat.com> [mreitz: Keep optstring in alphabetical order] Signed-off-by: Max Reitz <mreitz@redhat.com> --- qemu-io-cmds.c | 99 +++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 93 insertions(+), 6 deletions(-) diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c index 8904733961..d46fa166d3 100644 --- a/qemu-io-cmds.c +++ b/qemu-io-cmds.c @@ -350,6 +350,79 @@ static void qemu_io_free(void *p) qemu_vfree(p); } =20 +/* + * qemu_io_alloc_from_file() + * + * Allocates the buffer and populates it with the content of the given file + * up to @len bytes. If the file length is less than @len, then the buffer + * is populated with the file content cyclically. + * + * @blk - the block backend where the buffer content is going to be writte= n to + * @len - the buffer length + * @file_name - the file to read the content from + * + * Returns: the buffer pointer on success + * NULL on error + */ +static void *qemu_io_alloc_from_file(BlockBackend *blk, size_t len, + const char *file_name) +{ + char *buf, *buf_origin; + FILE *f =3D fopen(file_name, "r"); + int pattern_len; + + if (!f) { + perror(file_name); + return NULL; + } + + if (qemuio_misalign) { + len +=3D MISALIGN_OFFSET; + } + + buf_origin =3D buf =3D blk_blockalign(blk, len); + + if (qemuio_misalign) { + buf_origin +=3D MISALIGN_OFFSET; + buf +=3D MISALIGN_OFFSET; + len -=3D MISALIGN_OFFSET; + } + + pattern_len =3D fread(buf_origin, 1, len, f); + + if (ferror(f)) { + perror(file_name); + goto error; + } + + if (pattern_len =3D=3D 0) { + fprintf(stderr, "%s: file is empty\n", file_name); + goto error; + } + + fclose(f); + + if (len > pattern_len) { + len -=3D pattern_len; + buf +=3D pattern_len; + + while (len > 0) { + size_t len_to_copy =3D MIN(pattern_len, len); + + memcpy(buf, buf_origin, len_to_copy); + + len -=3D len_to_copy; + buf +=3D len_to_copy; + } + } + + return buf_origin; + +error: + qemu_io_free(buf_origin); + return NULL; +} + static void dump_buffer(const void *buffer, int64_t offset, int64_t len) { uint64_t i; @@ -948,6 +1021,7 @@ static void write_help(void) " -n, -- with -z, don't allow slow fallback\n" " -p, -- ignored for backwards compatibility\n" " -P, -- use different pattern to fill file\n" +" -s, -- use a pattern file to fill the write buffer\n" " -C, -- report statistics in a machine parsable format\n" " -q, -- quiet mode, do not show I/O statistics\n" " -u, -- with -z, allow unmapping\n" @@ -964,7 +1038,7 @@ static const cmdinfo_t write_cmd =3D { .perm =3D BLK_PERM_WRITE, .argmin =3D 2, .argmax =3D -1, - .args =3D "[-bcCfnquz] [-P pattern] off len", + .args =3D "[-bcCfnquz] [-P pattern | -s source_file] off len", .oneline =3D "writes a number of bytes at a specified offset", .help =3D write_help, }; @@ -973,7 +1047,7 @@ static int write_f(BlockBackend *blk, int argc, char *= *argv) { struct timespec t1, t2; bool Cflag =3D false, qflag =3D false, bflag =3D false; - bool Pflag =3D false, zflag =3D false, cflag =3D false; + bool Pflag =3D false, zflag =3D false, cflag =3D false, sflag =3D fals= e; int flags =3D 0; int c, cnt, ret; char *buf =3D NULL; @@ -982,8 +1056,9 @@ static int write_f(BlockBackend *blk, int argc, char *= *argv) /* Some compilers get confused and warn if this is not initialized. */ int64_t total =3D 0; int pattern =3D 0xcd; + const char *file_name =3D NULL; =20 - while ((c =3D getopt(argc, argv, "bcCfnpP:quz")) !=3D -1) { + while ((c =3D getopt(argc, argv, "bcCfnpP:qs:uz")) !=3D -1) { switch (c) { case 'b': bflag =3D true; @@ -1013,6 +1088,10 @@ static int write_f(BlockBackend *blk, int argc, char= **argv) case 'q': qflag =3D true; break; + case 's': + sflag =3D true; + file_name =3D optarg; + break; case 'u': flags |=3D BDRV_REQ_MAY_UNMAP; break; @@ -1050,8 +1129,9 @@ static int write_f(BlockBackend *blk, int argc, char = **argv) return -EINVAL; } =20 - if (zflag && Pflag) { - printf("-z and -P cannot be specified at the same time\n"); + if (zflag + Pflag + sflag > 1) { + printf("Only one of -z, -P, and -s " + "can be specified at the same time\n"); return -EINVAL; } =20 @@ -1087,7 +1167,14 @@ static int write_f(BlockBackend *blk, int argc, char= **argv) } =20 if (!zflag) { - buf =3D qemu_io_alloc(blk, count, pattern); + if (sflag) { + buf =3D qemu_io_alloc_from_file(blk, count, file_name); + if (!buf) { + return -EINVAL; + } + } else { + buf =3D qemu_io_alloc(blk, count, pattern); + } } =20 clock_gettime(CLOCK_MONOTONIC, &t1); --=20 2.21.0 From nobody Mon May 5 17:12:59 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1566930435; cv=none; d=zoho.com; s=zohoarc; b=XAihF2DY2FuDKxBCRb+OMZpsEVEMGH3GNERCx8018c0XeV6Gh/IyxS/gDd5snYQWDpNTV8UQ/ZByfY+tFyQy/WrUUTfdnj7e+kqCeEZi+J5eG96PLv9t74+TD/W632HTj4J5BSPKzjq0nCFNxX2eSYKhByVKFKCZLf1YylgOaHI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566930435; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=zqPRqDjNWqgYMuYvoBWcfx+UiJ2JuHMLQLedeJUX4z8=; b=EE4lYexjgemj5CZzciYwwSUhkLn5u/1TykavTBBTR+jIUvmBJNiC+TEFS4IUl7r897e2/M66Rk70E0OdC51eM5Ym1Xb+6PJnWihiCLeq2oYcGv0bMTFznFXmz02j+mlgZSHIaJ/nzqNZXlOTbwzMiQOsrWG0k2zS1NAFR6vOT2w= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from=<mreitz@redhat.com> (p=none dis=none) header.from=<mreitz@redhat.com> Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 156693043526746.06380592734615; Tue, 27 Aug 2019 11:27:15 -0700 (PDT) Received: from localhost ([::1]:55318 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+importer=patchew.org@nongnu.org>) id 1i2gBV-00052b-K2 for importer@patchew.org; Tue, 27 Aug 2019 14:27:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53102) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <mreitz@redhat.com>) id 1i2g7q-0002a2-0A for qemu-devel@nongnu.org; Tue, 27 Aug 2019 14:23:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <mreitz@redhat.com>) id 1i2g7n-0005Jm-RX for qemu-devel@nongnu.org; Tue, 27 Aug 2019 14:23:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59180) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <mreitz@redhat.com>) id 1i2g7l-0005Hq-Dh; Tue, 27 Aug 2019 14:23:21 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C0C2A8980EA; Tue, 27 Aug 2019 18:23:20 +0000 (UTC) Received: from localhost (unknown [10.40.205.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 56D48600D1; Tue, 27 Aug 2019 18:23:20 +0000 (UTC) From: Max Reitz <mreitz@redhat.com> To: qemu-block@nongnu.org Date: Tue, 27 Aug 2019 20:23:00 +0200 Message-Id: <20190827182313.25983-3-mreitz@redhat.com> In-Reply-To: <20190827182313.25983-1-mreitz@redhat.com> References: <20190827182313.25983-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.67]); Tue, 27 Aug 2019 18:23:20 +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 02/15] block: fix permission update in bdrv_replace_node X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://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>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com> Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+importer=patchew.org@nongnu.org> Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> It's wrong to OR shared permissions. It may lead to crash on further permission updates. Also, no needs to consider previously calculated permissions, as at this point we already bind all new parents and bdrv_get_cumulative_perm result is enough. So fix the bug by just set permissions by bdrv_get_cumulative_perm result. Bug was introduced in long ago 234ac1a9025, in 2.9. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-id: 20190824100740.61635-1-vsementsov@virtuozzo.com Signed-off-by: Max Reitz <mreitz@redhat.com> --- block.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/block.c b/block.c index 874a29a983..5944124845 100644 --- a/block.c +++ b/block.c @@ -4165,7 +4165,6 @@ void bdrv_replace_node(BlockDriverState *from, BlockD= riverState *to, { BdrvChild *c, *next; GSList *list =3D NULL, *p; - uint64_t old_perm, old_shared; uint64_t perm =3D 0, shared =3D BLK_PERM_ALL; int ret; =20 @@ -4211,8 +4210,8 @@ void bdrv_replace_node(BlockDriverState *from, BlockD= riverState *to, bdrv_unref(from); } =20 - bdrv_get_cumulative_perm(to, &old_perm, &old_shared); - bdrv_set_perm(to, old_perm | perm, old_shared | shared); + bdrv_get_cumulative_perm(to, &perm, &shared); + bdrv_set_perm(to, perm, shared); =20 out: g_slist_free(list); --=20 2.21.0 From nobody Mon May 5 17:12:59 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1566930434; cv=none; d=zoho.com; s=zohoarc; b=NA8XAZApaVfPVroykks11/tanwin/IkT3q+adYLzg03EUwgLj9GW60oYCSrDEAXY9QoXEWD0E+w0qW7yyyKa29C6TDmJHzQqRHnF8rfg1Kax9he5L3iSsKoIeUtaWvFJI5Q9Yt4zl7tkpWaYghGaiI6t/EgKgsDBlZ9ffRV97M8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566930434; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=MirBdr+xENZHNrTBbxlTayzVpXGYUUDT64XVdw8t59E=; b=HpuYBdKTKFI4HS/v2nFeKCw9R544Z6yIkhXXz/rJ/Cm1iHUoz8LCwJy6JcB55UdC8qIcJ9nhbHAaq1X5/QyVgd/y0dl4/DMPy6whT0l8Epsf3GlZAeuOMR0mxjgjLHwS6puAoYwGsVx3O/P0sR+v1dz3SMWAHLkZCMjtL1YFfjI= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from=<mreitz@redhat.com> (p=none dis=none) header.from=<mreitz@redhat.com> Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1566930434757510.9091475138091; Tue, 27 Aug 2019 11:27:14 -0700 (PDT) Received: from localhost ([::1]:55316 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+importer=patchew.org@nongnu.org>) id 1i2gBU-00050G-R1 for importer@patchew.org; Tue, 27 Aug 2019 14:27:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53193) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <mreitz@redhat.com>) id 1i2g7v-0002jJ-D8 for qemu-devel@nongnu.org; Tue, 27 Aug 2019 14:23:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <mreitz@redhat.com>) id 1i2g7t-0005NS-2H for qemu-devel@nongnu.org; Tue, 27 Aug 2019 14:23:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48972) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <mreitz@redhat.com>) id 1i2g7o-0005Jh-78; Tue, 27 Aug 2019 14:23:24 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4A7F93084295; Tue, 27 Aug 2019 18:23:23 +0000 (UTC) Received: from localhost (unknown [10.40.205.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A94E85C3FD; Tue, 27 Aug 2019 18:23:22 +0000 (UTC) From: Max Reitz <mreitz@redhat.com> To: qemu-block@nongnu.org Date: Tue, 27 Aug 2019 20:23:01 +0200 Message-Id: <20190827182313.25983-4-mreitz@redhat.com> In-Reply-To: <20190827182313.25983-1-mreitz@redhat.com> References: <20190827182313.25983-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Tue, 27 Aug 2019 18:23:23 +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 03/15] block: posix: Always allocate the first block X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://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>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com> Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+importer=patchew.org@nongnu.org> Content-Type: text/plain; charset="utf-8" From: Nir Soffer <nirsof@gmail.com> When creating an image with preallocation "off" or "falloc", the first block of the image is typically not allocated. When using Gluster storage backed by XFS filesystem, reading this block using direct I/O succeeds regardless of request length, fooling alignment detection. In this case we fallback to a safe value (4096) instead of the optimal value (512), which may lead to unneeded data copying when aligning requests. Allocating the first block avoids the fallback. Since we allocate the first block even with preallocation=3Doff, we no longer create images with zero disk size: $ ./qemu-img create -f raw test.raw 1g Formatting 'test.raw', fmt=3Draw size=3D1073741824 $ ls -lhs test.raw 4.0K -rw-r--r--. 1 nsoffer nsoffer 1.0G Aug 16 23:48 test.raw And converting the image requires additional cluster: $ ./qemu-img measure -f raw -O qcow2 test.raw required size: 458752 fully allocated size: 1074135040 When using format like vmdk with multiple files per image, we allocate one block per file: $ ./qemu-img create -f vmdk -o subformat=3DtwoGbMaxExtentFlat test.vmdk= 4g Formatting 'test.vmdk', fmt=3Dvmdk size=3D4294967296 compat6=3Doff hwve= rsion=3Dundefined subformat=3DtwoGbMaxExtentFlat $ ls -lhs test*.vmdk 4.0K -rw-r--r--. 1 nsoffer nsoffer 2.0G Aug 27 03:23 test-f001.vmdk 4.0K -rw-r--r--. 1 nsoffer nsoffer 2.0G Aug 27 03:23 test-f002.vmdk 4.0K -rw-r--r--. 1 nsoffer nsoffer 353 Aug 27 03:23 test.vmdk I did quick performance test for copying disks with qemu-img convert to new raw target image to Gluster storage with sector size of 512 bytes: for i in $(seq 10); do rm -f dst.raw sleep 10 time ./qemu-img convert -f raw -O raw -t none -T none src.raw dst.r= aw done Here is a table comparing the total time spent: Type Before(s) After(s) Diff(%) Reviewed-by: Max Reitz <mreitz@redhat.com> --------------------------------------- real 530.028 469.123 -11.4 user 17.204 10.768 -37.4 sys 17.881 7.011 -60.7 We can see very clear improvement in CPU usage. Signed-off-by: Nir Soffer <nsoffer@redhat.com> Message-id: 20190827010528.8818-2-nsoffer@redhat.com Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com> --- block/file-posix.c | 51 +++++++++++++++++++ tests/qemu-iotests/059.out | 2 +- tests/qemu-iotests/{150.out =3D> 150.out.qcow2} | 0 tests/qemu-iotests/150.out.raw | 12 +++++ tests/qemu-iotests/175 | 19 ++++--- tests/qemu-iotests/175.out | 8 +-- tests/qemu-iotests/178.out.qcow2 | 4 +- tests/qemu-iotests/221.out | 12 +++-- tests/qemu-iotests/253.out | 12 +++-- 9 files changed, 99 insertions(+), 21 deletions(-) rename tests/qemu-iotests/{150.out =3D> 150.out.qcow2} (100%) create mode 100644 tests/qemu-iotests/150.out.raw diff --git a/block/file-posix.c b/block/file-posix.c index fbeb0068db..447f937aa1 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -1749,6 +1749,43 @@ static int handle_aiocb_discard(void *opaque) return ret; } =20 +/* + * Help alignment probing by allocating the first block. + * + * When reading with direct I/O from unallocated area on Gluster backed by= XFS, + * reading succeeds regardless of request length. In this case we fallback= to + * safe alignment which is not optimal. Allocating the first block avoids = this + * fallback. + * + * fd may be opened with O_DIRECT, but we don't know the buffer alignment = or + * request alignment, so we use safe values. + * + * Returns: 0 on success, -errno on failure. Since this is an optimization, + * caller may ignore failures. + */ +static int allocate_first_block(int fd, size_t max_size) +{ + size_t write_size =3D (max_size < MAX_BLOCKSIZE) + ? BDRV_SECTOR_SIZE + : MAX_BLOCKSIZE; + size_t max_align =3D MAX(MAX_BLOCKSIZE, getpagesize()); + void *buf; + ssize_t n; + int ret; + + buf =3D qemu_memalign(max_align, write_size); + memset(buf, 0, write_size); + + do { + n =3D pwrite(fd, buf, write_size, 0); + } while (n =3D=3D -1 && errno =3D=3D EINTR); + + ret =3D (n =3D=3D -1) ? -errno : 0; + + qemu_vfree(buf); + return ret; +} + static int handle_aiocb_truncate(void *opaque) { RawPosixAIOData *aiocb =3D opaque; @@ -1788,6 +1825,17 @@ static int handle_aiocb_truncate(void *opaque) /* posix_fallocate() doesn't set errno. */ error_setg_errno(errp, -result, "Could not preallocate new data"); + } else if (current_length =3D=3D 0) { + /* + * posix_fallocate() uses fallocate() if the filesystem + * supports it, or fallback to manually writing zeroes. If + * fallocate() was used, unaligned reads from the fallocat= ed + * area in raw_probe_alignment() will succeed, hence we ne= ed to + * allocate the first block. + * + * Optimize future alignment probing; ignore failures. + */ + allocate_first_block(fd, offset); } } else { result =3D 0; @@ -1849,6 +1897,9 @@ static int handle_aiocb_truncate(void *opaque) if (ftruncate(fd, offset) !=3D 0) { result =3D -errno; error_setg_errno(errp, -result, "Could not resize file"); + } else if (current_length =3D=3D 0 && offset > current_length) { + /* Optimize future alignment probing; ignore failures. */ + allocate_first_block(fd, offset); } return result; default: diff --git a/tests/qemu-iotests/059.out b/tests/qemu-iotests/059.out index 4fab42a28c..fe3f861f3c 100644 --- a/tests/qemu-iotests/059.out +++ b/tests/qemu-iotests/059.out @@ -27,7 +27,7 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D10737= 41824000 subformat=3DtwoGbMax image: TEST_DIR/t.vmdk file format: vmdk virtual size: 0.977 TiB (1073741824000 bytes) -disk size: 16 KiB +disk size: 1.97 MiB Format specific information: cid: XXXXXXXX parent cid: XXXXXXXX diff --git a/tests/qemu-iotests/150.out b/tests/qemu-iotests/150.out.qcow2 similarity index 100% rename from tests/qemu-iotests/150.out rename to tests/qemu-iotests/150.out.qcow2 diff --git a/tests/qemu-iotests/150.out.raw b/tests/qemu-iotests/150.out.raw new file mode 100644 index 0000000000..3cdc7727a5 --- /dev/null +++ b/tests/qemu-iotests/150.out.raw @@ -0,0 +1,12 @@ +QA output created by 150 + +=3D=3D=3D Mapping sparse conversion =3D=3D=3D + +Offset Length File +0 0x1000 TEST_DIR/t.IMGFMT + +=3D=3D=3D Mapping non-sparse conversion =3D=3D=3D + +Offset Length File +0 0x100000 TEST_DIR/t.IMGFMT +*** done diff --git a/tests/qemu-iotests/175 b/tests/qemu-iotests/175 index 51e62c8276..7ba28b3c1b 100755 --- a/tests/qemu-iotests/175 +++ b/tests/qemu-iotests/175 @@ -37,14 +37,16 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 # the file size. This function hides the resulting difference in the # stat -c '%b' output. # Parameter 1: Number of blocks an empty file occupies -# Parameter 2: Image size in bytes +# Parameter 2: Minimal number of blocks in an image +# Parameter 3: Image size in bytes _filter_blocks() { extra_blocks=3D$1 - img_size=3D$2 + min_blocks=3D$2 + img_size=3D$3 =20 - sed -e "s/blocks=3D$extra_blocks\\(\$\\|[^0-9]\\)/nothing allocated/" \ - -e "s/blocks=3D$((extra_blocks + img_size / 512))\\(\$\\|[^0-9]\\)= /everything allocated/" + sed -e "s/blocks=3D$min_blocks\\(\$\\|[^0-9]\\)/min allocation/" \ + -e "s/blocks=3D$((extra_blocks + img_size / 512))\\(\$\\|[^0-9]\\)= /max allocation/" } =20 # get standard environment, filters and checks @@ -60,16 +62,21 @@ size=3D$((1 * 1024 * 1024)) touch "$TEST_DIR/empty" extra_blocks=3D$(stat -c '%b' "$TEST_DIR/empty") =20 +# We always write the first byte; check how many blocks this filesystem +# allocates to match empty image alloation. +printf "\0" > "$TEST_DIR/empty" +min_blocks=3D$(stat -c '%b' "$TEST_DIR/empty") + echo echo "=3D=3D creating image with default preallocation =3D=3D" _make_test_img $size | _filter_imgfmt -stat -c "size=3D%s, blocks=3D%b" $TEST_IMG | _filter_blocks $extra_blocks = $size +stat -c "size=3D%s, blocks=3D%b" $TEST_IMG | _filter_blocks $extra_blocks = $min_blocks $size =20 for mode in off full falloc; do echo echo "=3D=3D creating image with preallocation $mode =3D=3D" IMGOPTS=3Dpreallocation=3D$mode _make_test_img $size | _filter_imgfmt - stat -c "size=3D%s, blocks=3D%b" $TEST_IMG | _filter_blocks $extra_blo= cks $size + stat -c "size=3D%s, blocks=3D%b" $TEST_IMG | _filter_blocks $extra_blo= cks $min_blocks $size done =20 # success, all done diff --git a/tests/qemu-iotests/175.out b/tests/qemu-iotests/175.out index 6d9a5ed84e..263e521262 100644 --- a/tests/qemu-iotests/175.out +++ b/tests/qemu-iotests/175.out @@ -2,17 +2,17 @@ QA output created by 175 =20 =3D=3D creating image with default preallocation =3D=3D Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1048576 -size=3D1048576, nothing allocated +size=3D1048576, min allocation =20 =3D=3D creating image with preallocation off =3D=3D Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1048576 preallocation= =3Doff -size=3D1048576, nothing allocated +size=3D1048576, min allocation =20 =3D=3D creating image with preallocation full =3D=3D Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1048576 preallocation= =3Dfull -size=3D1048576, everything allocated +size=3D1048576, max allocation =20 =3D=3D creating image with preallocation falloc =3D=3D Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1048576 preallocation= =3Dfalloc -size=3D1048576, everything allocated +size=3D1048576, max allocation *** done diff --git a/tests/qemu-iotests/178.out.qcow2 b/tests/qemu-iotests/178.out.= qcow2 index 55a8dc926f..9e7d8c44df 100644 --- a/tests/qemu-iotests/178.out.qcow2 +++ b/tests/qemu-iotests/178.out.qcow2 @@ -101,7 +101,7 @@ converted image file size in bytes: 196608 =3D=3D raw input image with data (human) =3D=3D =20 Formatting 'TEST_DIR/t.qcow2', fmt=3DIMGFMT size=3D1073741824 -required size: 393216 +required size: 458752 fully allocated size: 1074135040 wrote 512/512 bytes at offset 512 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) @@ -257,7 +257,7 @@ converted image file size in bytes: 196608 =20 Formatting 'TEST_DIR/t.qcow2', fmt=3DIMGFMT size=3D1073741824 { - "required": 393216, + "required": 458752, "fully-allocated": 1074135040 } wrote 512/512 bytes at offset 512 diff --git a/tests/qemu-iotests/221.out b/tests/qemu-iotests/221.out index 9f9dd52bb0..dca024a0c3 100644 --- a/tests/qemu-iotests/221.out +++ b/tests/qemu-iotests/221.out @@ -3,14 +3,18 @@ QA output created by 221 =3D=3D=3D Check mapping of unaligned raw image =3D=3D=3D =20 Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D65537 -[{ "start": 0, "length": 66048, "depth": 0, "zero": true, "data": false, "= offset": OFFSET}] -[{ "start": 0, "length": 66048, "depth": 0, "zero": true, "data": false, "= offset": OFFSET}] +[{ "start": 0, "length": 4096, "depth": 0, "zero": false, "data": true, "o= ffset": OFFSET}, +{ "start": 4096, "length": 61952, "depth": 0, "zero": true, "data": false,= "offset": OFFSET}] +[{ "start": 0, "length": 4096, "depth": 0, "zero": false, "data": true, "o= ffset": OFFSET}, +{ "start": 4096, "length": 61952, "depth": 0, "zero": true, "data": false,= "offset": OFFSET}] wrote 1/1 bytes at offset 65536 1 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -[{ "start": 0, "length": 65536, "depth": 0, "zero": true, "data": false, "= offset": OFFSET}, +[{ "start": 0, "length": 4096, "depth": 0, "zero": false, "data": true, "o= ffset": OFFSET}, +{ "start": 4096, "length": 61440, "depth": 0, "zero": true, "data": false,= "offset": OFFSET}, { "start": 65536, "length": 1, "depth": 0, "zero": false, "data": true, "o= ffset": OFFSET}, { "start": 65537, "length": 511, "depth": 0, "zero": true, "data": false, = "offset": OFFSET}] -[{ "start": 0, "length": 65536, "depth": 0, "zero": true, "data": false, "= offset": OFFSET}, +[{ "start": 0, "length": 4096, "depth": 0, "zero": false, "data": true, "o= ffset": OFFSET}, +{ "start": 4096, "length": 61440, "depth": 0, "zero": true, "data": false,= "offset": OFFSET}, { "start": 65536, "length": 1, "depth": 0, "zero": false, "data": true, "o= ffset": OFFSET}, { "start": 65537, "length": 511, "depth": 0, "zero": true, "data": false, = "offset": OFFSET}] *** done diff --git a/tests/qemu-iotests/253.out b/tests/qemu-iotests/253.out index 607c0baa0b..3d08b305d7 100644 --- a/tests/qemu-iotests/253.out +++ b/tests/qemu-iotests/253.out @@ -3,12 +3,16 @@ QA output created by 253 =3D=3D=3D Check mapping of unaligned raw image =3D=3D=3D =20 Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1048575 -[{ "start": 0, "length": 1048576, "depth": 0, "zero": true, "data": false,= "offset": OFFSET}] -[{ "start": 0, "length": 1048576, "depth": 0, "zero": true, "data": false,= "offset": OFFSET}] +[{ "start": 0, "length": 4096, "depth": 0, "zero": false, "data": true, "o= ffset": OFFSET}, +{ "start": 4096, "length": 1044480, "depth": 0, "zero": true, "data": fals= e, "offset": OFFSET}] +[{ "start": 0, "length": 4096, "depth": 0, "zero": false, "data": true, "o= ffset": OFFSET}, +{ "start": 4096, "length": 1044480, "depth": 0, "zero": true, "data": fals= e, "offset": OFFSET}] wrote 65535/65535 bytes at offset 983040 63.999 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -[{ "start": 0, "length": 983040, "depth": 0, "zero": true, "data": false, = "offset": OFFSET}, +[{ "start": 0, "length": 4096, "depth": 0, "zero": false, "data": true, "o= ffset": OFFSET}, +{ "start": 4096, "length": 978944, "depth": 0, "zero": true, "data": false= , "offset": OFFSET}, { "start": 983040, "length": 65536, "depth": 0, "zero": false, "data": tru= e, "offset": OFFSET}] -[{ "start": 0, "length": 983040, "depth": 0, "zero": true, "data": false, = "offset": OFFSET}, +[{ "start": 0, "length": 4096, "depth": 0, "zero": false, "data": true, "o= ffset": OFFSET}, +{ "start": 4096, "length": 978944, "depth": 0, "zero": true, "data": false= , "offset": OFFSET}, { "start": 983040, "length": 65536, "depth": 0, "zero": false, "data": tru= e, "offset": OFFSET}] *** done --=20 2.21.0 From nobody Mon May 5 17:12:59 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1566930939; cv=none; d=zoho.com; s=zohoarc; b=fAh04/O/NlmITvYWdKbKIiepGK2gJ3UmCf1F3JoVJZ36oYzUaPOwaiJQ1DBwipHiGTGOL3wksN1edSIkjb1anOsyK2RvI7iP2Rzby6ik4XnH/LrpWN1oKA4tq6Zt5H3v7UiC1q+60HwojxWS4eJRWGcGlN+sKU2/YnhDgqUWeiA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566930939; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=3XQG7TokpNOtvXIuI6mE6XdQ337M7AHjETWNqKoD/R0=; b=afFVJGnLsz7nFOvBnfP3J1y1bfsNQlMzkhZIbwmKIxNojtIY809h2o/jJfRsVtjH6DXUsg2nxT+BwzNqWZoPz9b1TsMmjO7M/aQWVJ4ib0UdFtI5kWdX4TVKYitEXvGKwlhwbs0xkWbe0zQ8KTz2O2cTFQbnfuOGFLDcM20e6wc= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from=<mreitz@redhat.com> (p=none dis=none) header.from=<mreitz@redhat.com> Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 15669309393561005.2243865255192; Tue, 27 Aug 2019 11:35:39 -0700 (PDT) Received: from localhost ([::1]:55608 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+importer=patchew.org@nongnu.org>) id 1i2gJd-0003hO-Dq for importer@patchew.org; Tue, 27 Aug 2019 14:35:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53169) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <mreitz@redhat.com>) id 1i2g7u-0002g5-Bl for qemu-devel@nongnu.org; Tue, 27 Aug 2019 14:23:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <mreitz@redhat.com>) id 1i2g7s-0005NI-VD for qemu-devel@nongnu.org; Tue, 27 Aug 2019 14:23:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45180) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <mreitz@redhat.com>) id 1i2g7q-0005Kr-8y; Tue, 27 Aug 2019 14:23:26 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9AA23308FB9D; Tue, 27 Aug 2019 18:23:25 +0000 (UTC) Received: from localhost (unknown [10.40.205.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3304C10016EB; Tue, 27 Aug 2019 18:23:25 +0000 (UTC) From: Max Reitz <mreitz@redhat.com> To: qemu-block@nongnu.org Date: Tue, 27 Aug 2019 20:23:02 +0200 Message-Id: <20190827182313.25983-5-mreitz@redhat.com> In-Reply-To: <20190827182313.25983-1-mreitz@redhat.com> References: <20190827182313.25983-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Tue, 27 Aug 2019 18:23:25 +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 04/15] iotests: Test allocate_first_block() with O_DIRECT X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://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>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com> Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+importer=patchew.org@nongnu.org> Content-Type: text/plain; charset="utf-8" From: Nir Soffer <nirsof@gmail.com> Using block_resize we can test allocate_first_block() with file descriptor opened with O_DIRECT, ensuring that it works for any size larger than 4096 bytes. Testing smaller sizes is tricky as the result depends on the filesystem used for testing. For example on NFS any size will work since O_DIRECT does not require any alignment. Signed-off-by: Nir Soffer <nsoffer@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20190827010528.8818-3-nsoffer@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com> --- tests/qemu-iotests/175 | 28 ++++++++++++++++++++++++++++ tests/qemu-iotests/175.out | 8 ++++++++ 2 files changed, 36 insertions(+) diff --git a/tests/qemu-iotests/175 b/tests/qemu-iotests/175 index 7ba28b3c1b..55db2803ed 100755 --- a/tests/qemu-iotests/175 +++ b/tests/qemu-iotests/175 @@ -49,6 +49,23 @@ _filter_blocks() -e "s/blocks=3D$((extra_blocks + img_size / 512))\\(\$\\|[^0-9]\\)= /max allocation/" } =20 +# Resize image using block_resize. +# Parameter 1: image path +# Parameter 2: new size +_block_resize() +{ + local path=3D$1 + local size=3D$2 + + $QEMU -qmp stdio -nographic -nodefaults \ + -blockdev file,node-name=3Dfile,filename=3D$path,cache.direct=3Don= \ + <<EOF +{'execute': 'qmp_capabilities'} +{'execute': 'block_resize', 'arguments': {'node-name': 'file', 'size': $si= ze}} +{'execute': 'quit'} +EOF +} + # get standard environment, filters and checks . ./common.rc . ./common.filter @@ -57,6 +74,9 @@ _supported_fmt raw _supported_proto file _supported_os Linux =20 +_default_cache_mode none +_supported_cache_modes none directsync + size=3D$((1 * 1024 * 1024)) =20 touch "$TEST_DIR/empty" @@ -79,6 +99,14 @@ for mode in off full falloc; do stat -c "size=3D%s, blocks=3D%b" $TEST_IMG | _filter_blocks $extra_blo= cks $min_blocks $size done =20 +for new_size in 4096 1048576; do + echo + echo "=3D=3D resize empty image with block_resize =3D=3D" + _make_test_img 0 | _filter_imgfmt + _block_resize $TEST_IMG $new_size >/dev/null + stat -c "size=3D%s, blocks=3D%b" $TEST_IMG | _filter_blocks $extra_blo= cks $min_blocks $new_size +done + # success, all done echo "*** done" rm -f $seq.full diff --git a/tests/qemu-iotests/175.out b/tests/qemu-iotests/175.out index 263e521262..39c2ee0f62 100644 --- a/tests/qemu-iotests/175.out +++ b/tests/qemu-iotests/175.out @@ -15,4 +15,12 @@ size=3D1048576, max allocation =3D=3D creating image with preallocation falloc =3D=3D Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1048576 preallocation= =3Dfalloc size=3D1048576, max allocation + +=3D=3D resize empty image with block_resize =3D=3D +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D0 +size=3D4096, min allocation + +=3D=3D resize empty image with block_resize =3D=3D +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D0 +size=3D1048576, min allocation *** done --=20 2.21.0 From nobody Mon May 5 17:12:59 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1566930810; cv=none; d=zoho.com; s=zohoarc; b=XqIe0E2rtbWclm86ySJREfLiQ7orfAO0mUKDd2gxDeIEiwg0ocfsNGJ/3SEuPRi5ZJtO+KXn5n/JrwOW+eRxWAcMomRp2uA5HKgtL0whpJY5ESD8IIYJOkkvo9RtltLUnf34c77vo+ZgxhkZF9tmV+wcHorrOAJVCXQASkXkPGI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566930810; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=OVpurlN6end7xMWxGhsyA6OQagACNB+jl3ifuLz4PuI=; b=cBxUffK9b+5wT3Ordm8HMSy/NjEJkySMctxdK5U5vebBdTAEsUWX/sUuT+PGLfvYBcZ9Vodo5rhce7eCu05XuDhVUS6rhR+C0e2lPdJvCvfflQQSFT0lVEmhIUTbjcByLNiLRQcbn2nunLo3DjJV885kSikkWGmn7OBqkggFt+0= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from=<mreitz@redhat.com> (p=none dis=none) header.from=<mreitz@redhat.com> Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 156693081015490.70157032822681; Tue, 27 Aug 2019 11:33:30 -0700 (PDT) Received: from localhost ([::1]:55570 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+importer=patchew.org@nongnu.org>) id 1i2gHV-0001u1-6s for importer@patchew.org; Tue, 27 Aug 2019 14:33:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53231) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <mreitz@redhat.com>) id 1i2g7x-0002mP-Ht for qemu-devel@nongnu.org; Tue, 27 Aug 2019 14:23:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <mreitz@redhat.com>) id 1i2g7v-0005PZ-SR for qemu-devel@nongnu.org; Tue, 27 Aug 2019 14:23:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50928) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <mreitz@redhat.com>) id 1i2g7s-0005Mj-Jo; Tue, 27 Aug 2019 14:23:28 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ED5653D962; Tue, 27 Aug 2019 18:23:27 +0000 (UTC) Received: from localhost (unknown [10.40.205.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 83C6D60C05; Tue, 27 Aug 2019 18:23:27 +0000 (UTC) From: Max Reitz <mreitz@redhat.com> To: qemu-block@nongnu.org Date: Tue, 27 Aug 2019 20:23:03 +0200 Message-Id: <20190827182313.25983-6-mreitz@redhat.com> In-Reply-To: <20190827182313.25983-1-mreitz@redhat.com> References: <20190827182313.25983-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 27 Aug 2019 18:23:28 +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 05/15] iotests: Fix _filter_img_create() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://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>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com> Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+importer=patchew.org@nongnu.org> Content-Type: text/plain; charset="utf-8" fe646693acc changed qemu-img create's output so that it no longer prints single quotes around parameter values. The subformat and adapter_type filters in _filter_img_create() have never been adapted to that change. Fixes: fe646693acc13ac48b98435d14149ab04dc597bc Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 20190815153638.4600-2-mreitz@redhat.com Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com> --- tests/qemu-iotests/059.out | 16 ++++++++-------- tests/qemu-iotests/common.filter | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/qemu-iotests/059.out b/tests/qemu-iotests/059.out index fe3f861f3c..b2e718d29f 100644 --- a/tests/qemu-iotests/059.out +++ b/tests/qemu-iotests/059.out @@ -13,17 +13,17 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D671= 08864 qemu-io: can't open device TEST_DIR/t.vmdk: L1 size too big =20 =3D=3D=3D Testing monolithicFlat creation and opening =3D=3D=3D -Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D2147483648 subformat= =3DmonolithicFlat +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D2147483648 image: TEST_DIR/t.IMGFMT file format: IMGFMT virtual size: 2 GiB (2147483648 bytes) =20 =3D=3D=3D Testing monolithicFlat with zeroed_grain =3D=3D=3D qemu-img: TEST_DIR/t.IMGFMT: Flat image can't enable zeroed grain -Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D2147483648 subformat= =3DmonolithicFlat +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D2147483648 =20 =3D=3D=3D Testing big twoGbMaxExtentFlat =3D=3D=3D -Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824000 subforma= t=3DtwoGbMaxExtentFlat +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1073741824000 image: TEST_DIR/t.vmdk file format: vmdk virtual size: 0.977 TiB (1073741824000 bytes) @@ -2038,7 +2038,7 @@ Format specific information: qemu-img: Could not open 'TEST_DIR/t.IMGFMT': Invalid extent line: RW 1258= 2912 VMFS "dummy.IMGFMT" 1 =20 =3D=3D=3D Testing truncated sparse =3D=3D=3D -Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D107374182400 subformat= =3DmonolithicSparse +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D107374182400 qemu-img: Could not open 'TEST_DIR/t.IMGFMT': File truncated, expecting at= least 13172736 bytes =20 =3D=3D=3D Converting to streamOptimized from image with small cluster size= =3D=3D=3D @@ -2049,7 +2049,7 @@ wrote 512/512 bytes at offset 10240 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) =20 =3D=3D=3D Testing monolithicFlat with internally generated JSON file name = =3D=3D=3D -Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 subformat=3Dm= onolithicFlat +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 qemu-io: can't open: Cannot use relative extent paths with VMDK descriptor= file 'json:{"image": {"driver": "file", "filename": "TEST_DIR/t.IMGFMT"}, = "driver": "blkdebug", "inject-error.0.event": "read_aio"}' =20 =3D=3D=3D Testing version 3 =3D=3D=3D @@ -2259,7 +2259,7 @@ read 512/512 bytes at offset 64931328 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) =20 =3D=3D=3D Testing 4TB monolithicFlat creation and IO =3D=3D=3D -Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D4398046511104 subforma= t=3DmonolithicFlat +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D4398046511104 image: TEST_DIR/t.IMGFMT file format: IMGFMT virtual size: 4 TiB (4398046511104 bytes) @@ -2333,7 +2333,7 @@ read 1024/1024 bytes at offset 966367641600 1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) =20 =3D=3D=3D Testing qemu-img map on extents =3D=3D=3D -Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D33285996544 subformat= =3DmonolithicSparse +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D33285996544 wrote 1024/1024 bytes at offset 65024 1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote 1024/1024 bytes at offset 2147483136 @@ -2344,7 +2344,7 @@ Offset Length Mapped to File 0 0x20000 0x3f0000 TEST_DIR/t.vmdk 0x7fff0000 0x20000 0x410000 TEST_DIR/t.vmdk 0x140000000 0x10000 0x430000 TEST_DIR/t.vmdk -Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D33285996544 subformat= =3DtwoGbMaxExtentSparse +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D33285996544 wrote 1024/1024 bytes at offset 65024 1 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) wrote 1024/1024 bytes at offset 2147483136 diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.f= ilter index 8e9235d6fe..445a1c23e0 100644 --- a/tests/qemu-iotests/common.filter +++ b/tests/qemu-iotests/common.filter @@ -130,8 +130,8 @@ _filter_img_create() -e "s# compat6=3D\\(on\\|off\\)##g" \ -e "s# static=3D\\(on\\|off\\)##g" \ -e "s# zeroed_grain=3D\\(on\\|off\\)##g" \ - -e "s# subformat=3D'[^']*'##g" \ - -e "s# adapter_type=3D'[^']*'##g" \ + -e "s# subformat=3D[^ ]*##g" \ + -e "s# adapter_type=3D[^ ]*##g" \ -e "s# hwversion=3D[^ ]*##g" \ -e "s# lazy_refcounts=3D\\(on\\|off\\)##g" \ -e "s# block_size=3D[0-9]\\+##g" \ --=20 2.21.0 From nobody Mon May 5 17:12:59 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1566930691; cv=none; d=zoho.com; s=zohoarc; b=eb+DHoS5GffeZ4O36+IS1EP/5c37jNiV40oTrwSwjRrqlYDabhP4zDqcEuUQqiJ7rj1LBKRc1WU46r9aeWWs9vo22vjiNMepY9vdwRZsMaxATraWMOUbzUKDSLqSZvLennNrUJHly0YQrHLJmIQeKV3o3amI8gsQ3+qGJz+jO1s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566930691; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=4J18hO+GRmiaGJq/N9aKdY51x2U8t/lSeIL9brBKMHc=; b=ebkBdUyt/pVX5y+D/duCTr0IDpl56QWWBDv//bvJBLocKuhCoaMWJ1kXXRbKYJjJCDFNs8uBOZK9OxVPaBL5xz4W+ZjjKrYJwzRiHn74maAp3fVzFrQapVv9J+ycidTl0P6BwrGXGnCmiXlabZeV+fS/S5PbQFWLW0CH3ZitJR4= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from=<mreitz@redhat.com> (p=none dis=none) header.from=<mreitz@redhat.com> Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1566930691973134.91457952938697; Tue, 27 Aug 2019 11:31:31 -0700 (PDT) Received: from localhost ([::1]:55496 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+importer=patchew.org@nongnu.org>) id 1i2gFa-0000S0-De for importer@patchew.org; Tue, 27 Aug 2019 14:31:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53305) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <mreitz@redhat.com>) id 1i2g80-0002qe-Gg for qemu-devel@nongnu.org; Tue, 27 Aug 2019 14:23:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <mreitz@redhat.com>) id 1i2g7y-0005Rg-Nq for qemu-devel@nongnu.org; Tue, 27 Aug 2019 14:23:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58584) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <mreitz@redhat.com>) id 1i2g7v-0005Oa-4w; Tue, 27 Aug 2019 14:23:31 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 76F1881F18; Tue, 27 Aug 2019 18:23:30 +0000 (UTC) Received: from localhost (unknown [10.40.205.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D467D60600; Tue, 27 Aug 2019 18:23:29 +0000 (UTC) From: Max Reitz <mreitz@redhat.com> To: qemu-block@nongnu.org Date: Tue, 27 Aug 2019 20:23:04 +0200 Message-Id: <20190827182313.25983-7-mreitz@redhat.com> In-Reply-To: <20190827182313.25983-1-mreitz@redhat.com> References: <20190827182313.25983-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Tue, 27 Aug 2019 18:23:30 +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 06/15] vmdk: Use bdrv_dirname() for relative extent paths X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://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>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com> Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+importer=patchew.org@nongnu.org> Content-Type: text/plain; charset="utf-8" This makes iotest 033 pass with e.g. subformat=3DmonolithicFlat. It also turns a former error in 059 into success. Signed-off-by: Max Reitz <mreitz@redhat.com> Message-id: 20190815153638.4600-3-mreitz@redhat.com Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com> --- block/vmdk.c | 54 ++++++++++++++++++++++++-------------- tests/qemu-iotests/059 | 7 +++-- tests/qemu-iotests/059.out | 4 ++- 3 files changed, 42 insertions(+), 23 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index fd78fd0ccf..a7f82e665e 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -1076,8 +1076,7 @@ static const char *next_line(const char *s) } =20 static int vmdk_parse_extents(const char *desc, BlockDriverState *bs, - const char *desc_file_path, QDict *options, - Error **errp) + QDict *options, Error **errp) { int ret; int matches; @@ -1087,6 +1086,7 @@ static int vmdk_parse_extents(const char *desc, Block= DriverState *bs, const char *p, *np; int64_t sectors =3D 0; int64_t flat_offset; + char *desc_file_dir =3D NULL; char *extent_path; BdrvChild *extent_file; BDRVVmdkState *s =3D bs->opaque; @@ -1130,16 +1130,23 @@ static int vmdk_parse_extents(const char *desc, Blo= ckDriverState *bs, continue; } =20 - if (!path_is_absolute(fname) && !path_has_protocol(fname) && - !desc_file_path[0]) - { - bdrv_refresh_filename(bs->file->bs); - error_setg(errp, "Cannot use relative extent paths with VMDK " - "descriptor file '%s'", bs->file->bs->filename); - return -EINVAL; - } + if (path_is_absolute(fname)) { + extent_path =3D g_strdup(fname); + } else { + if (!desc_file_dir) { + desc_file_dir =3D bdrv_dirname(bs->file->bs, errp); + if (!desc_file_dir) { + bdrv_refresh_filename(bs->file->bs); + error_prepend(errp, "Cannot use relative paths with VM= DK " + "descriptor file '%s': ", + bs->file->bs->filename); + ret =3D -EINVAL; + goto out; + } + } =20 - extent_path =3D path_combine(desc_file_path, fname); + extent_path =3D g_strconcat(desc_file_dir, fname, NULL); + } =20 ret =3D snprintf(extent_opt_prefix, 32, "extents.%d", s->num_exten= ts); assert(ret < 32); @@ -1149,7 +1156,8 @@ static int vmdk_parse_extents(const char *desc, Block= DriverState *bs, g_free(extent_path); if (local_err) { error_propagate(errp, local_err); - return -EINVAL; + ret =3D -EINVAL; + goto out; } =20 /* save to extents array */ @@ -1160,7 +1168,7 @@ static int vmdk_parse_extents(const char *desc, Block= DriverState *bs, 0, 0, 0, 0, 0, &extent, errp); if (ret < 0) { bdrv_unref_child(bs, extent_file); - return ret; + goto out; } extent->flat_start_offset =3D flat_offset << 9; } else if (!strcmp(type, "SPARSE") || !strcmp(type, "VMFSSPARSE"))= { @@ -1175,24 +1183,27 @@ static int vmdk_parse_extents(const char *desc, Blo= ckDriverState *bs, g_free(buf); if (ret) { bdrv_unref_child(bs, extent_file); - return ret; + goto out; } extent =3D &s->extents[s->num_extents - 1]; } else if (!strcmp(type, "SESPARSE")) { ret =3D vmdk_open_se_sparse(bs, extent_file, bs->open_flags, e= rrp); if (ret) { bdrv_unref_child(bs, extent_file); - return ret; + goto out; } extent =3D &s->extents[s->num_extents - 1]; } else { error_setg(errp, "Unsupported extent type '%s'", type); bdrv_unref_child(bs, extent_file); - return -ENOTSUP; + ret =3D -ENOTSUP; + goto out; } extent->type =3D g_strdup(type); } - return 0; + + ret =3D 0; + goto out; =20 invalid: np =3D next_line(p); @@ -1201,7 +1212,11 @@ invalid: np--; } error_setg(errp, "Invalid extent line: %.*s", (int)(np - p), p); - return -EINVAL; + ret =3D -EINVAL; + +out: + g_free(desc_file_dir); + return ret; } =20 static int vmdk_open_desc_file(BlockDriverState *bs, int flags, char *buf, @@ -1228,8 +1243,7 @@ static int vmdk_open_desc_file(BlockDriverState *bs, = int flags, char *buf, } s->create_type =3D g_strdup(ct); s->desc_offset =3D 0; - ret =3D vmdk_parse_extents(buf, bs, bs->file->bs->exact_filename, opti= ons, - errp); + ret =3D vmdk_parse_extents(buf, bs, options, errp); exit: return ret; } diff --git a/tests/qemu-iotests/059 b/tests/qemu-iotests/059 index 279aee6815..fbed5f9483 100755 --- a/tests/qemu-iotests/059 +++ b/tests/qemu-iotests/059 @@ -114,9 +114,12 @@ $QEMU_IMG convert -f qcow2 -O vmdk -o subformat=3Dstre= amOptimized "$TEST_IMG.qcow2 =20 echo echo "=3D=3D=3D Testing monolithicFlat with internally generated JSON file= name =3D=3D=3D" +# Should work, because bdrv_dirname() works fine with blkdebug IMGOPTS=3D"subformat=3DmonolithicFlat" _make_test_img 64M -$QEMU_IO -c "open -o driver=3D$IMGFMT,file.driver=3Dblkdebug,file.image.fi= lename=3D$TEST_IMG,file.inject-error.0.event=3Dread_aio" 2>&1 \ - | _filter_testdir | _filter_imgfmt +$QEMU_IO -c "open -o driver=3D$IMGFMT,file.driver=3Dblkdebug,file.image.fi= lename=3D$TEST_IMG,file.inject-error.0.event=3Dread_aio" \ + -c info \ + 2>&1 \ + | _filter_testdir | _filter_imgfmt | _filter_img_info _cleanup_test_img =20 echo diff --git a/tests/qemu-iotests/059.out b/tests/qemu-iotests/059.out index b2e718d29f..a51b571d27 100644 --- a/tests/qemu-iotests/059.out +++ b/tests/qemu-iotests/059.out @@ -2050,7 +2050,9 @@ wrote 512/512 bytes at offset 10240 =20 =3D=3D=3D Testing monolithicFlat with internally generated JSON file name = =3D=3D=3D Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 -qemu-io: can't open: Cannot use relative extent paths with VMDK descriptor= file 'json:{"image": {"driver": "file", "filename": "TEST_DIR/t.IMGFMT"}, = "driver": "blkdebug", "inject-error.0.event": "read_aio"}' +format name: IMGFMT +cluster size: 0 bytes +vm state offset: 0 bytes =20 =3D=3D=3D Testing version 3 =3D=3D=3D image: TEST_DIR/iotest-version3.IMGFMT --=20 2.21.0 From nobody Mon May 5 17:12:59 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1566931098; cv=none; d=zoho.com; s=zohoarc; b=cEwXvllYWRRW3yPplTT5aEBli8Qk1xdx7PkNpt2uC6U9sdfQCg3Nvbrm2w3y8GZHl1/bsTUwmiyNk7ToaZyk0/pQW7h9ZIM60xjCIF1/BthCAqyG4Epkks+Wmalcbz8vi1XP0VIjtOMmPIdm83budSKnWv/e94Voq8wBneSbmRg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566931098; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=2/XHBqED5+70oYgVvnYJkcnJazZTRKIwWiBgoLRzi8c=; b=h/kxLsVV4xoyFJPQeb2gHVbwUciwM4Pj8RNBsELQnlC9QDxOzNASX8XvkkM6u2R9Xw+C0XhrR65KcMCiMLAkjBmBBm+6ik5Tsd9tRfGmyWxpsGtN1ujnrZs1wky9m/88wPNVGxWVeEMRwOg4EvrtWKEXOYMgHXVaqwE8ZihDoOg= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from=<mreitz@redhat.com> (p=none dis=none) header.from=<mreitz@redhat.com> Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 15669310981652.9943136043677896; Tue, 27 Aug 2019 11:38:18 -0700 (PDT) Received: from localhost ([::1]:55670 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+importer=patchew.org@nongnu.org>) id 1i2gM9-0005mn-KI for importer@patchew.org; Tue, 27 Aug 2019 14:38:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53324) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <mreitz@redhat.com>) id 1i2g81-0002sd-SX for qemu-devel@nongnu.org; Tue, 27 Aug 2019 14:23:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <mreitz@redhat.com>) id 1i2g80-0005TI-Hf for qemu-devel@nongnu.org; Tue, 27 Aug 2019 14:23:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51692) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <mreitz@redhat.com>) id 1i2g7x-0005QF-F2; Tue, 27 Aug 2019 14:23:33 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C17B1C049E36; Tue, 27 Aug 2019 18:23:32 +0000 (UTC) Received: from localhost (unknown [10.40.205.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 59EA3608C1; Tue, 27 Aug 2019 18:23:32 +0000 (UTC) From: Max Reitz <mreitz@redhat.com> To: qemu-block@nongnu.org Date: Tue, 27 Aug 2019 20:23:05 +0200 Message-Id: <20190827182313.25983-8-mreitz@redhat.com> In-Reply-To: <20190827182313.25983-1-mreitz@redhat.com> References: <20190827182313.25983-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 27 Aug 2019 18:23:32 +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/15] iotests: Keep testing broken relative extent paths X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://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>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com> Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+importer=patchew.org@nongnu.org> Content-Type: text/plain; charset="utf-8" We had a test for a case where relative extent paths did not work, but unfortunately we just fixed the underlying problem, so it works now. This patch adds a new test case that still fails. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 20190815153638.4600-4-mreitz@redhat.com Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com> --- tests/qemu-iotests/059 | 27 +++++++++++++++++++++++++++ tests/qemu-iotests/059.out | 4 ++++ 2 files changed, 31 insertions(+) diff --git a/tests/qemu-iotests/059 b/tests/qemu-iotests/059 index fbed5f9483..10bfbaecec 100755 --- a/tests/qemu-iotests/059 +++ b/tests/qemu-iotests/059 @@ -114,6 +114,8 @@ $QEMU_IMG convert -f qcow2 -O vmdk -o subformat=3Dstrea= mOptimized "$TEST_IMG.qcow2 =20 echo echo "=3D=3D=3D Testing monolithicFlat with internally generated JSON file= name =3D=3D=3D" + +echo '--- blkdebug ---' # Should work, because bdrv_dirname() works fine with blkdebug IMGOPTS=3D"subformat=3DmonolithicFlat" _make_test_img 64M $QEMU_IO -c "open -o driver=3D$IMGFMT,file.driver=3Dblkdebug,file.image.fi= lename=3D$TEST_IMG,file.inject-error.0.event=3Dread_aio" \ @@ -122,6 +124,31 @@ $QEMU_IO -c "open -o driver=3D$IMGFMT,file.driver=3Dbl= kdebug,file.image.filename=3D$TE | _filter_testdir | _filter_imgfmt | _filter_img_info _cleanup_test_img =20 +echo '--- quorum ---' +# Should not work, because bdrv_dirname() does not work with quorum +IMGOPTS=3D"subformat=3DmonolithicFlat" _make_test_img 64M +cp "$TEST_IMG" "$TEST_IMG.orig" + +filename=3D"json:{ + \"driver\": \"$IMGFMT\", + \"file\": { + \"driver\": \"quorum\", + \"children\": [ { + \"driver\": \"file\", + \"filename\": \"$TEST_IMG\" + }, { + \"driver\": \"file\", + \"filename\": \"$TEST_IMG.orig\" + } ], + \"vote-threshold\": 1 + } }" + +filename=3D$(echo "$filename" | tr '\n' ' ' | sed -e 's/\s\+/ /g') +$QEMU_IMG info "$filename" 2>&1 \ + | sed -e "s/'json:[^']*'/\$QUORUM_FILE/g" \ + | _filter_testdir | _filter_imgfmt | _filter_img_info + + echo echo "=3D=3D=3D Testing version 3 =3D=3D=3D" _use_sample_img iotest-version3.vmdk.bz2 diff --git a/tests/qemu-iotests/059.out b/tests/qemu-iotests/059.out index a51b571d27..39bf7e211d 100644 --- a/tests/qemu-iotests/059.out +++ b/tests/qemu-iotests/059.out @@ -2049,10 +2049,14 @@ wrote 512/512 bytes at offset 10240 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) =20 =3D=3D=3D Testing monolithicFlat with internally generated JSON file name = =3D=3D=3D +--- blkdebug --- Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 format name: IMGFMT cluster size: 0 bytes vm state offset: 0 bytes +--- quorum --- +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 +qemu-img: Could not open $QUORUM_FILE: Cannot use relative paths with VMDK= descriptor file $QUORUM_FILE: Cannot generate a base directory for quorum = nodes =20 =3D=3D=3D Testing version 3 =3D=3D=3D image: TEST_DIR/iotest-version3.IMGFMT --=20 2.21.0 From nobody Mon May 5 17:12:59 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1566931202; cv=none; d=zoho.com; s=zohoarc; b=SbA/JpWqgdNCU58EurXCPuEJa08QF93uOm303xEQjGEU0RZLODJmicjwBGBFj3r6Ljg6ek0Ha/h6RqnuOiTHOD0rbEO6vMTPQlvMX/tLBWbXyDFArnW7bf+xv83PGJdi5/l6AXhHQKemNmfsLx6RiE92FHuLex3/QlWJG/Ze/QA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566931202; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=uZirHL6LbB9QNwz67/rCGJaTlgQdCC6vAYHYcE3Tsvk=; b=gQuTg0psGFEmkf1jVegssnLJ+AFXN0abHW+IrDMcjMuKDw4opQGbpnb4otRK+xh87np959/l4u2O+OwG78BohcfcfurXOi40j4eT2o0ifsbAKujuByYuhASuBY/C+mETt6jdkqOw5Qtstr1LIJ5EZDzsh5PpxSoG0hY32FlZgq8= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from=<mreitz@redhat.com> (p=none dis=none) header.from=<mreitz@redhat.com> Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1566931202315317.5912467849853; Tue, 27 Aug 2019 11:40:02 -0700 (PDT) Received: from localhost ([::1]:55708 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+importer=patchew.org@nongnu.org>) id 1i2gNr-00085k-3F for importer@patchew.org; Tue, 27 Aug 2019 14:39:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53355) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <mreitz@redhat.com>) id 1i2g83-0002vY-Qz for qemu-devel@nongnu.org; Tue, 27 Aug 2019 14:23:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <mreitz@redhat.com>) id 1i2g82-0005Ue-HK for qemu-devel@nongnu.org; Tue, 27 Aug 2019 14:23:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:18221) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <mreitz@redhat.com>) id 1i2g7z-0005SO-PI; Tue, 27 Aug 2019 14:23:35 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1CDE78980EA; Tue, 27 Aug 2019 18:23:35 +0000 (UTC) Received: from localhost (unknown [10.40.205.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AA7F5196AE; Tue, 27 Aug 2019 18:23:34 +0000 (UTC) From: Max Reitz <mreitz@redhat.com> To: qemu-block@nongnu.org Date: Tue, 27 Aug 2019 20:23:06 +0200 Message-Id: <20190827182313.25983-9-mreitz@redhat.com> In-Reply-To: <20190827182313.25983-1-mreitz@redhat.com> References: <20190827182313.25983-1-mreitz@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.6.2 (mx1.redhat.com [10.5.110.67]); Tue, 27 Aug 2019 18:23:35 +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 08/15] vmdk: Reject invalid compressed writes X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://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>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com> Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+importer=patchew.org@nongnu.org> Content-Type: text/plain; charset="utf-8" Compressed writes generally have to write full clusters, not just in theory but also in practice when it comes to vmdk's streamOptimized subformat. It currently is just silently broken for writes with non-zero in-cluster offsets: $ qemu-img create -f vmdk -o subformat=3DstreamOptimized foo.vmdk 1M $ qemu-io -c 'write 4k 4k' -c 'read 4k 4k' foo.vmdk wrote 4096/4096 bytes at offset 4096 4 KiB, 1 ops; 00.01 sec (443.724 KiB/sec and 110.9309 ops/sec) read failed: Invalid argument (The technical reason is that vmdk_write_extent() just writes the incomplete compressed data actually to offset 4k. When reading the data, vmdk_read_extent() looks at offset 0 and finds the compressed data size to be 0, because that is what it reads from there. This yields an error.) For incomplete writes with zero in-cluster offsets, the error path when reading the rest of the cluster is a bit different, but the result is the same: $ qemu-img create -f vmdk -o subformat=3DstreamOptimized foo.vmdk 1M $ qemu-io -c 'write 0k 4k' -c 'read 4k 4k' foo.vmdk wrote 4096/4096 bytes at offset 0 4 KiB, 1 ops; 00.01 sec (362.641 KiB/sec and 90.6603 ops/sec) read failed: Invalid argument (Here, vmdk_read_extent() finds the data and then sees that the uncompressed data is short.) It is better to reject invalid writes than to make the user believe they might have succeeded and then fail when trying to read it back. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 20190815153638.4600-5-mreitz@redhat.com Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com> --- block/vmdk.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/block/vmdk.c b/block/vmdk.c index a7f82e665e..fed3b50c8a 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -1734,6 +1734,16 @@ static int vmdk_write_extent(VmdkExtent *extent, int= 64_t cluster_offset, if (extent->compressed) { void *compressed_data; =20 + /* Only whole clusters */ + if (offset_in_cluster || + n_bytes > (extent->cluster_sectors * SECTOR_SIZE) || + (n_bytes < (extent->cluster_sectors * SECTOR_SIZE) && + offset + n_bytes !=3D extent->end_sector * SECTOR_SIZE)) + { + ret =3D -EINVAL; + goto out; + } + if (!extent->has_marker) { ret =3D -EINVAL; goto out; --=20 2.21.0 From nobody Mon May 5 17:12:59 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1566930657; cv=none; d=zoho.com; s=zohoarc; b=DVB70gkJNwQlX80HfoJUxI25thKHczes3AJldUxpUI98VBCDi3SQnPJhVtlDNpxRmqHQH25s63Xxdf6VuhNK7YNiSpRaNLi6mdqk7o11Qp+N5ROIO3cGz/MDFnJkBtYjLNPPGyCSsa4ohl3mqV7vTvu5A/63iEZaf6lldNDEzvw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566930657; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=xrlrTY3kMrsONWgMu3DH5Q1kJjChLDADnpmRmsvHIk4=; b=icvxaRvVAbW0ikdaH5zh7YXgzSrrg/HG+SBtym6gosf+AAs64XVazVjedzh6TDzFvFVuGtPtJc4DzhztixAHfY9sXbzZABA27O5vWnNvaU1vxEl9Cqf9bffgqsH9JZgYI2dZED8qOF6jLBIZo7tPZKXx5c/OzTNSty7GPe5Q1rM= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from=<mreitz@redhat.com> (p=none dis=none) header.from=<mreitz@redhat.com> Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1566930657818449.4539580682746; Tue, 27 Aug 2019 11:30:57 -0700 (PDT) Received: from localhost ([::1]:55482 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+importer=patchew.org@nongnu.org>) id 1i2gF6-0000Gp-Gw for importer@patchew.org; Tue, 27 Aug 2019 14:30:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53421) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <mreitz@redhat.com>) id 1i2g88-00032O-E4 for qemu-devel@nongnu.org; Tue, 27 Aug 2019 14:23:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <mreitz@redhat.com>) id 1i2g86-0005YJ-El for qemu-devel@nongnu.org; Tue, 27 Aug 2019 14:23:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50610) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <mreitz@redhat.com>) id 1i2g82-0005UI-Aa; Tue, 27 Aug 2019 14:23:38 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9F7C9315C007; Tue, 27 Aug 2019 18:23:37 +0000 (UTC) Received: from localhost (unknown [10.40.205.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 03EA51001B07; Tue, 27 Aug 2019 18:23:36 +0000 (UTC) From: Max Reitz <mreitz@redhat.com> To: qemu-block@nongnu.org Date: Tue, 27 Aug 2019 20:23:07 +0200 Message-Id: <20190827182313.25983-10-mreitz@redhat.com> In-Reply-To: <20190827182313.25983-1-mreitz@redhat.com> References: <20190827182313.25983-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Tue, 27 Aug 2019 18:23:37 +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 09/15] iotests: Disable broken streamOptimized tests X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://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>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com> Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+importer=patchew.org@nongnu.org> Content-Type: text/plain; charset="utf-8" streamOptimized does not support writes that do not span exactly one cluster. Furthermore, it cannot rewrite already allocated clusters. As such, many iotests do not work with it. Disable them. Signed-off-by: Max Reitz <mreitz@redhat.com> Message-id: 20190815153638.4600-6-mreitz@redhat.com Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com> --- tests/qemu-iotests/002 | 1 + tests/qemu-iotests/003 | 1 + tests/qemu-iotests/005 | 3 ++- tests/qemu-iotests/009 | 1 + tests/qemu-iotests/010 | 1 + tests/qemu-iotests/011 | 1 + tests/qemu-iotests/017 | 3 ++- tests/qemu-iotests/018 | 3 ++- tests/qemu-iotests/019 | 3 ++- tests/qemu-iotests/020 | 3 ++- tests/qemu-iotests/027 | 1 + tests/qemu-iotests/032 | 1 + tests/qemu-iotests/033 | 1 + tests/qemu-iotests/034 | 3 ++- tests/qemu-iotests/037 | 3 ++- tests/qemu-iotests/063 | 3 ++- tests/qemu-iotests/072 | 1 + tests/qemu-iotests/105 | 3 ++- tests/qemu-iotests/197 | 1 + tests/qemu-iotests/215 | 1 + tests/qemu-iotests/251 | 1 + 21 files changed, 30 insertions(+), 9 deletions(-) diff --git a/tests/qemu-iotests/002 b/tests/qemu-iotests/002 index fd413bce48..1a0d411df5 100755 --- a/tests/qemu-iotests/002 +++ b/tests/qemu-iotests/002 @@ -38,6 +38,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 =20 _supported_fmt generic _supported_proto generic +_unsupported_imgopts "subformat=3DstreamOptimized" =20 =20 size=3D128M diff --git a/tests/qemu-iotests/003 b/tests/qemu-iotests/003 index ccd3a39dfb..33eeade0de 100755 --- a/tests/qemu-iotests/003 +++ b/tests/qemu-iotests/003 @@ -38,6 +38,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 =20 _supported_fmt generic _supported_proto generic +_unsupported_imgopts "subformat=3DstreamOptimized" =20 size=3D128M offset=3D67M diff --git a/tests/qemu-iotests/005 b/tests/qemu-iotests/005 index 9c7681c19b..58442762fe 100755 --- a/tests/qemu-iotests/005 +++ b/tests/qemu-iotests/005 @@ -43,7 +43,8 @@ _supported_fmt generic _supported_proto generic _supported_os Linux _unsupported_imgopts "subformat=3DtwoGbMaxExtentFlat" \ - "subformat=3DtwoGbMaxExtentSparse" + "subformat=3DtwoGbMaxExtentSparse" \ + "subformat=3DstreamOptimized" =20 # vpc is limited to 127GB, so we can't test it here if [ "$IMGFMT" =3D "vpc" ]; then diff --git a/tests/qemu-iotests/009 b/tests/qemu-iotests/009 index 51b200db1d..4dc7d210f9 100755 --- a/tests/qemu-iotests/009 +++ b/tests/qemu-iotests/009 @@ -38,6 +38,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 =20 _supported_fmt generic _supported_proto generic +_unsupported_imgopts "subformat=3DstreamOptimized" =20 =20 size=3D6G diff --git a/tests/qemu-iotests/010 b/tests/qemu-iotests/010 index 48c533f632..df809b3088 100755 --- a/tests/qemu-iotests/010 +++ b/tests/qemu-iotests/010 @@ -38,6 +38,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 =20 _supported_fmt generic _supported_proto generic +_unsupported_imgopts "subformat=3DstreamOptimized" =20 =20 size=3D6G diff --git a/tests/qemu-iotests/011 b/tests/qemu-iotests/011 index 56f704b5b9..57b99ae4a9 100755 --- a/tests/qemu-iotests/011 +++ b/tests/qemu-iotests/011 @@ -38,6 +38,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 =20 _supported_fmt generic _supported_proto generic +_unsupported_imgopts "subformat=3DstreamOptimized" =20 =20 size=3D6G diff --git a/tests/qemu-iotests/017 b/tests/qemu-iotests/017 index 79875de454..0a4b854e65 100755 --- a/tests/qemu-iotests/017 +++ b/tests/qemu-iotests/017 @@ -41,7 +41,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow qcow2 vmdk qed _supported_proto generic _unsupported_proto vxhs -_unsupported_imgopts "subformat=3DmonolithicFlat" "subformat=3DtwoGbMaxExt= entFlat" +_unsupported_imgopts "subformat=3DmonolithicFlat" "subformat=3DtwoGbMaxExt= entFlat" \ + "subformat=3DstreamOptimized" =20 TEST_OFFSETS=3D"0 4294967296" =20 diff --git a/tests/qemu-iotests/018 b/tests/qemu-iotests/018 index 78169838ba..c69ce09209 100755 --- a/tests/qemu-iotests/018 +++ b/tests/qemu-iotests/018 @@ -41,7 +41,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow qcow2 vmdk qed _supported_proto file _supported_os Linux -_unsupported_imgopts "subformat=3DmonolithicFlat" "subformat=3DtwoGbMaxExt= entFlat" +_unsupported_imgopts "subformat=3DmonolithicFlat" "subformat=3DtwoGbMaxExt= entFlat" \ + "streamOptimized" =20 TEST_OFFSETS=3D"0 4294967296" =20 diff --git a/tests/qemu-iotests/019 b/tests/qemu-iotests/019 index a56dd30bed..b4f5234609 100755 --- a/tests/qemu-iotests/019 +++ b/tests/qemu-iotests/019 @@ -47,7 +47,8 @@ _supported_proto file _supported_os Linux _unsupported_imgopts "subformat=3DmonolithicFlat" \ "subformat=3DtwoGbMaxExtentFlat" \ - "subformat=3DtwoGbMaxExtentSparse" + "subformat=3DtwoGbMaxExtentSparse" \ + "subformat=3DstreamOptimized" =20 TEST_OFFSETS=3D"0 4294967296" CLUSTER_SIZE=3D65536 diff --git a/tests/qemu-iotests/020 b/tests/qemu-iotests/020 index 6b0ebb37d2..f41b92f35f 100755 --- a/tests/qemu-iotests/020 +++ b/tests/qemu-iotests/020 @@ -44,7 +44,8 @@ _supported_fmt qcow qcow2 vmdk qed _supported_proto file _unsupported_imgopts "subformat=3DmonolithicFlat" \ "subformat=3DtwoGbMaxExtentFlat" \ - "subformat=3DtwoGbMaxExtentSparse" + "subformat=3DtwoGbMaxExtentSparse" \ + "subformat=3DstreamOptimized" =20 TEST_OFFSETS=3D"0 4294967296" =20 diff --git a/tests/qemu-iotests/027 b/tests/qemu-iotests/027 index 4cb638022a..494be0921f 100755 --- a/tests/qemu-iotests/027 +++ b/tests/qemu-iotests/027 @@ -38,6 +38,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 =20 _supported_fmt vmdk qcow qcow2 qed _supported_proto generic +_unsupported_imgopts "subformat=3DstreamOptimized" =20 =20 size=3D128M diff --git a/tests/qemu-iotests/032 b/tests/qemu-iotests/032 index 988a8c5d8f..8337a4d825 100755 --- a/tests/qemu-iotests/032 +++ b/tests/qemu-iotests/032 @@ -42,6 +42,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 # This works for any image format (though unlikely to segfault for raw) _supported_fmt generic _supported_proto generic +_unsupported_imgopts "subformat=3DstreamOptimized" =20 echo echo =3D=3D=3D Prepare image =3D=3D=3D diff --git a/tests/qemu-iotests/033 b/tests/qemu-iotests/033 index 362a48c0a0..8b40991d55 100755 --- a/tests/qemu-iotests/033 +++ b/tests/qemu-iotests/033 @@ -38,6 +38,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 =20 _supported_fmt generic _supported_proto generic +_unsupported_imgopts "subformat=3DstreamOptimized" =20 =20 size=3D128M diff --git a/tests/qemu-iotests/034 b/tests/qemu-iotests/034 index 324bed28c6..da4cea1571 100755 --- a/tests/qemu-iotests/034 +++ b/tests/qemu-iotests/034 @@ -41,7 +41,8 @@ _supported_proto file _supported_os Linux _unsupported_imgopts "subformat=3DmonolithicFlat" \ "subformat=3DtwoGbMaxExtentFlat" \ - "subformat=3DtwoGbMaxExtentSparse" + "subformat=3DtwoGbMaxExtentSparse" \ + "subformat=3DstreamOptimized" =20 CLUSTER_SIZE=3D4k size=3D128M diff --git a/tests/qemu-iotests/037 b/tests/qemu-iotests/037 index 4946b9be92..e6517acbd4 100755 --- a/tests/qemu-iotests/037 +++ b/tests/qemu-iotests/037 @@ -40,7 +40,8 @@ _supported_fmt qcow qcow2 vmdk qed _supported_proto file _unsupported_imgopts "subformat=3DmonolithicFlat" \ "subformat=3DtwoGbMaxExtentFlat" \ - "subformat=3DtwoGbMaxExtentSparse" + "subformat=3DtwoGbMaxExtentSparse" \ + "subformat=3DstreamOptimized" =20 CLUSTER_SIZE=3D4k size=3D128M diff --git a/tests/qemu-iotests/063 b/tests/qemu-iotests/063 index fe4892e467..7cf0427af4 100755 --- a/tests/qemu-iotests/063 +++ b/tests/qemu-iotests/063 @@ -43,7 +43,8 @@ _supported_fmt qcow qcow2 vmdk qed raw _supported_proto file _unsupported_imgopts "subformat=3DmonolithicFlat" \ "subformat=3DtwoGbMaxExtentFlat" \ - "subformat=3DtwoGbMaxExtentSparse" + "subformat=3DtwoGbMaxExtentSparse" \ + "subformat=3DstreamOptimized" =20 _make_test_img 4M =20 diff --git a/tests/qemu-iotests/072 b/tests/qemu-iotests/072 index 661b36da2d..f0b73e7e65 100755 --- a/tests/qemu-iotests/072 +++ b/tests/qemu-iotests/072 @@ -38,6 +38,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 =20 _supported_fmt vpc vmdk vhdx vdi qed qcow2 qcow _supported_proto file +_unsupported_imgopts "subformat=3DstreamOptimized" =20 IMG_SIZE=3D64M =20 diff --git a/tests/qemu-iotests/105 b/tests/qemu-iotests/105 index 3346e8cb25..4d55a2d3ef 100755 --- a/tests/qemu-iotests/105 +++ b/tests/qemu-iotests/105 @@ -39,7 +39,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 vmdk vhdx qed _supported_proto generic _unsupported_imgopts "subformat=3DtwoGbMaxExtentFlat" \ - "subformat=3DtwoGbMaxExtentSparse" + "subformat=3DtwoGbMaxExtentSparse" \ + "subformat=3DstreamOptimized" =20 echo echo "creating large image" diff --git a/tests/qemu-iotests/197 b/tests/qemu-iotests/197 index 383d7d7f61..1d4f6786db 100755 --- a/tests/qemu-iotests/197 +++ b/tests/qemu-iotests/197 @@ -53,6 +53,7 @@ _supported_fmt generic _supported_proto generic # LUKS support may be possible, but it complicates things. _unsupported_fmt luks +_unsupported_imgopts "subformat=3DstreamOptimized" =20 echo echo '=3D=3D=3D Copy-on-read =3D=3D=3D' diff --git a/tests/qemu-iotests/215 b/tests/qemu-iotests/215 index 958c14f5a0..2eb377d682 100755 --- a/tests/qemu-iotests/215 +++ b/tests/qemu-iotests/215 @@ -50,6 +50,7 @@ _supported_fmt generic _supported_proto generic # LUKS support may be possible, but it complicates things. _unsupported_fmt luks +_unsupported_imgopts "subformat=3DstreamOptimized" =20 echo echo '=3D=3D=3D Copy-on-read =3D=3D=3D' diff --git a/tests/qemu-iotests/251 b/tests/qemu-iotests/251 index 13f85de9cd..7918ba3559 100755 --- a/tests/qemu-iotests/251 +++ b/tests/qemu-iotests/251 @@ -40,6 +40,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt generic _supported_proto file _supported_os Linux +_unsupported_imgopts "subformat=3DstreamOptimized" =20 if [ "$IMGOPTSSYNTAX" =3D "true" ]; then # We use json:{} filenames here, so we cannot work with additional opt= ions. --=20 2.21.0 From nobody Mon May 5 17:12:59 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1566931318; cv=none; d=zoho.com; s=zohoarc; b=JcI47XyQtUdw3YZ412ypqMdMsP0cYpT8S76bKV7CInZFzj2IIugBwWs7NnMOpZPKGnBAkTg77Bk7Zi+A95BlZoONgsRiCzmuIKrG+z3jxqZiv+p6Rw4yC+u0GfQO1V38j+cqG5udCULRq59zEuLVElMp70b6uW4qjsgIc3gaYLc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566931318; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=JtBsi6cJCuVXnx9/E6rP0yO6b+cdSrYy6hpPsndgQ8o=; b=hSJX4BcZrXKdhIrxCRg5M987ZZpSv+yJ20pwzP8V2+eAY9WsHUwngU89Q6Z7/7v8++2Vry+3iDX4CLTyqS9FrqQDV13HcD9WSjtbJj8dgWYEmF7fEk0yJFFk75ZOfF69wIioL/mIF4Jf0hPRucVJ4Fw/qRa+ptdtEtnvXYxSp6E= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from=<mreitz@redhat.com> (p=none dis=none) header.from=<mreitz@redhat.com> Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1566931318720153.79567923455033; Tue, 27 Aug 2019 11:41:58 -0700 (PDT) Received: from localhost ([::1]:55750 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+importer=patchew.org@nongnu.org>) id 1i2gPl-0002Kd-DD for importer@patchew.org; Tue, 27 Aug 2019 14:41:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53413) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <mreitz@redhat.com>) id 1i2g87-00031f-Tu for qemu-devel@nongnu.org; Tue, 27 Aug 2019 14:23:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <mreitz@redhat.com>) id 1i2g86-0005Yj-Rl for qemu-devel@nongnu.org; Tue, 27 Aug 2019 14:23:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50974) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <mreitz@redhat.com>) id 1i2g84-0005Vs-KW; Tue, 27 Aug 2019 14:23:40 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ECD153D95A; Tue, 27 Aug 2019 18:23:39 +0000 (UTC) Received: from localhost (unknown [10.40.205.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8563E600D1; Tue, 27 Aug 2019 18:23:39 +0000 (UTC) From: Max Reitz <mreitz@redhat.com> To: qemu-block@nongnu.org Date: Tue, 27 Aug 2019 20:23:08 +0200 Message-Id: <20190827182313.25983-11-mreitz@redhat.com> In-Reply-To: <20190827182313.25983-1-mreitz@redhat.com> References: <20190827182313.25983-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 27 Aug 2019 18:23:40 +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 10/15] iotests: Disable 110 for vmdk.twoGbMaxExtentSparse X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://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>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com> Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+importer=patchew.org@nongnu.org> Content-Type: text/plain; charset="utf-8" The error message for the test case where we have a quorum node for which no directory name can be generated is different: For twoGbMaxExtentSparse, it complains that it cannot open the extent file. For other (sub)formats, it just notes that it cannot determine the backing file path. Both are fine, but just disable twoGbMaxExtentSparse for simplicity's sake. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 20190815153638.4600-7-mreitz@redhat.com Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com> --- tests/qemu-iotests/110 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/qemu-iotests/110 b/tests/qemu-iotests/110 index 2cdc7c8a72..2ef516baf1 100755 --- a/tests/qemu-iotests/110 +++ b/tests/qemu-iotests/110 @@ -40,7 +40,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 # Any format supporting backing files _supported_fmt qed qcow qcow2 vmdk _supported_proto file -_unsupported_imgopts "subformat=3DmonolithicFlat" "subformat=3DtwoGbMaxExt= entFlat" +_unsupported_imgopts "subformat=3DmonolithicFlat" "subformat=3DtwoGbMaxExt= entFlat" \ + "subformat=3DtwoGbMaxExtentSparse" =20 TEST_IMG_REL=3D$(basename "$TEST_IMG") =20 --=20 2.21.0 From nobody Mon May 5 17:12:59 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1566930961; cv=none; d=zoho.com; s=zohoarc; b=l0gu8Gj5zfKvVnXle1rpesUdLLaQsjCNPul1918GwnnQnFoZ33Z0aBen5kXac3uxMy75EFYmT/dyPtanbfs0EnyPmB23OVKhzuCUOf3mCBMq3oWHNSGxqHe4cOquV9gHIk/jhb2SDKQUNDwwX/9ZEjybk5saepccxrWVpuaW1i4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566930961; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=G0Hodh+BM1nu8+I6BKumYdvjTqx7DttbXr52ElcnZws=; b=Ln7tkemgwjytzRYVlrDq7RafeEf7SD8ANlz5wpGgI9yzY6dhpfrSIsZBUplKnhAEagCjnsXQdz5O6M7kVOEuMbF+FGBP8B+WT+LpUGExTzZwd2vE2iFvk2F42oFQ1uXQS1hv2IH/Ie1XmNtYDPuTbEuADdbZielcbdObXf9NCbo= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from=<mreitz@redhat.com> (p=none dis=none) header.from=<mreitz@redhat.com> Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 156693096131261.2288218194102; Tue, 27 Aug 2019 11:36:01 -0700 (PDT) Received: from localhost ([::1]:55620 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+importer=patchew.org@nongnu.org>) id 1i2gJz-0003zj-G7 for importer@patchew.org; Tue, 27 Aug 2019 14:35:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53491) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <mreitz@redhat.com>) id 1i2g8B-00036m-BK for qemu-devel@nongnu.org; Tue, 27 Aug 2019 14:23:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <mreitz@redhat.com>) id 1i2g8A-0005bt-8S for qemu-devel@nongnu.org; Tue, 27 Aug 2019 14:23:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55886) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <mreitz@redhat.com>) id 1i2g86-0005YE-TT; Tue, 27 Aug 2019 14:23:43 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4290418C426D; Tue, 27 Aug 2019 18:23:42 +0000 (UTC) Received: from localhost (unknown [10.40.205.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D170960A35; Tue, 27 Aug 2019 18:23:41 +0000 (UTC) From: Max Reitz <mreitz@redhat.com> To: qemu-block@nongnu.org Date: Tue, 27 Aug 2019 20:23:09 +0200 Message-Id: <20190827182313.25983-12-mreitz@redhat.com> In-Reply-To: <20190827182313.25983-1-mreitz@redhat.com> References: <20190827182313.25983-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.62]); Tue, 27 Aug 2019 18:23:42 +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 11/15] iotests: Disable 126 for flat vmdk subformats X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://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>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com> Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+importer=patchew.org@nongnu.org> Content-Type: text/plain; charset="utf-8" iotest 126 requires backing file support, which flat vmdks cannot offer. Skip this test for such subformats. Signed-off-by: Max Reitz <mreitz@redhat.com> Message-id: 20190815153638.4600-8-mreitz@redhat.com Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com> --- tests/qemu-iotests/126 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/qemu-iotests/126 b/tests/qemu-iotests/126 index 9b0dcf9255..b7fce1e59d 100755 --- a/tests/qemu-iotests/126 +++ b/tests/qemu-iotests/126 @@ -33,6 +33,8 @@ status=3D1 # failure is the default! =20 # Needs backing file support _supported_fmt qcow qcow2 qed vmdk +_unsupported_imgopts "subformat=3DmonolithicFlat" \ + "subformat=3DtwoGbMaxExtentFlat" # This is the default protocol (and we want to test the difference between # colons which separate a protocol prefix from the rest and colons which a= re # just part of the filename, so we cannot test protocols which require a p= refix) --=20 2.21.0 From nobody Mon May 5 17:12:59 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1566931189; cv=none; d=zoho.com; s=zohoarc; b=FOytVRjeV0OIbv8XHMjHwq0NqG5TBooW+GG+0mkrRmpM0EWAenZt2yCZ0PiVckh6GbJhQvh5SsBu8M+K4LCpyr7C8uZP0TunvaTcueoAJEWid1ugcuNENBHR69nQpCKqGEQYb8LtKDm8BBochlqykDWhjQ8rCsqhNhhr1/5BrB8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566931189; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=HJc36IeFnIA7nZI4XXlKvLunPimCQjwjT4BwQRoCXQs=; b=Z58ZIKDVKlhVvVey6xKBIAcKvRA9TudI0c0guIJyQR++CWeFbpWQgB4WNIzRa/2QcFv1Zalm6v/w8UC54e7kFWlF0Rs/eVL1Ns1pBO82o2AcAsIluNoRcP5ld83AECJcQYnfTPz8zcJp3V40KNWCffJYXRRWD7/6cu5IIhQ0JX4= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from=<mreitz@redhat.com> (p=none dis=none) header.from=<mreitz@redhat.com> Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1566931189391230.5038290305058; Tue, 27 Aug 2019 11:39:49 -0700 (PDT) Received: from localhost ([::1]:55692 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+importer=patchew.org@nongnu.org>) id 1i2gNb-0007hf-Ss for importer@patchew.org; Tue, 27 Aug 2019 14:39:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53517) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <mreitz@redhat.com>) id 1i2g8C-00038j-JF for qemu-devel@nongnu.org; Tue, 27 Aug 2019 14:23:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <mreitz@redhat.com>) id 1i2g8B-0005d2-Gh for qemu-devel@nongnu.org; Tue, 27 Aug 2019 14:23:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39302) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <mreitz@redhat.com>) id 1i2g89-0005aY-7N; Tue, 27 Aug 2019 14:23:45 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8F26D308212A; Tue, 27 Aug 2019 18:23:44 +0000 (UTC) Received: from localhost (unknown [10.40.205.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 27A40194B9; Tue, 27 Aug 2019 18:23:43 +0000 (UTC) From: Max Reitz <mreitz@redhat.com> To: qemu-block@nongnu.org Date: Tue, 27 Aug 2019 20:23:10 +0200 Message-Id: <20190827182313.25983-13-mreitz@redhat.com> In-Reply-To: <20190827182313.25983-1-mreitz@redhat.com> References: <20190827182313.25983-1-mreitz@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 (mx1.redhat.com [10.5.110.42]); Tue, 27 Aug 2019 18:23:44 +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 12/15] file-posix: fix request_alignment typo X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://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>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com> Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+importer=patchew.org@nongnu.org> Content-Type: text/plain; charset="utf-8" From: Stefan Hajnoczi <stefanha@redhat.com> Fixes: a6b257a08e3d72219f03e461a52152672fec0612 ("file-posix: Handle undetectable alignment") Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 20190827101328.4062-1-stefanha@redhat.com Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com> --- block/file-posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/file-posix.c b/block/file-posix.c index 447f937aa1..71f168ee2f 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -380,7 +380,7 @@ static void raw_probe_alignment(BlockDriverState *bs, i= nt fd, Error **errp) for (i =3D 0; i < ARRAY_SIZE(alignments); i++) { align =3D alignments[i]; if (raw_is_io_aligned(fd, buf + align, max_align)) { - /* Fallback to request_aligment. */ + /* Fallback to request_alignment. */ s->buf_align =3D (align !=3D 1) ? align : bs->bl.request_a= lignment; break; } --=20 2.21.0 From nobody Mon May 5 17:12:59 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1566931318; cv=none; d=zoho.com; s=zohoarc; b=l3Wh/vbRTyBolLGLcZ6cGq7Bqgx8brcBvjdBsT/Rs/4V3Z5VGGVfM7C7lSwI1W1wDzGJyAnyOjFB8bAHZEl6a8iG6vUmsXy16+a7hpekcYRFt6aJb1qayUUDJmJq7Nj8QCj+yzRGFG1nduLMoCFS8QRkjFlvxb6NaY3hWIxBWGs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566931318; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=3Ho3qq0CsRFs/mcTcUFhKX6GL14gEasZg1ipz7NUThY=; b=fhy1K1Sll2ctwtxbEr1AzJ3w9zVc9P5MpCSLVb3fKCVGlV6ytNfmtEpDPYp4RktKEZ3CbtxZXIGOSWR3/V8iQaEJzQ5mQxXIAvdJCO80ioaNRj4RjmCS/NUvyoi+IdARXvEvyb51u55/LZWD5Vg5zLCiNyeEf4UCY3DNtSJh8+U= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from=<mreitz@redhat.com> (p=none dis=none) header.from=<mreitz@redhat.com> Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1566931318887555.6211417680048; Tue, 27 Aug 2019 11:41:58 -0700 (PDT) Received: from localhost ([::1]:55752 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+importer=patchew.org@nongnu.org>) id 1i2gPl-0002Km-OG for importer@patchew.org; Tue, 27 Aug 2019 14:41:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53574) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <mreitz@redhat.com>) id 1i2g8G-0003E3-SS for qemu-devel@nongnu.org; Tue, 27 Aug 2019 14:23:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <mreitz@redhat.com>) id 1i2g8F-0005gy-4l for qemu-devel@nongnu.org; Tue, 27 Aug 2019 14:23:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55904) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <mreitz@redhat.com>) id 1i2g8B-0005cQ-LG; Tue, 27 Aug 2019 14:23:47 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DD92A18C4266; Tue, 27 Aug 2019 18:23:46 +0000 (UTC) Received: from localhost (unknown [10.40.205.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 762FA5D6B0; Tue, 27 Aug 2019 18:23:46 +0000 (UTC) From: Max Reitz <mreitz@redhat.com> To: qemu-block@nongnu.org Date: Tue, 27 Aug 2019 20:23:11 +0200 Message-Id: <20190827182313.25983-14-mreitz@redhat.com> In-Reply-To: <20190827182313.25983-1-mreitz@redhat.com> References: <20190827182313.25983-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.62]); Tue, 27 Aug 2019 18:23:46 +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 13/15] iotests: Check for enabled drivers before testing them X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://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>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com> Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+importer=patchew.org@nongnu.org> Content-Type: text/plain; charset="utf-8" From: Thomas Huth <thuth@redhat.com> It is possible to enable only a subset of the block drivers with the "--block-drv-rw-whitelist" option of the "configure" script. All other drivers are marked as unusable (or only included as read-only with the "--block-drv-ro-whitelist" option). If an iotest is now using such a disabled block driver, it is failing - which is bad, since at least the tests in the "auto" group should be able to deal with this situation. Thus let's introduce a "_require_drivers" function that can be used by the shell tests to check for the availability of certain drivers first, and marks the test as "not run" if one of the drivers is missing. This patch mainly targets the test in the "auto" group which should never fail in such a case, but also improves some of the other tests along the way. Note that we also assume that the "qcow2" and "file" drivers are always available - otherwise it does not make sense to run "make check-block" at all (which only tests with qcow2 by default). Signed-off-by: Thomas Huth <thuth@redhat.com> Message-id: 20190823133552.11680-1-thuth@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com> --- tests/qemu-iotests/071 | 1 + tests/qemu-iotests/081 | 4 +--- tests/qemu-iotests/099 | 1 + tests/qemu-iotests/120 | 1 + tests/qemu-iotests/162 | 4 +--- tests/qemu-iotests/184 | 1 + tests/qemu-iotests/186 | 1 + tests/qemu-iotests/common.rc | 14 ++++++++++++++ 8 files changed, 21 insertions(+), 6 deletions(-) diff --git a/tests/qemu-iotests/071 b/tests/qemu-iotests/071 index 1cca9233d0..fab526666b 100755 --- a/tests/qemu-iotests/071 +++ b/tests/qemu-iotests/071 @@ -38,6 +38,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 =20 _supported_fmt qcow2 _supported_proto file +_require_drivers blkdebug blkverify =20 do_run_qemu() { diff --git a/tests/qemu-iotests/081 b/tests/qemu-iotests/081 index c418bab093..85acdf76d4 100755 --- a/tests/qemu-iotests/081 +++ b/tests/qemu-iotests/081 @@ -41,6 +41,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt raw _supported_proto file _supported_os Linux +_require_drivers quorum =20 do_run_qemu() { @@ -55,9 +56,6 @@ run_qemu() | _filter_qemu_io | _filter_generated_node_ids } =20 -test_quorum=3D$($QEMU_IMG --help|grep quorum) -[ "$test_quorum" =3D "" ] && _supported_fmt quorum - quorum=3D"driver=3Draw,file.driver=3Dquorum,file.vote-threshold=3D2" quorum=3D"$quorum,file.children.0.file.filename=3D$TEST_DIR/1.raw" quorum=3D"$quorum,file.children.1.file.filename=3D$TEST_DIR/2.raw" diff --git a/tests/qemu-iotests/099 b/tests/qemu-iotests/099 index ae02f27afe..c3cf66798a 100755 --- a/tests/qemu-iotests/099 +++ b/tests/qemu-iotests/099 @@ -42,6 +42,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow qcow2 qed vdi vhdx vmdk vpc _supported_proto file _supported_os Linux +_require_drivers blkdebug blkverify _unsupported_imgopts "subformat=3DmonolithicFlat" "subformat=3DtwoGbMaxExt= entFlat" \ "subformat=3DtwoGbMaxExtentSparse" =20 diff --git a/tests/qemu-iotests/120 b/tests/qemu-iotests/120 index e9b4fbb009..2931a7550f 100755 --- a/tests/qemu-iotests/120 +++ b/tests/qemu-iotests/120 @@ -40,6 +40,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt generic _supported_proto file _unsupported_fmt luks +_require_drivers raw =20 _make_test_img 64M =20 diff --git a/tests/qemu-iotests/162 b/tests/qemu-iotests/162 index 4e5ed74fd5..2d719afbed 100755 --- a/tests/qemu-iotests/162 +++ b/tests/qemu-iotests/162 @@ -39,9 +39,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 . ./common.filter =20 _supported_fmt generic - -test_ssh=3D$($QEMU_IMG --help | grep '^Supported formats:.* ssh\( \|$\)') -[ "$test_ssh" =3D "" ] && _notrun "ssh support required" +_require_drivers ssh =20 echo echo '=3D=3D=3D NBD =3D=3D=3D' diff --git a/tests/qemu-iotests/184 b/tests/qemu-iotests/184 index cb0c181228..33dd8d2a4f 100755 --- a/tests/qemu-iotests/184 +++ b/tests/qemu-iotests/184 @@ -33,6 +33,7 @@ trap "exit \$status" 0 1 2 3 15 . ./common.filter =20 _supported_os Linux +_require_drivers throttle =20 do_run_qemu() { diff --git a/tests/qemu-iotests/186 b/tests/qemu-iotests/186 index 5f6b18c150..3ea0442d44 100755 --- a/tests/qemu-iotests/186 +++ b/tests/qemu-iotests/186 @@ -38,6 +38,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 =20 _supported_fmt qcow2 _supported_proto file +_require_drivers null-co =20 if [ "$QEMU_DEFAULT_MACHINE" !=3D "pc" ]; then _notrun "Requires a PC machine" diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc index 5502c3da2f..ee20be8920 100644 --- a/tests/qemu-iotests/common.rc +++ b/tests/qemu-iotests/common.rc @@ -520,5 +520,19 @@ _require_command() [ -x "$c" ] || _notrun "$1 utility required, skipped this test" } =20 +# Check that a set of drivers has been whitelisted in the QEMU binary +# +_require_drivers() +{ + available=3D$($QEMU -drive format=3Dhelp | \ + sed -e '/Supported formats:/!d' -e 's/Supported formats://= ') + for driver + do + if ! echo "$available" | grep -q " $driver\( \|$\)"; then + _notrun "$driver not available" + fi + done +} + # make sure this script returns success true --=20 2.21.0 From nobody Mon May 5 17:12:59 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1566931048; cv=none; d=zoho.com; s=zohoarc; b=NJGybmrt/OExFOoMx+wZI4Tn7LfakkY/l+J/mM9sOLqtHuMVQ1XxNkkCH34yvwKLWw6o/A/PhxfQLhv+D/Dgsfm3B+DzsCsSu4pWfSHX75vx/orEY9MBxgpEHvxX0Z9YkprAuGI3Ci9F7/TN04H6TkSXp5Q3zVrxbHdZuVQDozI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566931048; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=99c8o45vdt+7Tpyu49YFXl2mP0peN5s8XMfHQTZzxsE=; b=UfI1N57z4WM4ZRtkB3S0LGlS/buwNAN0gw/38Xxkon/t63kyXo2ufHg2tlwLz02UbE8d76WZrB0gFdKZWNuLclKyyytOfuz/66qSFOM1AmmvF+36BP7KulUMOp3MZvjcmautSn8Yvb8Gcy7xiOON9NSKzlrthPwexQKXA/+N/n4= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from=<mreitz@redhat.com> (p=none dis=none) header.from=<mreitz@redhat.com> Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1566931048069322.9967118973743; Tue, 27 Aug 2019 11:37:28 -0700 (PDT) Received: from localhost ([::1]:55646 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+importer=patchew.org@nongnu.org>) id 1i2gLO-0004vM-Fw for importer@patchew.org; Tue, 27 Aug 2019 14:37:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53583) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <mreitz@redhat.com>) id 1i2g8H-0003Es-H4 for qemu-devel@nongnu.org; Tue, 27 Aug 2019 14:23:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <mreitz@redhat.com>) id 1i2g8G-0005i5-7p for qemu-devel@nongnu.org; Tue, 27 Aug 2019 14:23:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40984) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <mreitz@redhat.com>) id 1i2g8D-0005f7-TP; Tue, 27 Aug 2019 14:23:50 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3816786663; Tue, 27 Aug 2019 18:23:49 +0000 (UTC) Received: from localhost (unknown [10.40.205.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C5A155D9CC; Tue, 27 Aug 2019 18:23:48 +0000 (UTC) From: Max Reitz <mreitz@redhat.com> To: qemu-block@nongnu.org Date: Tue, 27 Aug 2019 20:23:12 +0200 Message-Id: <20190827182313.25983-15-mreitz@redhat.com> In-Reply-To: <20190827182313.25983-1-mreitz@redhat.com> References: <20190827182313.25983-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 27 Aug 2019 18:23:49 +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 14/15] tests/check-block: Skip iotests when sanitizers are enabled X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://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>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com> Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+importer=patchew.org@nongnu.org> Content-Type: text/plain; charset="utf-8" From: Thomas Huth <thuth@redhat.com> The sanitizers (especially the address sanitizer from Clang) are sometimes printing out warnings or false positives - this spoils the output of the iotests, causing some of the tests to fail. Thus let's skip the automatic iotests during "make check" when the user configured QEMU with --enable-sanitizers. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-id: 20190823084203.29734-1-thuth@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com> --- tests/check-block.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/check-block.sh b/tests/check-block.sh index c8b6cec3f6..679aedec50 100755 --- a/tests/check-block.sh +++ b/tests/check-block.sh @@ -21,6 +21,11 @@ if grep -q "TARGET_GPROF=3Dy" *-softmmu/config-target.ma= k 2>/dev/null ; then exit 0 fi =20 +if grep -q "CFLAGS.*-fsanitize" config-host.mak 2>/dev/null ; then + echo "Sanitizers are enabled =3D=3D> Not running the qemu-iotests." + exit 0 +fi + if [ -z "$(find . -name 'qemu-system-*' -print)" ]; then echo "No qemu-system binary available =3D=3D> Not running the qemu-iot= ests." exit 0 --=20 2.21.0 From nobody Mon May 5 17:12:59 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1566931216; cv=none; d=zoho.com; s=zohoarc; b=XrS+ebACwJZxn2nDn2Ek4ogjfM0Gf3VHT1xUQGVgXf2/Q2dnDRqXpQaJ7u+de6YYP9nLt11PjcpFoGljtoy27jvP9iZsqBAgFwGkMO8sJzdapKtWdZW0LH+DWBlLB365rnEwQLobU8HQh39zZUb8dLwdY+DXjRTa+RfxeSEO2ps= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566931216; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=T/GakZTguro3BAUBWe0pzcnGJQUVyp5nFHp6hR9pICc=; b=H9Ro4PZm5oAD9B2Gjmaf5ztgttFzumi1QxvabWH3sccxJ7K53vVlTByF38z6nFTBXkKBPfr9JUy/TTJ/XSDlUZUalFs2IUBP1SqlemPMhxB5KosaB/vJo1rEykU1VYLxwADhXK05+57HCUlQ4+jLmJ+T7t9Ts8jB2dtK06bLg/E= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from=<mreitz@redhat.com> (p=none dis=none) header.from=<mreitz@redhat.com> Return-Path: <qemu-devel-bounces+importer=patchew.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1566931216371329.37196430555434; Tue, 27 Aug 2019 11:40:16 -0700 (PDT) Received: from localhost ([::1]:55719 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+importer=patchew.org@nongnu.org>) id 1i2gO7-0008Tp-9E for importer@patchew.org; Tue, 27 Aug 2019 14:40:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53617) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <mreitz@redhat.com>) id 1i2g8K-0003If-0o for qemu-devel@nongnu.org; Tue, 27 Aug 2019 14:23:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <mreitz@redhat.com>) id 1i2g8I-0005kf-Nq for qemu-devel@nongnu.org; Tue, 27 Aug 2019 14:23:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38902) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <mreitz@redhat.com>) id 1i2g8G-0005hS-5f; Tue, 27 Aug 2019 14:23:52 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 815D88AC6FF; Tue, 27 Aug 2019 18:23:51 +0000 (UTC) Received: from localhost (unknown [10.40.205.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1C0A95C1D6; Tue, 27 Aug 2019 18:23:50 +0000 (UTC) From: Max Reitz <mreitz@redhat.com> To: qemu-block@nongnu.org Date: Tue, 27 Aug 2019 20:23:13 +0200 Message-Id: <20190827182313.25983-16-mreitz@redhat.com> In-Reply-To: <20190827182313.25983-1-mreitz@redhat.com> References: <20190827182313.25983-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.69]); Tue, 27 Aug 2019 18:23:51 +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 15/15] iotests: Unify cache mode quoting X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://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>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org, Max Reitz <mreitz@redhat.com> Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+importer=patchew.org@nongnu.org> Content-Type: text/plain; charset="utf-8" From: Nir Soffer <nirsof@gmail.com> Quoting cache mode is not needed, and most tests use unquoted values. Unify all test to use the same style. Message-id: 20190827173432.7656-1-nsoffer@redhat.com Signed-off-by: Nir Soffer <nsoffer@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com> --- tests/qemu-iotests/026 | 4 ++-- tests/qemu-iotests/039 | 4 ++-- tests/qemu-iotests/052 | 2 +- tests/qemu-iotests/091 | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/qemu-iotests/026 b/tests/qemu-iotests/026 index e30243608b..ffb18ab6b5 100755 --- a/tests/qemu-iotests/026 +++ b/tests/qemu-iotests/026 @@ -41,8 +41,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 # Currently only qcow2 supports rebasing _supported_fmt qcow2 _supported_proto file -_default_cache_mode "writethrough" -_supported_cache_modes "writethrough" "none" +_default_cache_mode writethrough +_supported_cache_modes writethrough none # The refcount table tests expect a certain minimum width for refcount ent= ries # (so that the refcount table actually needs to grow); that minimum is 16 = bits, # being the default refcount entry width. diff --git a/tests/qemu-iotests/039 b/tests/qemu-iotests/039 index 0d4e963bd4..7c730d94a7 100755 --- a/tests/qemu-iotests/039 +++ b/tests/qemu-iotests/039 @@ -42,8 +42,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 _supported_proto file _supported_os Linux -_default_cache_mode "writethrough" -_supported_cache_modes "writethrough" +_default_cache_mode writethrough +_supported_cache_modes writethrough =20 size=3D128M =20 diff --git a/tests/qemu-iotests/052 b/tests/qemu-iotests/052 index 6e2ecbfe21..45a140910d 100755 --- a/tests/qemu-iotests/052 +++ b/tests/qemu-iotests/052 @@ -40,7 +40,7 @@ _supported_fmt generic _supported_proto file =20 # Don't do O_DIRECT on tmpfs -_supported_cache_modes "writeback" "writethrough" "unsafe" +_supported_cache_modes writeback writethrough unsafe =20 size=3D128M _make_test_img $size diff --git a/tests/qemu-iotests/091 b/tests/qemu-iotests/091 index d62ef18a02..f4b44659ae 100755 --- a/tests/qemu-iotests/091 +++ b/tests/qemu-iotests/091 @@ -46,8 +46,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 _supported_fmt qcow2 _supported_proto file _supported_os Linux -_default_cache_mode "none" -_supported_cache_modes "writethrough" "none" "writeback" +_default_cache_mode none +_supported_cache_modes writethrough none writeback =20 size=3D1G =20 --=20 2.21.0