From nobody Sun Feb 8 22:34:08 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.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 1486138254729719.3649614897992; Fri, 3 Feb 2017 08:10:54 -0800 (PST) Received: from localhost ([::1]:35527 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cZgRm-0001jK-Kl for importer@patchew.org; Fri, 03 Feb 2017 11:10:50 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36720) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cZg5n-0007nq-Mp for qemu-devel@nongnu.org; Fri, 03 Feb 2017 10:48:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cZg5i-00080y-K3 for qemu-devel@nongnu.org; Fri, 03 Feb 2017 10:48:07 -0500 Received: from mailhub.sw.ru ([195.214.232.25]:29031 helo=relay.sw.ru) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cZg5i-0007yG-7v for qemu-devel@nongnu.org; Fri, 03 Feb 2017 10:48:02 -0500 Received: from kvm.qa.sw.ru. (msk-vpn.virtuozzo.com [195.214.232.6]) by relay.sw.ru (8.13.4/8.13.4) with ESMTP id v13Flv7g011039; Fri, 3 Feb 2017 18:47:57 +0300 (MSK) From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org, qemu-devel@nongnu.org Date: Fri, 3 Feb 2017 18:47:40 +0300 Message-Id: <20170203154757.36140-2-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170203154757.36140-1-vsementsov@virtuozzo.com> References: <20170203154757.36140-1-vsementsov@virtuozzo.com> X-detected-operating-system: by eggs.gnu.org: OpenBSD 3.x [fuzzy] X-Received-From: 195.214.232.25 Subject: [Qemu-devel] [PATCH 01/18] nbd: rename NBD_REPLY_MAGIC to NBD_SIMPLE_REPLY_MAGIC 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, famz@redhat.com, den@virtuozzo.com, armbru@redhat.com, mreitz@redhat.com, stefanha@redhat.com, pbonzini@redhat.com, jsnow@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" To be consistent when NBD_STRUCTURED_REPLY_MAGIC will be introduced. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- nbd/client.c | 4 ++-- nbd/nbd-internal.h | 2 +- nbd/server.c | 4 ++-- tests/qemu-iotests/nbd-fault-injector.py | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/nbd/client.c b/nbd/client.c index ffb0743bce..de5c9366c7 100644 --- a/nbd/client.c +++ b/nbd/client.c @@ -788,7 +788,7 @@ ssize_t nbd_receive_reply(QIOChannel *ioc, NBDReply *re= ply) } =20 /* Reply - [ 0 .. 3] magic (NBD_REPLY_MAGIC) + [ 0 .. 3] magic (NBD_SIMPLE_REPLY_MAGIC) [ 4 .. 7] error (0 =3D=3D no error) [ 7 .. 15] handle */ @@ -808,7 +808,7 @@ ssize_t nbd_receive_reply(QIOChannel *ioc, NBDReply *re= ply) ", handle =3D %" PRIu64" }", magic, reply->error, reply->handle); =20 - if (magic !=3D NBD_REPLY_MAGIC) { + if (magic !=3D NBD_SIMPLE_REPLY_MAGIC) { LOG("invalid magic (got 0x%" PRIx32 ")", magic); return -EINVAL; } diff --git a/nbd/nbd-internal.h b/nbd/nbd-internal.h index eee20abc25..49b66b6896 100644 --- a/nbd/nbd-internal.h +++ b/nbd/nbd-internal.h @@ -59,7 +59,7 @@ #define NBD_REQUEST_SIZE (4 + 2 + 2 + 8 + 8 + 4) #define NBD_REPLY_SIZE (4 + 4 + 8) #define NBD_REQUEST_MAGIC 0x25609513 -#define NBD_REPLY_MAGIC 0x67446698 +#define NBD_SIMPLE_REPLY_MAGIC 0x67446698 #define NBD_OPTS_MAGIC 0x49484156454F5054LL #define NBD_CLIENT_MAGIC 0x0000420281861253LL #define NBD_REP_MAGIC 0x0003e889045565a9LL diff --git a/nbd/server.c b/nbd/server.c index 5b76261666..b63a8b85e3 100644 --- a/nbd/server.c +++ b/nbd/server.c @@ -750,11 +750,11 @@ static ssize_t nbd_send_reply(QIOChannel *ioc, NBDRep= ly *reply) reply->error, reply->handle); =20 /* Reply - [ 0 .. 3] magic (NBD_REPLY_MAGIC) + [ 0 .. 3] magic (NBD_SIMPLE_REPLY_MAGIC) [ 4 .. 7] error (0 =3D=3D no error) [ 7 .. 15] handle */ - stl_be_p(buf, NBD_REPLY_MAGIC); + stl_be_p(buf, NBD_SIMPLE_REPLY_MAGIC); stl_be_p(buf + 4, reply->error); stq_be_p(buf + 8, reply->handle); =20 diff --git a/tests/qemu-iotests/nbd-fault-injector.py b/tests/qemu-iotests/= nbd-fault-injector.py index 6c07191a5a..5d092ee1f6 100755 --- a/tests/qemu-iotests/nbd-fault-injector.py +++ b/tests/qemu-iotests/nbd-fault-injector.py @@ -56,7 +56,7 @@ NBD_CMD_READ =3D 0 NBD_CMD_WRITE =3D 1 NBD_CMD_DISC =3D 2 NBD_REQUEST_MAGIC =3D 0x25609513 -NBD_REPLY_MAGIC =3D 0x67446698 +NBD_SIMPLE_REPLY_MAGIC =3D 0x67446698 NBD_PASSWD =3D 0x4e42444d41474943 NBD_OPTS_MAGIC =3D 0x49484156454F5054 NBD_CLIENT_MAGIC =3D 0x0000420281861253 @@ -166,7 +166,7 @@ def read_request(conn): return req =20 def write_reply(conn, error, handle): - buf =3D reply_struct.pack(NBD_REPLY_MAGIC, error, handle) + buf =3D reply_struct.pack(NBD_SIMPLE_REPLY_MAGIC, error, handle) conn.send(buf, event=3D'reply') =20 def handle_connection(conn, use_export): --=20 2.11.0