@@ -788,7 +788,7 @@ ssize_t nbd_receive_reply(QIOChannel *ioc, NBDReply *reply)
}
/* Reply
- [ 0 .. 3] magic (NBD_REPLY_MAGIC)
+ [ 0 .. 3] magic (NBD_SIMPLE_REPLY_MAGIC)
[ 4 .. 7] error (0 == no error)
[ 7 .. 15] handle
*/
@@ -808,7 +808,7 @@ ssize_t nbd_receive_reply(QIOChannel *ioc, NBDReply *reply)
", handle = %" PRIu64" }",
magic, reply->error, reply->handle);
- if (magic != NBD_REPLY_MAGIC) {
+ if (magic != NBD_SIMPLE_REPLY_MAGIC) {
LOG("invalid magic (got 0x%" PRIx32 ")", magic);
return -EINVAL;
}
@@ -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
@@ -750,11 +750,11 @@ static ssize_t nbd_send_reply(QIOChannel *ioc, NBDReply *reply)
reply->error, reply->handle);
/* Reply
- [ 0 .. 3] magic (NBD_REPLY_MAGIC)
+ [ 0 .. 3] magic (NBD_SIMPLE_REPLY_MAGIC)
[ 4 .. 7] error (0 == 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);
@@ -56,7 +56,7 @@ NBD_CMD_READ = 0
NBD_CMD_WRITE = 1
NBD_CMD_DISC = 2
NBD_REQUEST_MAGIC = 0x25609513
-NBD_REPLY_MAGIC = 0x67446698
+NBD_SIMPLE_REPLY_MAGIC = 0x67446698
NBD_PASSWD = 0x4e42444d41474943
NBD_OPTS_MAGIC = 0x49484156454F5054
NBD_CLIENT_MAGIC = 0x0000420281861253
@@ -166,7 +166,7 @@ def read_request(conn):
return req
def write_reply(conn, error, handle):
- buf = reply_struct.pack(NBD_REPLY_MAGIC, error, handle)
+ buf = reply_struct.pack(NBD_SIMPLE_REPLY_MAGIC, error, handle)
conn.send(buf, event='reply')
def handle_connection(conn, use_export):
To be consistent when NBD_STRUCTURED_REPLY_MAGIC will be introduced. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> --- 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(-)