get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/816834/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 816834,
    "url": "http://patchwork.ozlabs.org/api/patches/816834/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20170921121528.23935-2-berrange@redhat.com/",
    "project": {
        "id": 14,
        "url": "http://patchwork.ozlabs.org/api/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": "<20170921121528.23935-2-berrange@redhat.com>",
    "list_archive_url": null,
    "date": "2017-09-21T12:15:27",
    "name": "[1/2] ui: add tracing of VNC operations related to QIOChannel",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "5ea9c0daa144dc45d097789c352d432498e9dd24",
    "submitter": {
        "id": 2694,
        "url": "http://patchwork.ozlabs.org/api/people/2694/?format=api",
        "name": "Daniel P. Berrangé",
        "email": "berrange@redhat.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20170921121528.23935-2-berrange@redhat.com/mbox/",
    "series": [
        {
            "id": 4367,
            "url": "http://patchwork.ozlabs.org/api/series/4367/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=4367",
            "date": "2017-09-21T12:15:26",
            "name": "Add more trace points to VNC code",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/4367/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/816834/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/816834/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-mx02.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com",
            "ext-mx02.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=berrange@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 3xybDr03MPz9s5L\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 21 Sep 2017 22:16:12 +1000 (AEST)",
            "from localhost ([::1]:53410 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 1dv0Oo-0006bQ-3A\n\tfor incoming@patchwork.ozlabs.org; Thu, 21 Sep 2017 08:16:10 -0400",
            "from eggs.gnu.org ([2001:4830:134:3::10]:41172)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1dv0OI-0006ZP-Fi\n\tfor qemu-devel@nongnu.org; Thu, 21 Sep 2017 08:15:43 -0400",
            "from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <berrange@redhat.com>) id 1dv0OG-0008BB-Cd\n\tfor qemu-devel@nongnu.org; Thu, 21 Sep 2017 08:15:38 -0400",
            "from mx1.redhat.com ([209.132.183.28]:46598)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <berrange@redhat.com>) id 1dv0OG-00089v-4i\n\tfor qemu-devel@nongnu.org; Thu, 21 Sep 2017 08:15:36 -0400",
            "from smtp.corp.redhat.com\n\t(int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14])\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 45817806B6\n\tfor <qemu-devel@nongnu.org>; Thu, 21 Sep 2017 12:15:35 +0000 (UTC)",
            "from t460.redhat.com (unknown [10.33.36.54])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 369715D97C;\n\tThu, 21 Sep 2017 12:15:34 +0000 (UTC)"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.3.2 mx1.redhat.com 45817806B6",
        "From": "\"Daniel P. Berrange\" <berrange@redhat.com>",
        "To": "qemu-devel@nongnu.org",
        "Date": "Thu, 21 Sep 2017 13:15:27 +0100",
        "Message-Id": "<20170921121528.23935-2-berrange@redhat.com>",
        "In-Reply-To": "<20170921121528.23935-1-berrange@redhat.com>",
        "References": "<20170921121528.23935-1-berrange@redhat.com>",
        "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.14",
        "X-Greylist": "Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.26]);\n\tThu, 21 Sep 2017 12:15:35 +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 1/2] ui: add tracing of VNC operations related\n\tto QIOChannel",
        "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": "Gerd Hoffmann <kraxel@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": "Trace anything which opens/closes/wraps a QIOChannel in the\nVNC server.\n\nSigned-off-by: Daniel P. Berrange <berrange@redhat.com>\n---\n ui/trace-events        |  6 ++++++\n ui/vnc-auth-vencrypt.c |  2 ++\n ui/vnc-ws.c            |  6 +++---\n ui/vnc.c               | 11 ++++++++---\n 4 files changed, 19 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/ui/trace-events b/ui/trace-events\nindex 34c2213700..e4c02e47f5 100644\n--- a/ui/trace-events\n+++ b/ui/trace-events\n@@ -29,6 +29,12 @@ vnc_key_event_ext(bool down, int sym, int keycode, const char *name) \"down %d, s\n vnc_key_event_map(bool down, int sym, int keycode, const char *name) \"down %d, sym 0x%x -> keycode 0x%x [%s]\"\n vnc_key_sync_numlock(bool on) \"%d\"\n vnc_key_sync_capslock(bool on) \"%d\"\n+vnc_client_eof(void *state, void *ioc) \"VNC client EOF state=%p ioc=%p\"\n+vnc_client_io_error(void *state, void *ioc, const char *msg) \"VNC client I/O error state=%p ioc=%p errmsg=%s\"\n+vnc_client_connect(void *state, void *ioc) \"VNC client connect state=%p ioc=%p\"\n+vnc_client_disconnect_start(void *state, void *ioc) \"VNC client disconnect start state=%p ioc=%p\"\n+vnc_client_disconnect_finish(void *state, void *ioc) \"VNC client disconnect finish state=%p ioc=%p\"\n+vnc_client_io_wrap(void *state, void *ioc, const char *type) \"VNC client I/O wrap state=%p ioc=%p type=%s\"\n \n # ui/input.c\n input_event_key_number(int conidx, int number, const char *qcode, bool down) \"con %d, key number 0x%x [%s], down %d\"\ndiff --git a/ui/vnc-auth-vencrypt.c b/ui/vnc-auth-vencrypt.c\nindex c3eece4fa7..2a3766aa64 100644\n--- a/ui/vnc-auth-vencrypt.c\n+++ b/ui/vnc-auth-vencrypt.c\n@@ -28,6 +28,7 @@\n #include \"vnc.h\"\n #include \"qapi/error.h\"\n #include \"qemu/main-loop.h\"\n+#include \"trace.h\"\n \n static void start_auth_vencrypt_subauth(VncState *vs)\n {\n@@ -124,6 +125,7 @@ static int protocol_client_vencrypt_auth(VncState *vs, uint8_t *data, size_t len\n         VNC_DEBUG(\"Start TLS VeNCrypt handshake process\\n\");\n         object_unref(OBJECT(vs->ioc));\n         vs->ioc = QIO_CHANNEL(tls);\n+        trace_vnc_client_io_wrap(vs, vs->ioc, \"tls\");\n         vs->tls = qio_channel_tls_get_session(tls);\n \n         qio_channel_tls_handshake(tls,\ndiff --git a/ui/vnc-ws.c b/ui/vnc-ws.c\nindex eaf309553c..6ccad22cef 100644\n--- a/ui/vnc-ws.c\n+++ b/ui/vnc-ws.c\n@@ -23,6 +23,7 @@\n #include \"vnc.h\"\n #include \"io/channel-websock.h\"\n #include \"qemu/bswap.h\"\n+#include \"trace.h\"\n \n static void vncws_tls_handshake_done(QIOTask *task,\n                                      gpointer user_data)\n@@ -53,7 +54,6 @@ gboolean vncws_tls_handshake_io(QIOChannel *ioc G_GNUC_UNUSED,\n     QIOChannelTLS *tls;\n     Error *err = NULL;\n \n-    VNC_DEBUG(\"TLS Websocket connection required\\n\");\n     if (vs->ioc_tag) {\n         g_source_remove(vs->ioc_tag);\n         vs->ioc_tag = 0;\n@@ -73,9 +73,9 @@ gboolean vncws_tls_handshake_io(QIOChannel *ioc G_GNUC_UNUSED,\n \n     qio_channel_set_name(QIO_CHANNEL(tls), \"vnc-ws-server-tls\");\n \n-    VNC_DEBUG(\"Start TLS WS handshake process\\n\");\n     object_unref(OBJECT(vs->ioc));\n     vs->ioc = QIO_CHANNEL(tls);\n+    trace_vnc_client_io_wrap(vs, vs->ioc, \"tls\");\n     vs->tls = qio_channel_tls_get_session(tls);\n \n     qio_channel_tls_handshake(tls,\n@@ -116,7 +116,6 @@ gboolean vncws_handshake_io(QIOChannel *ioc G_GNUC_UNUSED,\n     VncState *vs = opaque;\n     QIOChannelWebsock *wioc;\n \n-    VNC_DEBUG(\"Websocket negotiate starting\\n\");\n     if (vs->ioc_tag) {\n         g_source_remove(vs->ioc_tag);\n         vs->ioc_tag = 0;\n@@ -127,6 +126,7 @@ gboolean vncws_handshake_io(QIOChannel *ioc G_GNUC_UNUSED,\n \n     object_unref(OBJECT(vs->ioc));\n     vs->ioc = QIO_CHANNEL(wioc);\n+    trace_vnc_client_io_wrap(vs, vs->ioc, \"websock\");\n \n     qio_channel_websock_handshake(wioc,\n                                   vncws_handshake_done,\ndiff --git a/ui/vnc.c b/ui/vnc.c\nindex 62f7a3f30a..47dacc47b6 100644\n--- a/ui/vnc.c\n+++ b/ui/vnc.c\n@@ -1118,6 +1118,7 @@ static void vnc_disconnect_start(VncState *vs)\n     if (vs->disconnecting) {\n         return;\n     }\n+    trace_vnc_client_disconnect_start(vs, vs->ioc);\n     vnc_set_share_mode(vs, VNC_SHARE_MODE_DISCONNECTED);\n     if (vs->ioc_tag) {\n         g_source_remove(vs->ioc_tag);\n@@ -1131,6 +1132,8 @@ void vnc_disconnect_finish(VncState *vs)\n {\n     int i;\n \n+    trace_vnc_client_disconnect_finish(vs, vs->ioc);\n+\n     vnc_jobs_join(vs); /* Wait encoding jobs */\n \n     vnc_lock_output(vs);\n@@ -1184,11 +1187,12 @@ ssize_t vnc_client_io_error(VncState *vs, ssize_t ret, Error **errp)\n {\n     if (ret <= 0) {\n         if (ret == 0) {\n-            VNC_DEBUG(\"Closing down client sock: EOF\\n\");\n+            trace_vnc_client_eof(vs, vs->ioc);\n             vnc_disconnect_start(vs);\n         } else if (ret != QIO_CHANNEL_ERR_BLOCK) {\n-            VNC_DEBUG(\"Closing down client sock: ret %zd (%s)\\n\",\n-                      ret, errp ? error_get_pretty(*errp) : \"Unknown\");\n+            trace_vnc_client_io_error(vs, vs->ioc,\n+                                      errp ? error_get_pretty(*errp) :\n+                                      \"Unknown\");\n             vnc_disconnect_start(vs);\n         }\n \n@@ -2885,6 +2889,7 @@ static void vnc_connect(VncDisplay *vd, QIOChannelSocket *sioc,\n     bool first_client = QTAILQ_EMPTY(&vd->clients);\n     int i;\n \n+    trace_vnc_client_connect(vs, sioc);\n     vs->sioc = sioc;\n     object_ref(OBJECT(vs->sioc));\n     vs->ioc = QIO_CHANNEL(sioc);\n",
    "prefixes": [
        "1/2"
    ]
}