[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v5 3/9] nbd: Expose and debug more NBD constants
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v5 3/9] nbd: Expose and debug more NBD constants |
Date: |
Fri, 7 Jul 2017 15:51:14 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 |
On 07/07/2017 03:30 PM, Eric Blake wrote:
> The NBD protocol has several constants defined in various extensions
> that we are about to implement. Expose them to the code, along with
> an easy way to map various constants to strings during diagnostic
> messages.
>
> Signed-off-by: Eric Blake <address@hidden>
>
> ---
> v5: rebase to master, add command name lookup; enough changes that
> R-b is dropped
> v4: new patch
Worth squashing this in:
diff --git i/nbd/client.c w/nbd/client.c
index af2b46d..8dd2d69 100644
--- i/nbd/client.c
+++ w/nbd/client.c
@@ -902,7 +902,8 @@ ssize_t nbd_send_request(QIOChannel *ioc, NBDRequest
*request)
uint8_t buf[NBD_REQUEST_SIZE];
trace_nbd_send_request(request->from, request->len, request->handle,
- request->flags, request->type);
+ request->flags, request->type,
+ nbd_cmd_lookup(request->type));
stl_be_p(buf, NBD_REQUEST_MAGIC);
stw_be_p(buf + 4, request->flags);
diff --git i/nbd/trace-events w/nbd/trace-events
index b18d051..74ed3b8 100644
--- i/nbd/trace-events
+++ w/nbd/trace-events
@@ -28,7 +28,7 @@ nbd_client_loop(void) "Doing NBD loop"
nbd_client_loop_ret(int ret, const char *error) "NBD loop returned %d: %s"
nbd_client_clear_queue(void) "Clearing NBD queue"
nbd_client_clear_socket(void) "Clearing NBD socket"
-nbd_send_request(uint64_t from, uint32_t len, uint64_t handle, uint16_t
flags, uint16_t type) "Sending request to server: { .from = %" PRIu64",
.len = %" PRIu32 ", .handle = %" PRIu64 ", .flags = %" PRIx16 ", .type =
%" PRIu16 " }"
+nbd_send_request(uint64_t from, uint32_t len, uint64_t handle, uint16_t
flags, uint16_t type, const char *name) "Sending request to server: {
.from = %" PRIu64", .len = %" PRIu32 ", .handle = %" PRIu64 ", .flags =
%" PRIx16 ", .type = %" PRIu16 " (%s) }"
nbd_receive_reply(uint32_t magic, int32_t error, uint64_t handle) "Got
reply: { magic = 0x%" PRIx32 ", .error = % " PRId32 ", handle = %"
PRIu64" }"
# nbd/server.c
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH v5 1/9] nbd: Create struct for tracking export info, (continued)
[Qemu-devel] [PATCH v5 4/9] nbd: Simplify trace of client flags in negotiation, Eric Blake, 2017/07/07
[Qemu-devel] [PATCH v5 5/9] nbd: Refactor reply to NBD_OPT_EXPORT_NAME, Eric Blake, 2017/07/07
[Qemu-devel] [PATCH v5 3/9] nbd: Expose and debug more NBD constants, Eric Blake, 2017/07/07
[Qemu-devel] [PATCH v5 8/9] nbd: Implement NBD_INFO_BLOCK_SIZE on server, Eric Blake, 2017/07/07
[Qemu-devel] [PATCH v5 7/9] nbd: Implement NBD_OPT_GO on client, Eric Blake, 2017/07/07
Re: [Qemu-devel] [PATCH v5 7/9] nbd: Implement NBD_OPT_GO on client, Vladimir Sementsov-Ogievskiy, 2017/07/19
[Qemu-devel] [PATCH v5 6/9] nbd: Implement NBD_OPT_GO on server, Eric Blake, 2017/07/07