From nobody Sun May 19 03:54:32 2024 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=1557241448; cv=none; d=zoho.com; s=zohoarc; b=Ku/i1rduj60EJkWN9blU+WFJyv6+13zn4Ej2lEX8JUTQ08kS99ipRveAs09pzs7XYYPnsawyk31bukwzNpqfTCQneJrNJbPvQv/Wq8HOQFDbKgkBlTyriRC4KdtWnSLcGcA9TkOhakcyEfeOd2aVS3jnYKY1rCXkdRKFCjZN4e4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557241448; 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=UjtgHh2wdKWQEfjR/zSJyXnmdw7/gVoBgvi5T6JCKmE=; b=c+7dx1pRAJ0A7lkHHFV7/AMAdgmpo98IvRqQ8lUhhAMzNlwf4EtcY2kzZ62QfCoHIOsF9tkgWFjWPEzOAgtRlMsNrty2wXy4XfNudmRfI4VwCbhaa+56psGKMcjXXlH11UEO99JQCMQiqZl8FZIcg3K+x6DZCGRT05cO8NJHRp8= 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= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557241448506583.6814469849752; Tue, 7 May 2019 08:04:08 -0700 (PDT) Received: from localhost ([127.0.0.1]:48211 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hO1dV-00068t-Cw for importer@patchew.org; Tue, 07 May 2019 11:04:05 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54084) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hO1bd-00053G-ED for qemu-devel@nongnu.org; Tue, 07 May 2019 11:02:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hO1bY-0002T6-DO for qemu-devel@nongnu.org; Tue, 07 May 2019 11:02:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50892) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hO1bR-0002PO-NM; Tue, 07 May 2019 11:01:57 -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 0A6C364464; Tue, 7 May 2019 15:01:57 +0000 (UTC) Received: from blue.redhat.com (ovpn-116-15.phx2.redhat.com [10.3.116.15]) by smtp.corp.redhat.com (Postfix) with ESMTP id 84FF05B0A5; Tue, 7 May 2019 15:01:56 +0000 (UTC) From: Eric Blake To: qemu-devel@nongnu.org Date: Tue, 7 May 2019 10:01:49 -0500 Message-Id: <20190507150153.26859-2-eblake@redhat.com> In-Reply-To: <20190507150153.26859-1-eblake@redhat.com> References: <20190507150153.26859-1-eblake@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.39]); Tue, 07 May 2019 15:01:57 +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 1/5] qemu-nbd: Look up flag names in array X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , "open list:Network Block Dev..." , Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Max Reitz The existing code to convert flag bits into strings looks a bit strange now, and if we ever add more flags, it will look even stranger. Prevent that from happening by making it look up the flag names in an array. Signed-off-by: Max Reitz Message-Id: <20190405191635.25740-1-mreitz@redhat.com> Signed-off-by: Eric Blake --- include/block/nbd.h | 38 +++++++++++++++++++++++++------------ qemu-nbd.c | 46 +++++++++++++++++---------------------------- 2 files changed, 43 insertions(+), 41 deletions(-) diff --git a/include/block/nbd.h b/include/block/nbd.h index 6d05983a55f..bb9f5bc0216 100644 --- a/include/block/nbd.h +++ b/include/block/nbd.h @@ -127,18 +127,32 @@ typedef struct NBDExtent { /* Transmission (export) flags: sent from server to client during handshak= e, but describe what will happen during transmission */ -#define NBD_FLAG_HAS_FLAGS (1 << 0) /* Flags are there */ -#define NBD_FLAG_READ_ONLY (1 << 1) /* Device is read-only */ -#define NBD_FLAG_SEND_FLUSH (1 << 2) /* Send FLUSH */ -#define NBD_FLAG_SEND_FUA (1 << 3) /* Send FUA (Force Unit Access= ) */ -#define NBD_FLAG_ROTATIONAL (1 << 4) /* Use elevator algorithm - - rotational media */ -#define NBD_FLAG_SEND_TRIM (1 << 5) /* Send TRIM (discard) */ -#define NBD_FLAG_SEND_WRITE_ZEROES (1 << 6) /* Send WRITE_ZEROES */ -#define NBD_FLAG_SEND_DF (1 << 7) /* Send DF (Do not Fragment) */ -#define NBD_FLAG_CAN_MULTI_CONN (1 << 8) /* Multi-client cache consiste= nt */ -#define NBD_FLAG_SEND_RESIZE (1 << 9) /* Send resize */ -#define NBD_FLAG_SEND_CACHE (1 << 10) /* Send CACHE (prefetch) */ +enum { + NBD_FLAG_HAS_FLAGS_BIT =3D 0, /* Flags are there */ + NBD_FLAG_READ_ONLY_BIT =3D 1, /* Device is read-only */ + NBD_FLAG_SEND_FLUSH_BIT =3D 2, /* Send FLUSH */ + NBD_FLAG_SEND_FUA_BIT =3D 3, /* Send FUA (Force Unit Access= ) */ + NBD_FLAG_ROTATIONAL_BIT =3D 4, /* Use elevator algorithm - + rotational media */ + NBD_FLAG_SEND_TRIM_BIT =3D 5, /* Send TRIM (discard) */ + NBD_FLAG_SEND_WRITE_ZEROES_BIT =3D 6, /* Send WRITE_ZEROES */ + NBD_FLAG_SEND_DF_BIT =3D 7, /* Send DF (Do not Fragment) */ + NBD_FLAG_CAN_MULTI_CONN_BIT =3D 8, /* Multi-client cache consiste= nt */ + NBD_FLAG_SEND_RESIZE_BIT =3D 9, /* Send resize */ + NBD_FLAG_SEND_CACHE_BIT =3D 10, /* Send CACHE (prefetch) */ +}; + +#define NBD_FLAG_HAS_FLAGS (1 << NBD_FLAG_HAS_FLAGS_BIT) +#define NBD_FLAG_READ_ONLY (1 << NBD_FLAG_READ_ONLY_BIT) +#define NBD_FLAG_SEND_FLUSH (1 << NBD_FLAG_SEND_FLUSH_BIT) +#define NBD_FLAG_SEND_FUA (1 << NBD_FLAG_SEND_FUA_BIT) +#define NBD_FLAG_ROTATIONAL (1 << NBD_FLAG_ROTATIONAL_BIT) +#define NBD_FLAG_SEND_TRIM (1 << NBD_FLAG_SEND_TRIM_BIT) +#define NBD_FLAG_SEND_WRITE_ZEROES (1 << NBD_FLAG_SEND_WRITE_ZEROES_BIT) +#define NBD_FLAG_SEND_DF (1 << NBD_FLAG_SEND_DF_BIT) +#define NBD_FLAG_CAN_MULTI_CONN (1 << NBD_FLAG_CAN_MULTI_CONN_BIT) +#define NBD_FLAG_SEND_RESIZE (1 << NBD_FLAG_SEND_RESIZE_BIT) +#define NBD_FLAG_SEND_CACHE (1 << NBD_FLAG_SEND_CACHE_BIT) /* New-style handshake (global) flags, sent from server to client, and control what will happen during handshake phase. */ diff --git a/qemu-nbd.c b/qemu-nbd.c index dca9e72ceee..081fcf74d5c 100644 --- a/qemu-nbd.c +++ b/qemu-nbd.c @@ -279,37 +279,25 @@ static int qemu_nbd_client_list(SocketAddress *saddr,= QCryptoTLSCreds *tls, printf(" description: %s\n", list[i].description); } if (list[i].flags & NBD_FLAG_HAS_FLAGS) { + static const char *const flag_names[] =3D { + [NBD_FLAG_READ_ONLY_BIT] =3D "readonly", + [NBD_FLAG_SEND_FLUSH_BIT] =3D "flush", + [NBD_FLAG_SEND_FUA_BIT] =3D "fua", + [NBD_FLAG_ROTATIONAL_BIT] =3D "rotational", + [NBD_FLAG_SEND_TRIM_BIT] =3D "trim", + [NBD_FLAG_SEND_WRITE_ZEROES_BIT] =3D "zeroes", + [NBD_FLAG_SEND_DF_BIT] =3D "df", + [NBD_FLAG_CAN_MULTI_CONN_BIT] =3D "multi", + [NBD_FLAG_SEND_RESIZE_BIT] =3D "resize", + [NBD_FLAG_SEND_CACHE_BIT] =3D "cache", + }; + printf(" size: %" PRIu64 "\n", list[i].size); printf(" flags: 0x%x (", list[i].flags); - if (list[i].flags & NBD_FLAG_READ_ONLY) { - printf(" readonly"); - } - if (list[i].flags & NBD_FLAG_SEND_FLUSH) { - printf(" flush"); - } - if (list[i].flags & NBD_FLAG_SEND_FUA) { - printf(" fua"); - } - if (list[i].flags & NBD_FLAG_ROTATIONAL) { - printf(" rotational"); - } - if (list[i].flags & NBD_FLAG_SEND_TRIM) { - printf(" trim"); - } - if (list[i].flags & NBD_FLAG_SEND_WRITE_ZEROES) { - printf(" zeroes"); - } - if (list[i].flags & NBD_FLAG_SEND_DF) { - printf(" df"); - } - if (list[i].flags & NBD_FLAG_CAN_MULTI_CONN) { - printf(" multi"); - } - if (list[i].flags & NBD_FLAG_SEND_RESIZE) { - printf(" resize"); - } - if (list[i].flags & NBD_FLAG_SEND_CACHE) { - printf(" cache"); + for (size_t bit =3D 0; bit < ARRAY_SIZE(flag_names); bit++) { + if (flag_names[bit] && (list[i].flags & (1 << bit))) { + printf(" %s", flag_names[bit]); + } } printf(" )\n"); } --=20 2.20.1 From nobody Sun May 19 03:54:32 2024 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=1557241447; cv=none; d=zoho.com; s=zohoarc; b=a8jsIvib9T4Al/cmJwWiYrtSBdg93Io56pXO8m0UYalZHNhnAg5PLW7plIFAtXUpJcLU+umfs/Y+Z66p4ldDz55o6cFtN7blGuKSjuRwcK43o1M+NMGTPnN1vs74SoEbj0jkgNzfcm45MgPwNP0+a2tgJIE176TxGQpVu0G5zew= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557241447; 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=wMRobpT6SfOkM5mwvudOEFU872a7bC3NdR3oPGONo6A=; b=epewrBYFh28yldRBkv1GNqXxcRHxzIH4HoJZqhTprPRreFjUxvqdjUqFeYHrVeQzsEyWOHbcplgkUbzJV7D5x0AAdq1kOaJbwS8JpmWzNYDGf0aBug2mGFmhl/nvZjIxidcN8+oeV7p+XUlo/L7r3piBM8Y3VjtHFaIpev/eq9Y= 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= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557241447686698.4312717155916; Tue, 7 May 2019 08:04:07 -0700 (PDT) Received: from localhost ([127.0.0.1]:48209 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hO1dN-00064V-Er for importer@patchew.org; Tue, 07 May 2019 11:03:57 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54062) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hO1ba-00050s-L1 for qemu-devel@nongnu.org; Tue, 07 May 2019 11:02:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hO1bV-0002Rl-Mr for qemu-devel@nongnu.org; Tue, 07 May 2019 11:02:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50580) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hO1bS-0002Pm-C3; Tue, 07 May 2019 11:01:58 -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 AD84880B2C; Tue, 7 May 2019 15:01:57 +0000 (UTC) Received: from blue.redhat.com (ovpn-116-15.phx2.redhat.com [10.3.116.15]) by smtp.corp.redhat.com (Postfix) with ESMTP id 34DC553E20; Tue, 7 May 2019 15:01:57 +0000 (UTC) From: Eric Blake To: qemu-devel@nongnu.org Date: Tue, 7 May 2019 10:01:50 -0500 Message-Id: <20190507150153.26859-3-eblake@redhat.com> In-Reply-To: <20190507150153.26859-1-eblake@redhat.com> References: <20190507150153.26859-1-eblake@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.28]); Tue, 07 May 2019 15:01:57 +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 2/5] iotests: Fix 233 for ports other than 10809 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , "open list:Block layer core" , Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Max Reitz 233 generally filters the port, but in two cases does not. If some other concurrently running application has already taken port 10809, this will result in an output mismatch. Fix this by applying the filter in these two cases, too. Signed-off-by: Max Reitz Message-Id: <20190506160529.6955-1-mreitz@redhat.com> Signed-off-by: Eric Blake --- tests/qemu-iotests/233 | 6 ++++-- tests/qemu-iotests/233.out | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/qemu-iotests/233 b/tests/qemu-iotests/233 index b8b6c8cc4cb..41b4d465606 100755 --- a/tests/qemu-iotests/233 +++ b/tests/qemu-iotests/233 @@ -139,11 +139,13 @@ nbd_server_start_tcp_socket \ $QEMU_IMG info --image-opts \ --object tls-creds-x509,dir=3D${tls_dir}/client1,endpoint=3Dclient,id= =3Dtls0 \ - driver=3Dnbd,host=3D$nbd_tcp_addr,port=3D$nbd_tcp_port,tls-creds=3Dtls0 + driver=3Dnbd,host=3D$nbd_tcp_addr,port=3D$nbd_tcp_port,tls-creds=3Dtls= 0 \ + 2>&1 | sed "s/$nbd_tcp_port/PORT/g" $QEMU_IMG info --image-opts \ --object tls-creds-x509,dir=3D${tls_dir}/client3,endpoint=3Dclient,id= =3Dtls0 \ - driver=3Dnbd,host=3D$nbd_tcp_addr,port=3D$nbd_tcp_port,tls-creds=3Dtls0 + driver=3Dnbd,host=3D$nbd_tcp_addr,port=3D$nbd_tcp_port,tls-creds=3Dtls= 0 \ + 2>&1 | sed "s/$nbd_tcp_port/PORT/g" echo echo "=3D=3D final server log =3D=3D" diff --git a/tests/qemu-iotests/233.out b/tests/qemu-iotests/233.out index 4edc2dd5cfb..9b46284ab0d 100644 --- a/tests/qemu-iotests/233.out +++ b/tests/qemu-iotests/233.out @@ -57,8 +57,8 @@ read 1048576/1048576 bytes at offset 1048576 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) =3D=3D check TLS with authorization =3D=3D -qemu-img: Could not open 'driver=3Dnbd,host=3D127.0.0.1,port=3D10809,tls-c= reds=3Dtls0': Failed to read option reply: Cannot read from TLS channel: So= ftware caused connection abort -qemu-img: Could not open 'driver=3Dnbd,host=3D127.0.0.1,port=3D10809,tls-c= reds=3Dtls0': Failed to read option reply: Cannot read from TLS channel: So= ftware caused connection abort +qemu-img: Could not open 'driver=3Dnbd,host=3D127.0.0.1,port=3DPORT,tls-cr= eds=3Dtls0': Failed to read option reply: Cannot read from TLS channel: Sof= tware caused connection abort +qemu-img: Could not open 'driver=3Dnbd,host=3D127.0.0.1,port=3DPORT,tls-cr= eds=3Dtls0': Failed to read option reply: Cannot read from TLS channel: Sof= tware caused connection abort =3D=3D final server log =3D=3D qemu-nbd: option negotiation failed: Verify failed: No certificate was fou= nd. --=20 2.20.1 From nobody Sun May 19 03:54:32 2024 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=1557241711; cv=none; d=zoho.com; s=zohoarc; b=jMh35/OFoi4hnAHqMQDh0vpnNDsMUY0aFfZAAuCh5oWf9/vG9Z2c5jpZwQQGWdP2uCP1ER3LQG2bHsf2Ucanvgnt9JVqqcIDGeTNwl3qWrLiFmppP/SoQALI34Lq8PHLohkrZPg4U+HugbyzjSndAU01Elivf6kk8sFrIqHufuQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557241711; 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=oGGSA8Jj+zx3dQLXdvFz9ExahXwZaSWw1drIQlJBJkE=; b=gNQ6iJx0iu2FzptSbC4/MK1oDqYAtwIPF7WMherO27hX6ceKiZ4WKxBWEGxQTeugUy2Q0q+45igkcYcnVQAAIHBwtlCh69XKFZ9UaTGQ6nRfKlzCbKfaSqCshM5cUlBZ/aAYVjUjjm0elQ8X9Z5dpV8s855Ljai4tK80qtL/lPw= 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= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557241711410799.4517898409323; Tue, 7 May 2019 08:08:31 -0700 (PDT) Received: from localhost ([127.0.0.1]:48288 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hO1hg-0001VS-Bd for importer@patchew.org; Tue, 07 May 2019 11:08:24 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54053) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hO1bZ-0004za-G8 for qemu-devel@nongnu.org; Tue, 07 May 2019 11:02:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hO1bX-0002Sc-GT for qemu-devel@nongnu.org; Tue, 07 May 2019 11:02:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48324) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hO1bT-0002QS-AC; Tue, 07 May 2019 11:01:59 -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 8BCC63001565; Tue, 7 May 2019 15:01:58 +0000 (UTC) Received: from blue.redhat.com (ovpn-116-15.phx2.redhat.com [10.3.116.15]) by smtp.corp.redhat.com (Postfix) with ESMTP id DC18A53E20; Tue, 7 May 2019 15:01:57 +0000 (UTC) From: Eric Blake To: qemu-devel@nongnu.org Date: Tue, 7 May 2019 10:01:51 -0500 Message-Id: <20190507150153.26859-4-eblake@redhat.com> In-Reply-To: <20190507150153.26859-1-eblake@redhat.com> References: <20190507150153.26859-1-eblake@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.46]); Tue, 07 May 2019 15:01:58 +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 3/5] tests/qemu-iotests: Fix more reference output files due to recent qemu-io change X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Thomas Huth , Max Reitz , "open list:Block layer core" , Stefano Garzarella Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Thomas Huth The output of qemu-io changed recently - most tests have been fixed in commit 36b9986b08787019ef42 ("tests/qemu-iotests: Fix output of qemu-io related tests") already, but a qcow1, vmdk, and nbd test were still missing. Fixes: 99e98d7c9fc1a1639fad ("qemu-io: Use error_[gs]et_progname()") Signed-off-by: Thomas Huth Message-Id: <20190501134127.21104-1-thuth@redhat.com> [eblake: squash in NBD 083 fixes] Reviewed-by: Stefano Garzarella Tested-by: Stefano Garzarella Signed-off-by: Eric Blake --- tests/qemu-iotests/059.out | 8 ++--- tests/qemu-iotests/083.out | 68 +++++++++++++++++++------------------- tests/qemu-iotests/092.out | 24 +++++++------- 3 files changed, 50 insertions(+), 50 deletions(-) diff --git a/tests/qemu-iotests/059.out b/tests/qemu-iotests/059.out index 700ad1f2906..f51394ae8e0 100644 --- a/tests/qemu-iotests/059.out +++ b/tests/qemu-iotests/059.out @@ -2,15 +2,15 @@ QA output created by 059 =3D=3D=3D Testing invalid granularity =3D=3D=3D Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 -can't open device TEST_DIR/t.vmdk: Invalid granularity, image may be corru= pt +qemu-io: can't open device TEST_DIR/t.vmdk: Invalid granularity, image may= be corrupt =3D=3D=3D Testing too big L2 table size =3D=3D=3D Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 -can't open device TEST_DIR/t.vmdk: L2 table size too big +qemu-io: can't open device TEST_DIR/t.vmdk: L2 table size too big =3D=3D=3D Testing too big L1 table size =3D=3D=3D Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 -can't open device TEST_DIR/t.vmdk: L1 size too big +qemu-io: can't open device TEST_DIR/t.vmdk: L1 size too big =3D=3D=3D Testing monolithicFlat creation and opening =3D=3D=3D Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D2147483648 subformat= =3DmonolithicFlat @@ -2050,7 +2050,7 @@ wrote 512/512 bytes at offset 10240 =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 -can't open: Cannot use relative extent paths with VMDK descriptor file 'js= on:{"image": {"driver": "file", "filename": "TEST_DIR/t.IMGFMT"}, "driver":= "blkdebug", "inject-error.0.event": "read_aio"}' +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"}' =3D=3D=3D Testing version 3 =3D=3D=3D image: TEST_DIR/iotest-version3.IMGFMT diff --git a/tests/qemu-iotests/083.out b/tests/qemu-iotests/083.out index 7419722cd7a..eee6dd13794 100644 --- a/tests/qemu-iotests/083.out +++ b/tests/qemu-iotests/083.out @@ -1,43 +1,43 @@ QA output created by 083 =3D=3D=3D Check disconnect before neg1 =3D=3D=3D -can't open device nbd+tcp://127.0.0.1:PORT/foo +qemu-io: can't open device nbd+tcp://127.0.0.1:PORT/foo =3D=3D=3D Check disconnect after neg1 =3D=3D=3D -can't open device nbd+tcp://127.0.0.1:PORT/foo +qemu-io: can't open device nbd+tcp://127.0.0.1:PORT/foo =3D=3D=3D Check disconnect 8 neg1 =3D=3D=3D -can't open device nbd+tcp://127.0.0.1:PORT/foo +qemu-io: can't open device nbd+tcp://127.0.0.1:PORT/foo =3D=3D=3D Check disconnect 16 neg1 =3D=3D=3D -can't open device nbd+tcp://127.0.0.1:PORT/foo +qemu-io: can't open device nbd+tcp://127.0.0.1:PORT/foo =3D=3D=3D Check disconnect before export =3D=3D=3D -can't open device nbd+tcp://127.0.0.1:PORT/foo +qemu-io: can't open device nbd+tcp://127.0.0.1:PORT/foo =3D=3D=3D Check disconnect after export =3D=3D=3D -can't open device nbd+tcp://127.0.0.1:PORT/foo +qemu-io: can't open device nbd+tcp://127.0.0.1:PORT/foo =3D=3D=3D Check disconnect 4 export =3D=3D=3D -can't open device nbd+tcp://127.0.0.1:PORT/foo +qemu-io: can't open device nbd+tcp://127.0.0.1:PORT/foo =3D=3D=3D Check disconnect 12 export =3D=3D=3D -can't open device nbd+tcp://127.0.0.1:PORT/foo +qemu-io: can't open device nbd+tcp://127.0.0.1:PORT/foo =3D=3D=3D Check disconnect 16 export =3D=3D=3D -can't open device nbd+tcp://127.0.0.1:PORT/foo +qemu-io: can't open device nbd+tcp://127.0.0.1:PORT/foo =3D=3D=3D Check disconnect before neg2 =3D=3D=3D -can't open device nbd+tcp://127.0.0.1:PORT/foo +qemu-io: can't open device nbd+tcp://127.0.0.1:PORT/foo =3D=3D=3D Check disconnect after neg2 =3D=3D=3D @@ -45,11 +45,11 @@ read failed: Input/output error =3D=3D=3D Check disconnect 8 neg2 =3D=3D=3D -can't open device nbd+tcp://127.0.0.1:PORT/foo +qemu-io: can't open device nbd+tcp://127.0.0.1:PORT/foo =3D=3D=3D Check disconnect 10 neg2 =3D=3D=3D -can't open device nbd+tcp://127.0.0.1:PORT/foo +qemu-io: can't open device nbd+tcp://127.0.0.1:PORT/foo =3D=3D=3D Check disconnect before request =3D=3D=3D @@ -86,23 +86,23 @@ read 512/512 bytes at offset 0 =3D=3D=3D Check disconnect before neg-classic =3D=3D=3D -can't open device nbd+tcp://127.0.0.1:PORT/ +qemu-io: can't open device nbd+tcp://127.0.0.1:PORT/ =3D=3D=3D Check disconnect 8 neg-classic =3D=3D=3D -can't open device nbd+tcp://127.0.0.1:PORT/ +qemu-io: can't open device nbd+tcp://127.0.0.1:PORT/ =3D=3D=3D Check disconnect 16 neg-classic =3D=3D=3D -can't open device nbd+tcp://127.0.0.1:PORT/ +qemu-io: can't open device nbd+tcp://127.0.0.1:PORT/ =3D=3D=3D Check disconnect 24 neg-classic =3D=3D=3D -can't open device nbd+tcp://127.0.0.1:PORT/ +qemu-io: can't open device nbd+tcp://127.0.0.1:PORT/ =3D=3D=3D Check disconnect 28 neg-classic =3D=3D=3D -can't open device nbd+tcp://127.0.0.1:PORT/ +qemu-io: can't open device nbd+tcp://127.0.0.1:PORT/ =3D=3D=3D Check disconnect after neg-classic =3D=3D=3D @@ -110,43 +110,43 @@ read failed: Input/output error =3D=3D=3D Check disconnect before neg1 =3D=3D=3D -can't open device nbd+unix:///foo?socket=3DTEST_DIR/nbd.sock +qemu-io: can't open device nbd+unix:///foo?socket=3DTEST_DIR/nbd.sock =3D=3D=3D Check disconnect after neg1 =3D=3D=3D -can't open device nbd+unix:///foo?socket=3DTEST_DIR/nbd.sock +qemu-io: can't open device nbd+unix:///foo?socket=3DTEST_DIR/nbd.sock =3D=3D=3D Check disconnect 8 neg1 =3D=3D=3D -can't open device nbd+unix:///foo?socket=3DTEST_DIR/nbd.sock +qemu-io: can't open device nbd+unix:///foo?socket=3DTEST_DIR/nbd.sock =3D=3D=3D Check disconnect 16 neg1 =3D=3D=3D -can't open device nbd+unix:///foo?socket=3DTEST_DIR/nbd.sock +qemu-io: can't open device nbd+unix:///foo?socket=3DTEST_DIR/nbd.sock =3D=3D=3D Check disconnect before export =3D=3D=3D -can't open device nbd+unix:///foo?socket=3DTEST_DIR/nbd.sock +qemu-io: can't open device nbd+unix:///foo?socket=3DTEST_DIR/nbd.sock =3D=3D=3D Check disconnect after export =3D=3D=3D -can't open device nbd+unix:///foo?socket=3DTEST_DIR/nbd.sock +qemu-io: can't open device nbd+unix:///foo?socket=3DTEST_DIR/nbd.sock =3D=3D=3D Check disconnect 4 export =3D=3D=3D -can't open device nbd+unix:///foo?socket=3DTEST_DIR/nbd.sock +qemu-io: can't open device nbd+unix:///foo?socket=3DTEST_DIR/nbd.sock =3D=3D=3D Check disconnect 12 export =3D=3D=3D -can't open device nbd+unix:///foo?socket=3DTEST_DIR/nbd.sock +qemu-io: can't open device nbd+unix:///foo?socket=3DTEST_DIR/nbd.sock =3D=3D=3D Check disconnect 16 export =3D=3D=3D -can't open device nbd+unix:///foo?socket=3DTEST_DIR/nbd.sock +qemu-io: can't open device nbd+unix:///foo?socket=3DTEST_DIR/nbd.sock =3D=3D=3D Check disconnect before neg2 =3D=3D=3D -can't open device nbd+unix:///foo?socket=3DTEST_DIR/nbd.sock +qemu-io: can't open device nbd+unix:///foo?socket=3DTEST_DIR/nbd.sock =3D=3D=3D Check disconnect after neg2 =3D=3D=3D @@ -154,11 +154,11 @@ read failed: Input/output error =3D=3D=3D Check disconnect 8 neg2 =3D=3D=3D -can't open device nbd+unix:///foo?socket=3DTEST_DIR/nbd.sock +qemu-io: can't open device nbd+unix:///foo?socket=3DTEST_DIR/nbd.sock =3D=3D=3D Check disconnect 10 neg2 =3D=3D=3D -can't open device nbd+unix:///foo?socket=3DTEST_DIR/nbd.sock +qemu-io: can't open device nbd+unix:///foo?socket=3DTEST_DIR/nbd.sock =3D=3D=3D Check disconnect before request =3D=3D=3D @@ -195,23 +195,23 @@ read 512/512 bytes at offset 0 =3D=3D=3D Check disconnect before neg-classic =3D=3D=3D -can't open device nbd+unix:///?socket=3DTEST_DIR/nbd.sock +qemu-io: can't open device nbd+unix:///?socket=3DTEST_DIR/nbd.sock =3D=3D=3D Check disconnect 8 neg-classic =3D=3D=3D -can't open device nbd+unix:///?socket=3DTEST_DIR/nbd.sock +qemu-io: can't open device nbd+unix:///?socket=3DTEST_DIR/nbd.sock =3D=3D=3D Check disconnect 16 neg-classic =3D=3D=3D -can't open device nbd+unix:///?socket=3DTEST_DIR/nbd.sock +qemu-io: can't open device nbd+unix:///?socket=3DTEST_DIR/nbd.sock =3D=3D=3D Check disconnect 24 neg-classic =3D=3D=3D -can't open device nbd+unix:///?socket=3DTEST_DIR/nbd.sock +qemu-io: can't open device nbd+unix:///?socket=3DTEST_DIR/nbd.sock =3D=3D=3D Check disconnect 28 neg-classic =3D=3D=3D -can't open device nbd+unix:///?socket=3DTEST_DIR/nbd.sock +qemu-io: can't open device nbd+unix:///?socket=3DTEST_DIR/nbd.sock =3D=3D=3D Check disconnect after neg-classic =3D=3D=3D diff --git a/tests/qemu-iotests/092.out b/tests/qemu-iotests/092.out index 6eda321fc6b..3e799148735 100644 --- a/tests/qemu-iotests/092.out +++ b/tests/qemu-iotests/092.out @@ -2,25 +2,25 @@ QA output created by 092 =3D=3D Invalid cluster size =3D=3D Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 -can't open device TEST_DIR/t.qcow: Cluster size must be between 512 and 64k -can't open device TEST_DIR/t.qcow: Cluster size must be between 512 and 64k -can't open device TEST_DIR/t.qcow: Cluster size must be between 512 and 64k -can't open device TEST_DIR/t.qcow: Cluster size must be between 512 and 64k +qemu-io: can't open device TEST_DIR/t.qcow: Cluster size must be between 5= 12 and 64k +qemu-io: can't open device TEST_DIR/t.qcow: Cluster size must be between 5= 12 and 64k +qemu-io: can't open device TEST_DIR/t.qcow: Cluster size must be between 5= 12 and 64k +qemu-io: can't open device TEST_DIR/t.qcow: Cluster size must be between 5= 12 and 64k =3D=3D Invalid L2 table size =3D=3D Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 -can't open device TEST_DIR/t.qcow: L2 table size must be between 512 and 6= 4k -can't open device TEST_DIR/t.qcow: L2 table size must be between 512 and 6= 4k -can't open device TEST_DIR/t.qcow: L2 table size must be between 512 and 6= 4k -can't open device TEST_DIR/t.qcow: L2 table size must be between 512 and 6= 4k +qemu-io: can't open device TEST_DIR/t.qcow: L2 table size must be between = 512 and 64k +qemu-io: can't open device TEST_DIR/t.qcow: L2 table size must be between = 512 and 64k +qemu-io: can't open device TEST_DIR/t.qcow: L2 table size must be between = 512 and 64k +qemu-io: can't open device TEST_DIR/t.qcow: L2 table size must be between = 512 and 64k =3D=3D Invalid size =3D=3D Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 -can't open device TEST_DIR/t.qcow: Image too large -can't open device TEST_DIR/t.qcow: Image too large +qemu-io: can't open device TEST_DIR/t.qcow: Image too large +qemu-io: can't open device TEST_DIR/t.qcow: Image too large =3D=3D Invalid backing file length =3D=3D Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 -can't open device TEST_DIR/t.qcow: Backing file name too long -can't open device TEST_DIR/t.qcow: Backing file name too long +qemu-io: can't open device TEST_DIR/t.qcow: Backing file name too long +qemu-io: can't open device TEST_DIR/t.qcow: Backing file name too long *** done --=20 2.20.1 From nobody Sun May 19 03:54:32 2024 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=1557241592; cv=none; d=zoho.com; s=zohoarc; b=d07Hc3Az1Y3kEoCnCITp3jz95Tn3MnCkEII5J8i8kqQKiLlviO/0r4U9La+v3e/uXmwnJzZKw3XB3YMfKlKMKkMyBgkhrG/dETMh65PVtTSPX8PWWRc0qmD6NkN2FRyxF1COIn1SxHhQrSJGYoru6EBy/qdnXp6hWMsAOisVmlk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557241592; 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=pLi1xknU6r2OMTdfXVLz2e+Bmoi9tDT5XPV4i4v388Q=; b=Di4Et1eLUB9b4LpOX/lMg2/KR3DPEWvAfvyZzmOpQ94awfwzm/hKVWFkQVGJx9Cj6QJjzzSbgCMqEnolkoBwi+rhf+y9qjkPsl1oPt1EY2HncTRdOMwAsb5O+rnMlrm4zxQUhzTk/miOuNHIIS2VTbVjcJjsnzsb4dnah2xTlk4= 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= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557241592392723.4060534848104; Tue, 7 May 2019 08:06:32 -0700 (PDT) Received: from localhost ([127.0.0.1]:48262 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hO1fe-0007yY-Ex for importer@patchew.org; Tue, 07 May 2019 11:06:18 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54036) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hO1bY-0004yW-NO for qemu-devel@nongnu.org; Tue, 07 May 2019 11:02:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hO1bX-0002Sh-I5 for qemu-devel@nongnu.org; Tue, 07 May 2019 11:02:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38312) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hO1bU-0002RE-Vn; Tue, 07 May 2019 11:02:01 -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 55936308A107; Tue, 7 May 2019 15:01:59 +0000 (UTC) Received: from blue.redhat.com (ovpn-116-15.phx2.redhat.com [10.3.116.15]) by smtp.corp.redhat.com (Postfix) with ESMTP id B30E65C46B; Tue, 7 May 2019 15:01:58 +0000 (UTC) From: Eric Blake To: qemu-devel@nongnu.org Date: Tue, 7 May 2019 10:01:52 -0500 Message-Id: <20190507150153.26859-5-eblake@redhat.com> In-Reply-To: <20190507150153.26859-1-eblake@redhat.com> References: <20190507150153.26859-1-eblake@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.44]); Tue, 07 May 2019 15:01:59 +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 4/5] iotests: Tweak 221 sizing for different hole granularities X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Thomas Huth , "open list:Block layer core" , Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" For some particular configurations of ext4, sizing an image to 84 sectors + 1 byte causes test failures when the size of the hole is rounded to a 4k alignment. Let's instead size things to 128 sectors + 1 byte, as the 64k boundary is more likely to work with various hole granularities. Reported-by: Thomas Huth Signed-off-by: Eric Blake Message-Id: <20190506172111.31594-1-eblake@redhat.com> Tested-by: Thomas Huth --- tests/qemu-iotests/221 | 10 +++++----- tests/qemu-iotests/221.out | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/tests/qemu-iotests/221 b/tests/qemu-iotests/221 index 808cd9a289c..25dd47bcfe4 100755 --- a/tests/qemu-iotests/221 +++ b/tests/qemu-iotests/221 @@ -2,7 +2,7 @@ # # Test qemu-img vs. unaligned images # -# Copyright (C) 2018 Red Hat, Inc. +# Copyright (C) 2018-2019 Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -41,16 +41,16 @@ echo echo "=3D=3D=3D Check mapping of unaligned raw image =3D=3D=3D" echo -_make_test_img 43009 # qemu-img create rounds size up +_make_test_img 65537 # qemu-img create rounds size up $QEMU_IMG map --output=3Djson "$TEST_IMG" | _filter_qemu_img_map -truncate --size=3D43009 "$TEST_IMG" # so we resize it and check again +truncate --size=3D65537 "$TEST_IMG" # so we resize it and check again $QEMU_IMG map --output=3Djson "$TEST_IMG" | _filter_qemu_img_map -$QEMU_IO -c 'w 43008 1' "$TEST_IMG" | _filter_qemu_io # writing also round= s up +$QEMU_IO -c 'w 65536 1' "$TEST_IMG" | _filter_qemu_io # writing also round= s up $QEMU_IMG map --output=3Djson "$TEST_IMG" | _filter_qemu_img_map -truncate --size=3D43009 "$TEST_IMG" # so we resize it and check again +truncate --size=3D65537 "$TEST_IMG" # so we resize it and check again $QEMU_IMG map --output=3Djson "$TEST_IMG" | _filter_qemu_img_map # success, all done diff --git a/tests/qemu-iotests/221.out b/tests/qemu-iotests/221.out index a9c0190aadc..9f9dd52bb0b 100644 --- a/tests/qemu-iotests/221.out +++ b/tests/qemu-iotests/221.out @@ -2,15 +2,15 @@ QA output created by 221 =3D=3D=3D Check mapping of unaligned raw image =3D=3D=3D -Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D43009 -[{ "start": 0, "length": 43520, "depth": 0, "zero": true, "data": false, "= offset": OFFSET}] -[{ "start": 0, "length": 43520, "depth": 0, "zero": true, "data": false, "= offset": OFFSET}] -wrote 1/1 bytes at offset 43008 +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}] +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": 40960, "depth": 0, "zero": true, "data": false, "= offset": OFFSET}, -{ "start": 40960, "length": 2049, "depth": 0, "zero": false, "data": true,= "offset": OFFSET}, -{ "start": 43009, "length": 511, "depth": 0, "zero": true, "data": false, = "offset": OFFSET}] -[{ "start": 0, "length": 40960, "depth": 0, "zero": true, "data": false, "= offset": OFFSET}, -{ "start": 40960, "length": 2049, "depth": 0, "zero": false, "data": true,= "offset": OFFSET}, -{ "start": 43009, "length": 511, "depth": 0, "zero": true, "data": false, = "offset": OFFSET}] +[{ "start": 0, "length": 65536, "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": 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 --=20 2.20.1 From nobody Sun May 19 03:54:32 2024 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=1557241588; cv=none; d=zoho.com; s=zohoarc; b=GboMfwhqNIf9w9Qa4EKZHifOHTY6p0xGQnj+GueEYt8lZPOQwZe4l7BroQ7Ln+HB48WCMVaYjiTA7LpFxjkviPnM1HxG0pbI9yjyjy/cG6yUgLF4lPV7fpF5GIt7CNU58lhcj4+nF9HbA9F33HUMksZd7spcXGcCVT80GoiGQog= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557241588; 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=ucY4ClbqOMsBiqKMxrr7kXl9l/PFYJUyfBS77j8wzig=; b=CVUu830qkjv30obk7OKRSGeaL0Rx8s1fU4NSplGctZeHmTaXHLQdR+h0g4TWG1soo+rnWiasg2pByAa4Ji5O1VVPWlfOIEmIQGbk5/BKeXbWbrr2zl8IdK3xMdIz633BF+tGEZ3978bN+3cJBJaWEsjuXux9jJQeme9ZRapCLag= 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= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1557241588513745.7563630124429; Tue, 7 May 2019 08:06:28 -0700 (PDT) Received: from localhost ([127.0.0.1]:48260 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hO1fb-0007qZ-Fm for importer@patchew.org; Tue, 07 May 2019 11:06:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54050) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hO1bZ-0004zX-FW for qemu-devel@nongnu.org; Tue, 07 May 2019 11:02:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hO1bY-0002Sx-AX for qemu-devel@nongnu.org; Tue, 07 May 2019 11:02:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38326) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hO1bV-0002RV-R5; Tue, 07 May 2019 11:02:01 -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 22E8F30832C3; Tue, 7 May 2019 15:02:01 +0000 (UTC) Received: from blue.redhat.com (ovpn-116-15.phx2.redhat.com [10.3.116.15]) by smtp.corp.redhat.com (Postfix) with ESMTP id 786E25C2E1; Tue, 7 May 2019 15:01:59 +0000 (UTC) From: Eric Blake To: qemu-devel@nongnu.org Date: Tue, 7 May 2019 10:01:53 -0500 Message-Id: <20190507150153.26859-6-eblake@redhat.com> In-Reply-To: <20190507150153.26859-1-eblake@redhat.com> References: <20190507150153.26859-1-eblake@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.44]); Tue, 07 May 2019 15:02:01 +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 5/5] iotests: Make 182 do without device_add X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Alberto Garcia , "open list:Block layer core" , "Danilo C . L . de Paula" , Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Max Reitz 182 fails if qemu has no support for hotplugging of a virtio-blk device. Using an NBD server instead works just as well for the test, even on qemus without hotplugging support. Fixes: 6d0a4a0fb5c8f10c8eb68b52cfda0082b00ae963 Reported-by: Danilo C. L. de Paula Signed-off-by: Max Reitz Message-Id: <20190417153005.30096-1-mreitz@redhat.com> Tested-by: Eric Blake Reviewed-by: Eric Blake Acked-by: Alberto Garcia Signed-off-by: Eric Blake --- tests/qemu-iotests/182 | 22 +++++++++++++++++----- tests/qemu-iotests/182.out | 1 + 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/tests/qemu-iotests/182 b/tests/qemu-iotests/182 index ff3d7e7ec1b..38959bf276a 100755 --- a/tests/qemu-iotests/182 +++ b/tests/qemu-iotests/182 @@ -31,6 +31,7 @@ _cleanup() { _cleanup_test_img rm -f "$TEST_IMG.overlay" + rm -f "$TEST_DIR/nbd.socket" } trap "_cleanup; exit \$status" 0 1 2 3 15 @@ -126,15 +127,26 @@ success_or_failure=3Dy _send_qemu_cmd $QEMU_HANDLE \ 'return' \ 'error' -# Now we attach the image to a virtio-blk device. This device does -# require some permissions (at least WRITE and READ_CONSISTENT), so if +# Start an NBD server to which we can attach node1 +success_or_failure=3Dy _send_qemu_cmd $QEMU_HANDLE \ + "{'execute': 'nbd-server-start', + 'arguments': { + 'addr': { + 'type': 'unix', + 'data': { + 'path': '$TEST_DIR/nbd.socket' + } } } }" \ + 'return' \ + 'error' + +# Now we attach the image to the NBD server. This server does require +# some permissions (at least WRITE and READ_CONSISTENT), so if # reopening node0 unshared any (which it should not have), this will # fail (but it should not). success_or_failure=3Dy _send_qemu_cmd $QEMU_HANDLE \ - "{'execute': 'device_add', + "{'execute': 'nbd-server-add', 'arguments': { - 'driver': 'virtio-blk', - 'drive': 'node1' + 'device': 'node1' } }" \ 'return' \ 'error' diff --git a/tests/qemu-iotests/182.out b/tests/qemu-iotests/182.out index af501ca3f3c..33d41eea915 100644 --- a/tests/qemu-iotests/182.out +++ b/tests/qemu-iotests/182.out @@ -14,4 +14,5 @@ Formatting 'TEST_DIR/t.qcow2.overlay', fmt=3Dqcow2 size= =3D197120 backing_file=3DTEST_D {"return": {}} {"return": {}} {"return": {}} +{"return": {}} *** done --=20 2.20.1