From nobody Thu May 2 22:02:00 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 15003014798886.120952004194919; Mon, 17 Jul 2017 07:24:39 -0700 (PDT) Received: from localhost ([::1]:50730 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dX6wY-0001WS-1x for importer@patchew.org; Mon, 17 Jul 2017 10:24:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57847) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dX6vi-00018N-3s for qemu-devel@nongnu.org; Mon, 17 Jul 2017 10:23:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dX6vh-0007p4-78 for qemu-devel@nongnu.org; Mon, 17 Jul 2017 10:23:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44730) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dX6vc-0007mP-E7; Mon, 17 Jul 2017 10:23:16 -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 37C9D2C1541; Mon, 17 Jul 2017 14:23:15 +0000 (UTC) Received: from red.redhat.com (ovpn-120-160.rdu2.redhat.com [10.10.120.160]) by smtp.corp.redhat.com (Postfix) with ESMTP id 46DE177714; Mon, 17 Jul 2017 14:23:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 37C9D2C1541 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=eblake@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 37C9D2C1541 From: Eric Blake To: qemu-devel@nongnu.org Date: Mon, 17 Jul 2017 09:23:10 -0500 Message-Id: <20170717142310.17048-1-eblake@redhat.com> 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.39]); Mon, 17 Jul 2017 14:23:15 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] nbd: Fix iotests failure due to changed client error message X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, Paolo Bonzini , qemu-block@nongnu.org, mreitz@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Commit 8ecaeae8 changed the way the client requests an NBD export, and in the process also changed the resulting error message when the export is not present, breaking a couple of iotests. The error message is now directly given by the server (a failed NBD_OPT_GO) instead of implied by the client (after exhausting NBD_OPT_LIST), but looking at the testsuite changes, it proves worthwhile to reword the error message to be slightly less verbose (as this is one particular error message likely to be hit by a user). Note that the error message is now sensitive to which binary is running the server as well as the client (since the expected output is replaying a message received from the server); in general iotests are run on client and server from the same source code base, but if it proves problematic in practice, we'll have to tweak or sanitize the output somehow. Reported-by: Kevin Wolf Signed-off-by: Eric Blake Reviewed-by: John Snow Tested-by: John Snow --- nbd/client.c | 5 ++--- tests/qemu-iotests/140.out | 3 ++- tests/qemu-iotests/143.out | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/nbd/client.c b/nbd/client.c index 4c12fffcbf..509ed5e4ba 100644 --- a/nbd/client.c +++ b/nbd/client.c @@ -232,8 +232,7 @@ static int nbd_handle_reply_err(QIOChannel *ioc, nbd_op= t_reply *reply, break; case NBD_REP_ERR_UNKNOWN: - error_setg(errp, "Requested export not available for option %" PRI= x32 - " (%s)", reply->option, nbd_opt_lookup(reply->option)); + error_setg(errp, "Requested export not available"); break; case NBD_REP_ERR_SHUTDOWN: @@ -253,7 +252,7 @@ static int nbd_handle_reply_err(QIOChannel *ioc, nbd_op= t_reply *reply, } if (msg) { - error_append_hint(errp, "%s\n", msg); + error_append_hint(errp, "server reported: %s\n", msg); } cleanup: diff --git a/tests/qemu-iotests/140.out b/tests/qemu-iotests/140.out index 0689b2b41c..7295b3d975 100644 --- a/tests/qemu-iotests/140.out +++ b/tests/qemu-iotests/140.out @@ -8,7 +8,8 @@ wrote 65536/65536 bytes at offset 0 read 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) {"return": {}} -can't open device nbd+unix:///drv?socket=3DTEST_DIR/nbd: No export with na= me 'drv' available +can't open device nbd+unix:///drv?socket=3DTEST_DIR/nbd: Requested export = not available +server reported: export 'drv' not present {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false}} *** done diff --git a/tests/qemu-iotests/143.out b/tests/qemu-iotests/143.out index 0978b8985a..1c7fb45543 100644 --- a/tests/qemu-iotests/143.out +++ b/tests/qemu-iotests/143.out @@ -1,7 +1,8 @@ QA output created by 143 {"return": {}} {"return": {}} -can't open device nbd+unix:///no_such_export?socket=3DTEST_DIR/nbd: No exp= ort with name 'no_such_export' available +can't open device nbd+unix:///no_such_export?socket=3DTEST_DIR/nbd: Reques= ted export not available +server reported: export 'no_such_export' not present {"return": {}} {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "SHUTDOWN", "data": {"guest": false}} *** done --=20 2.13.3