{"id":818259,"url":"http://patchwork.ozlabs.org/api/patches/818259/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20170925135801.144261-4-vsementsov@virtuozzo.com/","project":{"id":14,"url":"http://patchwork.ozlabs.org/api/projects/14/?format=json","name":"QEMU Development","link_name":"qemu-devel","list_id":"qemu-devel.nongnu.org","list_email":"qemu-devel@nongnu.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20170925135801.144261-4-vsementsov@virtuozzo.com>","list_archive_url":null,"date":"2017-09-25T13:57:56","name":"[3/8] nbd: rename NBD_REPLY_MAGIC to NBD_SIMPLE_REPLY_MAGIC","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"5925b88b4c251a744c2a0d4f23f10bbb0de49e87","submitter":{"id":66592,"url":"http://patchwork.ozlabs.org/api/people/66592/?format=json","name":"Vladimir Sementsov-Ogievskiy","email":"vsementsov@virtuozzo.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20170925135801.144261-4-vsementsov@virtuozzo.com/mbox/","series":[{"id":4967,"url":"http://patchwork.ozlabs.org/api/series/4967/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/list/?series=4967","date":"2017-09-25T13:58:01","name":"nbd minimal structured read","version":1,"mbox":"http://patchwork.ozlabs.org/series/4967/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/818259/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/818259/checks/","tags":{},"related":[],"headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3y15Vh4q5kz9tXC\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 26 Sep 2017 00:06:52 +1000 (AEST)","from localhost ([::1]:42644 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dwU26-00054x-P4\n\tfor incoming@patchwork.ozlabs.org; Mon, 25 Sep 2017 10:06:50 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:39735)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <vsementsov@virtuozzo.com>) id 1dwTu2-0006bI-7H\n\tfor qemu-devel@nongnu.org; Mon, 25 Sep 2017 09:58:31 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <vsementsov@virtuozzo.com>) id 1dwTu1-0007HR-67\n\tfor qemu-devel@nongnu.org; Mon, 25 Sep 2017 09:58:30 -0400","from mailhub.sw.ru ([195.214.232.25]:20137 helo=relay.sw.ru)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <vsementsov@virtuozzo.com>)\n\tid 1dwTu0-0007G1-RT\n\tfor qemu-devel@nongnu.org; Mon, 25 Sep 2017 09:58:29 -0400","from kvm.sw.ru (msk-vpn.virtuozzo.com [195.214.232.6])\n\tby relay.sw.ru (8.13.4/8.13.4) with ESMTP id v8PDw1ft013085;\n\tMon, 25 Sep 2017 16:58:02 +0300 (MSK)"],"From":"Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>","To":"qemu-devel@nongnu.org, qemu-block@nongnu.org","Date":"Mon, 25 Sep 2017 16:57:56 +0300","Message-Id":"<20170925135801.144261-4-vsementsov@virtuozzo.com>","X-Mailer":"git-send-email 2.11.1","In-Reply-To":"<20170925135801.144261-1-vsementsov@virtuozzo.com>","References":"<20170925135801.144261-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 3/8] nbd: rename NBD_REPLY_MAGIC to\n\tNBD_SIMPLE_REPLY_MAGIC","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://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>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"kwolf@redhat.com, vsementsov@virtuozzo.com, Hmreitz@redhat.com,\n\tden@openvz.org, pbonzini@redhat.com","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"},"content":"To be consistent when NBD_STRUCTURED_REPLY_MAGIC will be introduced.\n\nSigned-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>\nReviewed-by: Eric Blake <eblake@redhat.com>\n---\n nbd/nbd-internal.h                       | 2 +-\n nbd/client.c                             | 4 ++--\n nbd/server.c                             | 4 ++--\n tests/qemu-iotests/nbd-fault-injector.py | 4 ++--\n 4 files changed, 7 insertions(+), 7 deletions(-)","diff":"diff --git a/nbd/nbd-internal.h b/nbd/nbd-internal.h\nindex 8a609a227f..2d6663de23 100644\n--- a/nbd/nbd-internal.h\n+++ b/nbd/nbd-internal.h\n@@ -47,7 +47,7 @@\n #define NBD_OLDSTYLE_NEGOTIATE_SIZE (8 + 8 + 8 + 4 + 124)\n \n #define NBD_REQUEST_MAGIC       0x25609513\n-#define NBD_REPLY_MAGIC         0x67446698\n+#define NBD_SIMPLE_REPLY_MAGIC  0x67446698\n #define NBD_OPTS_MAGIC          0x49484156454F5054LL\n #define NBD_CLIENT_MAGIC        0x0000420281861253LL\n #define NBD_REP_MAGIC           0x0003e889045565a9LL\ndiff --git a/nbd/client.c b/nbd/client.c\nindex 68a0bc1ffc..cd5a2c80ac 100644\n--- a/nbd/client.c\n+++ b/nbd/client.c\n@@ -931,7 +931,7 @@ int nbd_receive_reply(QIOChannel *ioc, NBDReply *reply, Error **errp)\n     }\n \n     /* Reply\n-       [ 0 ..  3]    magic   (NBD_REPLY_MAGIC)\n+       [ 0 ..  3]    magic   (NBD_SIMPLE_REPLY_MAGIC)\n        [ 4 ..  7]    error   (0 == no error)\n        [ 7 .. 15]    handle\n      */\n@@ -949,7 +949,7 @@ int nbd_receive_reply(QIOChannel *ioc, NBDReply *reply, Error **errp)\n     }\n     trace_nbd_receive_reply(magic, reply->error, reply->handle);\n \n-    if (magic != NBD_REPLY_MAGIC) {\n+    if (magic != NBD_SIMPLE_REPLY_MAGIC) {\n         error_setg(errp, \"invalid magic (got 0x%\" PRIx32 \")\", magic);\n         return -EINVAL;\n     }\ndiff --git a/nbd/server.c b/nbd/server.c\nindex 993ade30bb..a1b21a6951 100644\n--- a/nbd/server.c\n+++ b/nbd/server.c\n@@ -911,11 +911,11 @@ static int nbd_send_reply(QIOChannel *ioc, NBDReply *reply, Error **errp)\n     trace_nbd_send_reply(reply->error, reply->handle);\n \n     /* Reply\n-       [ 0 ..  3]    magic   (NBD_REPLY_MAGIC)\n+       [ 0 ..  3]    magic   (NBD_SIMPLE_REPLY_MAGIC)\n        [ 4 ..  7]    error   (0 == no error)\n        [ 7 .. 15]    handle\n      */\n-    stl_be_p(buf, NBD_REPLY_MAGIC);\n+    stl_be_p(buf, NBD_SIMPLE_REPLY_MAGIC);\n     stl_be_p(buf + 4, reply->error);\n     stq_be_p(buf + 8, reply->handle);\n \ndiff --git a/tests/qemu-iotests/nbd-fault-injector.py b/tests/qemu-iotests/nbd-fault-injector.py\nindex 1c10dcb51c..8a04d979aa 100755\n--- a/tests/qemu-iotests/nbd-fault-injector.py\n+++ b/tests/qemu-iotests/nbd-fault-injector.py\n@@ -56,7 +56,7 @@ NBD_CMD_READ = 0\n NBD_CMD_WRITE = 1\n NBD_CMD_DISC = 2\n NBD_REQUEST_MAGIC = 0x25609513\n-NBD_REPLY_MAGIC = 0x67446698\n+NBD_SIMPLE_REPLY_MAGIC = 0x67446698\n NBD_PASSWD = 0x4e42444d41474943\n NBD_OPTS_MAGIC = 0x49484156454F5054\n NBD_CLIENT_MAGIC = 0x0000420281861253\n@@ -166,7 +166,7 @@ def read_request(conn):\n     return req\n \n def write_reply(conn, error, handle):\n-    buf = reply_struct.pack(NBD_REPLY_MAGIC, error, handle)\n+    buf = reply_struct.pack(NBD_SIMPLE_REPLY_MAGIC, error, handle)\n     conn.send(buf, event='reply')\n \n def handle_connection(conn, use_export):\n","prefixes":["3/8"]}