Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/831190/?format=api
{ "id": 831190, "url": "http://patchwork.ozlabs.org/api/1.2/patches/831190/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20171027104037.8319-2-eblake@redhat.com/", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/1.2/projects/14/?format=api", "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": "<20171027104037.8319-2-eblake@redhat.com>", "list_archive_url": null, "date": "2017-10-27T10:40:26", "name": "[v6,01/12] nbd: Include error names in trace messages", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "682a90d9a7bb8fc9bf9b32587027a903c2f974c5", "submitter": { "id": 6591, "url": "http://patchwork.ozlabs.org/api/1.2/people/6591/?format=api", "name": "Eric Blake", "email": "eblake@redhat.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20171027104037.8319-2-eblake@redhat.com/mbox/", "series": [ { "id": 10552, "url": "http://patchwork.ozlabs.org/api/1.2/series/10552/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=10552", "date": "2017-10-27T10:40:27", "name": "nbd minimal structured read", "version": 6, "mbox": "http://patchwork.ozlabs.org/series/10552/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/831190/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/831190/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>)", "ext-mx09.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com", "ext-mx09.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=eblake@redhat.com" ], "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 3yNgWD1rZjz9t2d\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 27 Oct 2017 21:45:12 +1100 (AEDT)", "from localhost ([::1]:56558 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 1e828U-0004Rr-9Z\n\tfor incoming@patchwork.ozlabs.org; Fri, 27 Oct 2017 06:45:10 -0400", "from eggs.gnu.org ([2001:4830:134:3::10]:57142)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1e824H-000186-KW\n\tfor qemu-devel@nongnu.org; Fri, 27 Oct 2017 06:40:50 -0400", "from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1e824G-0005Uf-4k\n\tfor qemu-devel@nongnu.org; Fri, 27 Oct 2017 06:40:49 -0400", "from mx1.redhat.com ([209.132.183.28]:49696)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <eblake@redhat.com>)\n\tid 1e824C-0005RD-Oe; Fri, 27 Oct 2017 06:40:44 -0400", "from smtp.corp.redhat.com\n\t(int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id C4EE44E4C5;\n\tFri, 27 Oct 2017 10:40:43 +0000 (UTC)", "from red.redhat.com (ovpn-120-166.rdu2.redhat.com [10.10.120.166])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 86E795C549;\n\tFri, 27 Oct 2017 10:40:42 +0000 (UTC)" ], "DMARC-Filter": "OpenDMARC Filter v1.3.2 mx1.redhat.com C4EE44E4C5", "From": "Eric Blake <eblake@redhat.com>", "To": "qemu-devel@nongnu.org", "Date": "Fri, 27 Oct 2017 12:40:26 +0200", "Message-Id": "<20171027104037.8319-2-eblake@redhat.com>", "In-Reply-To": "<20171027104037.8319-1-eblake@redhat.com>", "References": "<20171027104037.8319-1-eblake@redhat.com>", "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.16", "X-Greylist": "Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.38]);\n\tFri, 27 Oct 2017 10:40:43 +0000 (UTC)", "X-detected-operating-system": "by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]", "X-Received-From": "209.132.183.28", "Subject": "[Qemu-devel] [PATCH v6 01/12] nbd: Include error names in trace\n\tmessages", "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": "pbonzini@redhat.com, vsementsov@virtuozzo.com, qemu-block@nongnu.org", "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": "NBD errors were originally sent over the wire based on Linux errno\nvalues; but not all the world is Linux, and not all platforms share\nthe same values. Since a number isn't very easy to decipher on all\nplatforms, update the trace messages to include the name of NBD\nerrors being sent/received over the wire. Tweak the trace messages\nto be at the point where we are using the NBD error, not the\ntranslation to the host errno values.\n\nSigned-off-by: Eric Blake <eblake@redhat.com>\nReviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>\n\n---\nv5: trivial whitespace tweak\n---\n nbd/nbd-internal.h | 1 +\n nbd/client.c | 3 ++-\n nbd/common.c | 23 +++++++++++++++++++++++\n nbd/server.c | 3 ++-\n nbd/trace-events | 4 ++--\n 5 files changed, 30 insertions(+), 4 deletions(-)", "diff": "diff --git a/nbd/nbd-internal.h b/nbd/nbd-internal.h\nindex 11a130d050..4bfe5be884 100644\n--- a/nbd/nbd-internal.h\n+++ b/nbd/nbd-internal.h\n@@ -126,6 +126,7 @@ const char *nbd_opt_lookup(uint32_t opt);\n const char *nbd_rep_lookup(uint32_t rep);\n const char *nbd_info_lookup(uint16_t info);\n const char *nbd_cmd_lookup(uint16_t info);\n+const char *nbd_err_lookup(int err);\n\n int nbd_drop(QIOChannel *ioc, size_t size, Error **errp);\n\ndiff --git a/nbd/client.c b/nbd/client.c\nindex cd5a2c80ac..59d7c9d49f 100644\n--- a/nbd/client.c\n+++ b/nbd/client.c\n@@ -940,6 +940,8 @@ int nbd_receive_reply(QIOChannel *ioc, NBDReply *reply, Error **errp)\n reply->error = ldl_be_p(buf + 4);\n reply->handle = ldq_be_p(buf + 8);\n\n+ trace_nbd_receive_reply(magic, reply->error, nbd_err_lookup(reply->error),\n+ reply->handle);\n reply->error = nbd_errno_to_system_errno(reply->error);\n\n if (reply->error == ESHUTDOWN) {\n@@ -947,7 +949,6 @@ int nbd_receive_reply(QIOChannel *ioc, NBDReply *reply, Error **errp)\n error_setg(errp, \"server shutting down\");\n return -EINVAL;\n }\n- trace_nbd_receive_reply(magic, reply->error, reply->handle);\n\n if (magic != NBD_SIMPLE_REPLY_MAGIC) {\n error_setg(errp, \"invalid magic (got 0x%\" PRIx32 \")\", magic);\ndiff --git a/nbd/common.c b/nbd/common.c\nindex 59a5316be9..7456021f7e 100644\n--- a/nbd/common.c\n+++ b/nbd/common.c\n@@ -148,3 +148,26 @@ const char *nbd_cmd_lookup(uint16_t cmd)\n return \"<unknown>\";\n }\n }\n+\n+\n+const char *nbd_err_lookup(int err)\n+{\n+ switch (err) {\n+ case NBD_SUCCESS:\n+ return \"success\";\n+ case NBD_EPERM:\n+ return \"EPERM\";\n+ case NBD_EIO:\n+ return \"EIO\";\n+ case NBD_ENOMEM:\n+ return \"ENOMEM\";\n+ case NBD_EINVAL:\n+ return \"EINVAL\";\n+ case NBD_ENOSPC:\n+ return \"ENOSPC\";\n+ case NBD_ESHUTDOWN:\n+ return \"ESHUTDOWN\";\n+ default:\n+ return \"<unknown>\";\n+ }\n+}\ndiff --git a/nbd/server.c b/nbd/server.c\nindex 3df3548d6d..459e00c553 100644\n--- a/nbd/server.c\n+++ b/nbd/server.c\n@@ -1227,7 +1227,8 @@ static int nbd_co_send_simple_reply(NBDClient *client,\n {.iov_base = data, .iov_len = len}\n };\n\n- trace_nbd_co_send_simple_reply(handle, nbd_err, len);\n+ trace_nbd_co_send_simple_reply(handle, nbd_err, nbd_err_lookup(nbd_err),\n+ len);\n set_be_simple_reply(&reply, nbd_err, handle);\n\n return nbd_co_send_iov(client, iov, len ? 2 : 1, errp);\ndiff --git a/nbd/trace-events b/nbd/trace-events\nindex e27614f050..920c8a0e5e 100644\n--- a/nbd/trace-events\n+++ b/nbd/trace-events\n@@ -29,7 +29,7 @@ nbd_client_loop_ret(int ret, const char *error) \"NBD loop returned %d: %s\"\n nbd_client_clear_queue(void) \"Clearing NBD queue\"\n nbd_client_clear_socket(void) \"Clearing NBD socket\"\n 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 = 0x%\" PRIx16 \", .type = %\" PRIu16 \" (%s) }\"\n-nbd_receive_reply(uint32_t magic, int32_t error, uint64_t handle) \"Got reply: { magic = 0x%\" PRIx32 \", .error = % \" PRId32 \", handle = %\" PRIu64\" }\"\n+nbd_receive_reply(uint32_t magic, int32_t error, const char *errname, uint64_t handle) \"Got reply: { magic = 0x%\" PRIx32 \", .error = %\" PRId32 \" (%s), handle = %\" PRIu64\" }\"\n\n # nbd/server.c\n nbd_negotiate_send_rep_len(uint32_t opt, const char *optname, uint32_t type, const char *typename, uint32_t len) \"Reply opt=0x%\" PRIx32 \" (%s), type=0x%\" PRIx32 \" (%s), len=%\" PRIu32\n@@ -53,7 +53,7 @@ nbd_negotiate_success(void) \"Negotiation succeeded\"\n nbd_receive_request(uint32_t magic, uint16_t flags, uint16_t type, uint64_t from, uint32_t len) \"Got request: { magic = 0x%\" PRIx32 \", .flags = 0x%\" PRIx16 \", .type = 0x%\" PRIx16 \", from = %\" PRIu64 \", len = %\" PRIu32 \" }\"\n nbd_blk_aio_attached(const char *name, void *ctx) \"Export %s: Attaching clients to AIO context %p\\n\"\n nbd_blk_aio_detach(const char *name, void *ctx) \"Export %s: Detaching clients from AIO context %p\\n\"\n-nbd_co_send_simple_reply(uint64_t handle, uint32_t error, int len) \"Send simple reply: handle = %\" PRIu64 \", error = %\" PRIu32 \", len = %d\"\n+nbd_co_send_simple_reply(uint64_t handle, uint32_t error, const char *errname, int len) \"Send simple reply: handle = %\" PRIu64 \", error = %\" PRIu32 \" (%s), len = %d\"\n nbd_co_receive_request_decode_type(uint64_t handle, uint16_t type, const char *name) \"Decoding type: handle = %\" PRIu64 \", type = %\" PRIu16 \" (%s)\"\n nbd_co_receive_request_payload_received(uint64_t handle, uint32_t len) \"Payload received: handle = %\" PRIu64 \", len = %\" PRIu32\n nbd_co_receive_request_cmd_write(uint32_t len) \"Reading %\" PRIu32 \" byte(s)\"\n", "prefixes": [ "v6", "01/12" ] }