Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.1/patches/2222122/?format=api
{ "id": 2222122, "url": "http://patchwork.ozlabs.org/api/1.1/patches/2222122/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260410-qemu-vnc-v2-62-231416f76dc3@redhat.com/", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/1.1/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": "" }, "msgid": "<20260410-qemu-vnc-v2-62-231416f76dc3@redhat.com>", "date": "2026-04-10T19:19:24", "name": "[v2,62/67] ui/vnc: replace VNC_DEBUG with trace-events", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "bf3a5204a1ddae067f832cfe4068df578964d1ed", "submitter": { "id": 66774, "url": "http://patchwork.ozlabs.org/api/1.1/people/66774/?format=api", "name": "Marc-André Lureau", "email": "marcandre.lureau@redhat.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260410-qemu-vnc-v2-62-231416f76dc3@redhat.com/mbox/", "series": [ { "id": 499494, "url": "http://patchwork.ozlabs.org/api/1.1/series/499494/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=499494", "date": "2026-04-10T19:18:23", "name": "ui: add standalone VNC server over D-Bus", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/499494/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2222122/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2222122/checks/", "tags": {}, "headers": { "Return-Path": "<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=D76cRPi/;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)" ], "Received": [ "from lists.gnu.org (lists1p.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fsmyx1n58z1yGb\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 11 Apr 2026 05:27:21 +1000 (AEST)", "from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1wBHTs-0007gC-Mi; Fri, 10 Apr 2026 15:25:28 -0400", "from eggs.gnu.org ([2001:470:142:3::10])\n by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <marcandre.lureau@redhat.com>)\n id 1wBHTf-0007TS-Un\n for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:25:17 -0400", "from us-smtp-delivery-124.mimecast.com ([170.10.129.124])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <marcandre.lureau@redhat.com>)\n id 1wBHTZ-00030R-KM\n for qemu-devel@nongnu.org; Fri, 10 Apr 2026 15:25:15 -0400", "from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com\n (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by\n relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n cipher=TLS_AES_256_GCM_SHA384) id us-mta-673-mmAlhwesMRWr3VTyoiz81A-1; Fri,\n 10 Apr 2026 15:25:07 -0400", "from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id 8D9911956054\n for <qemu-devel@nongnu.org>; Fri, 10 Apr 2026 19:25:06 +0000 (UTC)", "from localhost (unknown [10.44.22.4])\n by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP\n id 17D7419560AB; Fri, 10 Apr 2026 19:25:04 +0000 (UTC)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1775849108;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=F3YYGoYh+6KX4BI0Ot/SLLZ0EfYgab3RAz12Uxtp1v8=;\n b=D76cRPi/l9TkQI+rkDo1fLNGwEiNnp8tkxbqXYZQRg9iEr3FZ5MGtRtvJssyJicfdvTndm\n bJBTQ0ZXBadsbSKXkNMnt3RmeXaj6AhhLGb6sGETJHXr0dN/6elkkGJU+7HvC2/gQ5mgCM\n 093zI4Aq7ZTWdejZCP3YCQurLVBpIhU=", "X-MC-Unique": "mmAlhwesMRWr3VTyoiz81A-1", "X-Mimecast-MFC-AGG-ID": "mmAlhwesMRWr3VTyoiz81A_1775849106", "From": "=?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>", "Date": "Fri, 10 Apr 2026 23:19:24 +0400", "Subject": "[PATCH v2 62/67] ui/vnc: replace VNC_DEBUG with trace-events", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "8bit", "Message-Id": "<20260410-qemu-vnc-v2-62-231416f76dc3@redhat.com>", "References": "<20260410-qemu-vnc-v2-0-231416f76dc3@redhat.com>", "In-Reply-To": "<20260410-qemu-vnc-v2-0-231416f76dc3@redhat.com>", "To": "qemu-devel@nongnu.org", "Cc": "=?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>", "X-Developer-Signature": "v=1; a=openpgp-sha256; l=22270;\n i=marcandre.lureau@redhat.com; h=from:subject:message-id;\n bh=1Nsl0avG4c5z+Cz4TpuhxbkjUb+9QEOegkjJXmx4B/k=;\n b=owEBbQKS/ZANAwAKAdro4Ql1lpzlAcsmYgBp2U0XCijyepSr+56y9rEhHdbC+FwQ+Wy+pXYF1\n c17B9k55vSJAjMEAAEKAB0WIQSHqb2TP4fGBtJ29i3a6OEJdZac5QUCadlNFwAKCRDa6OEJdZac\n 5YE+D/oDRMuxTRWy2Ma1QiS1WM5vl4S6VuFKuQnHyxWxcvTgTL9RbAXumXxiCoiERRpTzpFG5VO\n N4vGsCguioJ2CLUqQ4WG67iKPevL7xN7OSnE40Ax//mjN8Otk1PgJgN4xoc839T5GHIcFuZY1zB\n Du14YWLrTXkJFUXj0xuSPnwgTIMb2Q8ZVpVy6NkRJYscNhRl7XdKLnl+TpHFAZYjg8GLPRe1zcn\n ei+d+b09kspTsApYVSzCnBM72dTg8zPPLlX9TJGUkcSqfsSnBWL6tD9r2c5ylCexVdbTfuH9w82\n Df8k8cvRdGZqc1saM4ZUR22WPoI85DOcpMA04kSr6SFwsmpvzWqDrDaKa/cVQ3qFCdVgUMxQbkv\n 979W7vBwPY6CzUVCvoubNsDl7yVbtmKZnlJEMldJ9iFi1oET+Y59rV9m/qP0GefQ4jF+t6WVS03\n 8ceb3V4Be0ALT0svQghmLrYtpbPPP+MdTlaYPMhdUezKRjStV1EYU5ctHT8PgWh+UU/0JqkgaDs\n l5zlmn6PnY2gNsCEvfCBbMnM2dMyO8rAF1ZeG2+iPNxLYZNNnEw0ycmfNZ15iuO6CqSDhE+Xg8e\n dMT1IvD4NQboSKxI+CYmZaG3utMUbHjPVvcBr3qSIdzC9IW4pSFssaHKw9R2E2CyyywR1qoBQad\n fOSUz32qraEdiYw==", "X-Developer-Key": "i=marcandre.lureau@redhat.com; a=openpgp;\n fpr=87A9BD933F87C606D276F62DDAE8E10975969CE5", "X-Scanned-By": "MIMEDefang 3.0 on 10.30.177.12", "Received-SPF": "pass client-ip=170.10.129.124;\n envelope-from=marcandre.lureau@redhat.com;\n helo=us-smtp-delivery-124.mimecast.com", "X-Spam_score_int": "7", "X-Spam_score": "0.7", "X-Spam_bar": "/", "X-Spam_report": "(0.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.54,\n DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001,\n RCVD_IN_SBL_CSS=3.335, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001,\n RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001,\n SPF_PASS=-0.001 autolearn=no autolearn_force=no", "X-Spam_action": "no action", "X-BeenThere": "qemu-devel@nongnu.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "qemu development <qemu-devel.nongnu.org>", "List-Unsubscribe": "<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>", "List-Archive": "<https://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 <mailto:qemu-devel-request@nongnu.org?subject=subscribe>", "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org", "Sender": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org" }, "content": "Replace #ifdef printf() with run-time trace events.\n\nSigned-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>\n---\n ui/vnc.h | 8 ------\n ui/vnc-auth-sasl.c | 13 ++++-----\n ui/vnc-enc-tight.c | 4 +--\n ui/vnc-enc-zlib.c | 4 +--\n ui/vnc-ws.c | 10 +++----\n ui/vnc.c | 83 ++++++++++++++++++++----------------------------------\n ui/trace-events | 29 ++++++++++++++++++-\n 7 files changed, 73 insertions(+), 78 deletions(-)", "diff": "diff --git a/ui/vnc.h b/ui/vnc.h\nindex 7341fb0f25c..0324e5a98bc 100644\n--- a/ui/vnc.h\n+++ b/ui/vnc.h\n@@ -46,14 +46,6 @@\n #include \"vnc-enc-zrle.h\"\n #include \"ui/kbd-state.h\"\n \n-// #define _VNC_DEBUG 1\n-\n-#ifdef _VNC_DEBUG\n-#define VNC_DEBUG(fmt, ...) do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0)\n-#else\n-#define VNC_DEBUG(fmt, ...) do { } while (0)\n-#endif\n-\n /*****************************************************************************\n *\n * Core data structures\ndiff --git a/ui/vnc-auth-sasl.c b/ui/vnc-auth-sasl.c\nindex 3f4cfc471d5..9964b969ac2 100644\n--- a/ui/vnc-auth-sasl.c\n+++ b/ui/vnc-auth-sasl.c\n@@ -73,10 +73,10 @@ size_t vnc_client_write_sasl(VncState *vs)\n {\n size_t ret;\n \n- VNC_DEBUG(\"Write SASL: Pending output %p size %zd offset %zd \"\n- \"Encoded: %p size %d offset %d\\n\",\n- vs->output.buffer, vs->output.capacity, vs->output.offset,\n- vs->sasl.encoded, vs->sasl.encodedLength, vs->sasl.encodedOffset);\n+ trace_vnc_sasl_write_pending(vs, vs->output.buffer, vs->output.capacity,\n+ vs->output.offset, vs->sasl.encoded,\n+ vs->sasl.encodedLength,\n+ vs->sasl.encodedOffset);\n \n if (!vs->sasl.encoded) {\n int err;\n@@ -157,8 +157,7 @@ size_t vnc_client_read_sasl(VncState *vs)\n \n if (err != SASL_OK)\n return vnc_client_io_error(vs, -1, NULL);\n- VNC_DEBUG(\"Read SASL Encoded %p size %ld Decoded %p size %d\\n\",\n- encoded, ret, decoded, decodedLen);\n+ trace_vnc_sasl_read_decoded(vs, encoded, ret, decoded, decodedLen);\n buffer_reserve(&vs->input, decodedLen);\n buffer_append(&vs->input, decoded, decodedLen);\n return decodedLen;\n@@ -717,5 +716,3 @@ void start_auth_sasl(VncState *vs)\n error_free(local_err);\n vnc_client_error(vs);\n }\n-\n-\ndiff --git a/ui/vnc-enc-tight.c b/ui/vnc-enc-tight.c\nindex 9dfe6ae5a24..ca671427018 100644\n--- a/ui/vnc-enc-tight.c\n+++ b/ui/vnc-enc-tight.c\n@@ -46,6 +46,7 @@\n #include \"vnc.h\"\n #include \"vnc-enc-tight.h\"\n #include \"vnc-palette.h\"\n+#include \"trace.h\"\n \n /* Compression level stuff. The following array contains various\n encoder parameters for each of 10 compression levels (0..9).\n@@ -795,8 +796,7 @@ static int tight_init_stream(VncState *vs, VncTight *tight, int stream_id,\n if (zstream->opaque == NULL) {\n int err;\n \n- VNC_DEBUG(\"VNC: TIGHT: initializing zlib stream %d\\n\", stream_id);\n- VNC_DEBUG(\"VNC: TIGHT: opaque = %p | vs = %p\\n\", zstream->opaque, vs);\n+ trace_vnc_tight_zlib_init(vs, stream_id, zstream->opaque);\n zstream->zalloc = vnc_zlib_zalloc;\n zstream->zfree = vnc_zlib_zfree;\n \ndiff --git a/ui/vnc-enc-zlib.c b/ui/vnc-enc-zlib.c\nindex a6d287118aa..657b47ceb2b 100644\n--- a/ui/vnc-enc-zlib.c\n+++ b/ui/vnc-enc-zlib.c\n@@ -26,6 +26,7 @@\n \n #include \"qemu/osdep.h\"\n #include \"vnc.h\"\n+#include \"trace.h\"\n \n #define ZALLOC_ALIGNMENT 16\n \n@@ -71,8 +72,7 @@ static int vnc_zlib_stop(VncState *vs, VncWorker *worker)\n if (zstream->opaque != vs) {\n int err;\n \n- VNC_DEBUG(\"VNC: initializing zlib stream\\n\");\n- VNC_DEBUG(\"VNC: opaque = %p | vs = %p\\n\", zstream->opaque, vs);\n+ trace_vnc_zlib_init(vs, zstream->opaque);\n zstream->zalloc = vnc_zlib_zalloc;\n zstream->zfree = vnc_zlib_zfree;\n \ndiff --git a/ui/vnc-ws.c b/ui/vnc-ws.c\nindex 9e3503d93d8..b7d4de41431 100644\n--- a/ui/vnc-ws.c\n+++ b/ui/vnc-ws.c\n@@ -32,11 +32,11 @@ static void vncws_tls_handshake_done(QIOTask *task,\n Error *err = NULL;\n \n if (qio_task_propagate_error(task, &err)) {\n- VNC_DEBUG(\"Handshake failed %s\\n\", error_get_pretty(err));\n+ trace_vnc_ws_tls_handshake_fail(vs, error_get_pretty(err));\n vnc_client_error(vs);\n error_free(err);\n } else {\n- VNC_DEBUG(\"TLS handshake complete, starting websocket handshake\\n\");\n+ trace_vnc_ws_tls_handshake_complete(vs);\n if (vs->ioc_tag) {\n g_source_remove(vs->ioc_tag);\n }\n@@ -71,7 +71,7 @@ gboolean vncws_tls_handshake_io(QIOChannel *ioc G_GNUC_UNUSED,\n vs->vd->tlsauthzid,\n &err);\n if (!tls) {\n- VNC_DEBUG(\"Failed to setup TLS %s\\n\", error_get_pretty(err));\n+ trace_vnc_ws_tls_setup_fail(vs, error_get_pretty(err));\n error_free(err);\n vnc_client_error(vs);\n return TRUE;\n@@ -101,11 +101,11 @@ static void vncws_handshake_done(QIOTask *task,\n Error *err = NULL;\n \n if (qio_task_propagate_error(task, &err)) {\n- VNC_DEBUG(\"Websock handshake failed %s\\n\", error_get_pretty(err));\n+ trace_vnc_ws_handshake_fail(vs, error_get_pretty(err));\n vnc_client_error(vs);\n error_free(err);\n } else {\n- VNC_DEBUG(\"Websock handshake complete, starting VNC protocol\\n\");\n+ trace_vnc_ws_handshake_complete(vs);\n vnc_start_protocol(vs);\n if (vs->ioc_tag) {\n g_source_remove(vs->ioc_tag);\ndiff --git a/ui/vnc.c b/ui/vnc.c\nindex e1fba53ee57..12a2b10b418 100644\n--- a/ui/vnc.c\n+++ b/ui/vnc.c\n@@ -75,17 +75,7 @@ static void vnc_disconnect_finish(VncState *vs);\n \n static void vnc_set_share_mode(VncState *vs, VncShareMode mode)\n {\n-#ifdef _VNC_DEBUG\n- static const char *mn[] = {\n- [0] = \"undefined\",\n- [VNC_SHARE_MODE_CONNECTING] = \"connecting\",\n- [VNC_SHARE_MODE_SHARED] = \"shared\",\n- [VNC_SHARE_MODE_EXCLUSIVE] = \"exclusive\",\n- [VNC_SHARE_MODE_DISCONNECTED] = \"disconnected\",\n- };\n- fprintf(stderr, \"%s/%p: %s -> %s\\n\", __func__,\n- vs->ioc, mn[vs->share_mode], mn[mode]);\n-#endif\n+ trace_vnc_set_share_mode(vs, vs->ioc, vs->share_mode, mode);\n \n switch (vs->share_mode) {\n case VNC_SHARE_MODE_CONNECTING:\n@@ -185,8 +175,9 @@ static void vnc_init_basic_info_from_remote_addr(QIOChannelSocket *ioc,\n qapi_free_SocketAddress(addr);\n }\n \n-static const char *vnc_auth_name(VncDisplay *vd) {\n- switch (vd->auth) {\n+static const char *vnc_auth_name(int auth, int subauth)\n+{\n+ switch (auth) {\n case VNC_AUTH_INVALID:\n return \"invalid\";\n case VNC_AUTH_NONE:\n@@ -204,7 +195,7 @@ static const char *vnc_auth_name(VncDisplay *vd) {\n case VNC_AUTH_TLS:\n return \"tls\";\n case VNC_AUTH_VENCRYPT:\n- switch (vd->subauth) {\n+ switch (subauth) {\n case VNC_AUTH_VENCRYPT_PLAIN:\n return \"vencrypt+plain\";\n case VNC_AUTH_VENCRYPT_TLSNONE:\n@@ -244,7 +235,7 @@ static VncServerInfo *vnc_server_info_get(VncDisplay *vd)\n info = g_malloc0(sizeof(*info));\n vnc_init_basic_info_from_server_addr(qio_net_listener_sioc(vd->listener, 0),\n qapi_VncServerInfo_base(info), &err);\n- info->auth = g_strdup(vnc_auth_name(vd));\n+ info->auth = g_strdup(vnc_auth_name(vd->auth, vd->subauth));\n if (err) {\n qapi_free_VncServerInfo(info);\n info = NULL;\n@@ -421,7 +412,7 @@ VncInfo *qmp_query_vnc(Error **errp)\n \n info->has_family = true;\n \n- info->auth = g_strdup(vnc_auth_name(vd));\n+ info->auth = g_strdup(vnc_auth_name(vd->auth, vd->subauth));\n }\n \n qapi_free_SocketAddress(addr);\n@@ -1382,7 +1373,7 @@ size_t vnc_client_io_error(VncState *vs, ssize_t ret, Error *err)\n \n void vnc_client_error(VncState *vs)\n {\n- VNC_DEBUG(\"Closing down client sock: protocol error\\n\");\n+ trace_vnc_client_protocol_error(vs);\n vnc_disconnect_start(vs);\n }\n \n@@ -1407,7 +1398,7 @@ size_t vnc_client_write_buf(VncState *vs, const uint8_t *data, size_t datalen)\n Error *err = NULL;\n ssize_t ret;\n ret = qio_channel_write(vs->ioc, (const char *)data, datalen, &err);\n- VNC_DEBUG(\"Wrote wire %p %zd -> %ld\\n\", data, datalen, ret);\n+ trace_vnc_client_write_wire(vs, data, datalen, ret);\n return vnc_client_io_error(vs, ret, err);\n }\n \n@@ -1428,9 +1419,9 @@ static size_t vnc_client_write_plain(VncState *vs)\n size_t ret;\n \n #ifdef CONFIG_VNC_SASL\n- VNC_DEBUG(\"Write Plain: Pending output %p size %zd offset %zd. Wait SSF %d\\n\",\n- vs->output.buffer, vs->output.capacity, vs->output.offset,\n- vs->sasl.waitWriteSSF);\n+ trace_vnc_client_write_plain(vs, vs->output.buffer,\n+ vs->output.capacity, vs->output.offset,\n+ vs->sasl.waitWriteSSF);\n \n if (vs->sasl.conn &&\n vs->sasl.runSSF &&\n@@ -1531,7 +1522,7 @@ size_t vnc_client_read_buf(VncState *vs, uint8_t *data, size_t datalen)\n ssize_t ret;\n Error *err = NULL;\n ret = qio_channel_read(vs->ioc, (char *)data, datalen, &err);\n- VNC_DEBUG(\"Read wire %p %zd -> %ld\\n\", data, datalen, ret);\n+ trace_vnc_client_read_wire(vs, data, datalen, ret);\n return vnc_client_io_error(vs, ret, err);\n }\n \n@@ -1548,8 +1539,8 @@ size_t vnc_client_read_buf(VncState *vs, uint8_t *data, size_t datalen)\n static size_t vnc_client_read_plain(VncState *vs)\n {\n size_t ret;\n- VNC_DEBUG(\"Read plain %p size %zd offset %zd\\n\",\n- vs->input.buffer, vs->input.capacity, vs->input.offset);\n+ trace_vnc_client_read_plain(vs, vs->input.buffer,\n+ vs->input.capacity, vs->input.offset);\n buffer_reserve(&vs->input, 4096);\n ret = vnc_client_read_buf(vs, buffer_end(&vs->input), 4096);\n if (!ret)\n@@ -2212,7 +2203,7 @@ static void set_encodings(VncState *vs, int32_t *encodings, size_t n_encodings)\n }\n break;\n default:\n- VNC_DEBUG(\"Unknown encoding: %d (0x%.8x): %d\\n\", i, enc, enc);\n+ trace_vnc_client_unknown_encoding(vs, i, enc);\n break;\n }\n }\n@@ -2580,14 +2571,13 @@ static int protocol_client_msg(VncState *vs, uint8_t *data, size_t len)\n case 4: vs->as.fmt = AUDIO_FORMAT_U32; break;\n case 5: vs->as.fmt = AUDIO_FORMAT_S32; break;\n default:\n- VNC_DEBUG(\"Invalid audio format %d\\n\", read_u8(data, 4));\n+ trace_vnc_client_invalid_audio_format(vs, read_u8(data, 4));\n vnc_client_error(vs);\n break;\n }\n vs->as.nchannels = read_u8(data, 5);\n if (vs->as.nchannels != 1 && vs->as.nchannels != 2) {\n- VNC_DEBUG(\"Invalid audio channel count %d\\n\",\n- read_u8(data, 5));\n+ trace_vnc_client_invalid_audio_channels(vs, read_u8(data, 5));\n vnc_client_error(vs);\n break;\n }\n@@ -2597,7 +2587,7 @@ static int protocol_client_msg(VncState *vs, uint8_t *data, size_t len)\n * protects calculations involving 'vs->as.freq' later.\n */\n if (freq > 48000) {\n- VNC_DEBUG(\"Invalid audio frequency %u > 48000\", freq);\n+ trace_vnc_client_invalid_audio_freq(vs, freq);\n vnc_client_error(vs);\n break;\n }\n@@ -2606,14 +2596,14 @@ static int protocol_client_msg(VncState *vs, uint8_t *data, size_t len)\n vs, vs->ioc, vs->as.fmt, vs->as.nchannels, vs->as.freq);\n break;\n default:\n- VNC_DEBUG(\"Invalid audio message %d\\n\", read_u8(data, 2));\n+ trace_vnc_client_invalid_audio_msg(vs, read_u8(data, 2));\n vnc_client_error(vs);\n break;\n }\n break;\n \n default:\n- VNC_DEBUG(\"Msg: %d\\n\", read_u16(data, 0));\n+ trace_vnc_client_unknown_qemu_msg(vs, read_u16(data, 0));\n vnc_client_error(vs);\n break;\n }\n@@ -2648,7 +2638,7 @@ static int protocol_client_msg(VncState *vs, uint8_t *data, size_t len)\n break;\n }\n default:\n- VNC_DEBUG(\"Msg: %d\\n\", data[0]);\n+ trace_vnc_client_unknown_msg(vs, data[0]);\n vnc_client_error(vs);\n break;\n }\n@@ -2928,18 +2918,18 @@ static int protocol_version(VncState *vs, uint8_t *version, size_t len)\n local[12] = 0;\n \n if (sscanf(local, \"RFB %03d.%03d\\n\", &vs->major, &vs->minor) != 2) {\n- VNC_DEBUG(\"Malformed protocol version %s\\n\", local);\n+ trace_vnc_client_protocol_version_malformed(vs, local);\n vnc_client_error(vs);\n return 0;\n }\n- VNC_DEBUG(\"Client request protocol version %d.%d\\n\", vs->major, vs->minor);\n+ trace_vnc_client_protocol_version(vs, vs->major, vs->minor);\n if (vs->major != 3 ||\n (vs->minor != 3 &&\n vs->minor != 4 &&\n vs->minor != 5 &&\n vs->minor != 7 &&\n vs->minor != 8)) {\n- VNC_DEBUG(\"Unsupported client version\\n\");\n+ trace_vnc_client_protocol_version_unsupported(vs);\n vnc_write_u32(vs, VNC_AUTH_INVALID);\n vnc_flush(vs);\n vnc_client_error(vs);\n@@ -2959,7 +2949,7 @@ static int protocol_version(VncState *vs, uint8_t *version, size_t len)\n trace_vnc_auth_pass(vs, vs->auth);\n start_client_init(vs);\n } else if (vs->auth == VNC_AUTH_VNC) {\n- VNC_DEBUG(\"Tell client VNC auth\\n\");\n+ trace_vnc_client_auth_method(vs, vs->auth);\n vnc_write_u32(vs, vs->auth);\n vnc_flush(vs);\n start_auth_vnc(vs);\n@@ -3318,10 +3308,7 @@ static void vnc_connect(VncDisplay *vd, QIOChannelSocket *sioc,\n vs->subauth = vd->subauth;\n }\n }\n- VNC_DEBUG(\"Client sioc=%p ws=%d auth=%d subauth=%d\\n\",\n- sioc, websocket, vs->auth, vs->subauth);\n-\n- VNC_DEBUG(\"New client on socket %p\\n\", vs->sioc);\n+ trace_vnc_client_setup(vs, sioc, websocket, vs->auth, vs->subauth);\n qemu_console_listener_set_refresh(&vd->dcl, VNC_REFRESH_INTERVAL_BASE);\n qio_channel_set_blocking(vs->ioc, false, &error_abort);\n g_clear_handle_id(&vs->ioc_tag, g_source_remove);\n@@ -3722,13 +3709,10 @@ vnc_display_setup_auth(int *auth,\n */\n if (websocket || !tlscreds) {\n if (password) {\n- VNC_DEBUG(\"Initializing VNC server with password auth\\n\");\n *auth = VNC_AUTH_VNC;\n } else if (sasl) {\n- VNC_DEBUG(\"Initializing VNC server with SASL auth\\n\");\n *auth = VNC_AUTH_SASL;\n } else {\n- VNC_DEBUG(\"Initializing VNC server with no auth\\n\");\n *auth = VNC_AUTH_NONE;\n }\n *subauth = VNC_AUTH_INVALID;\n@@ -3747,27 +3731,20 @@ vnc_display_setup_auth(int *auth,\n *auth = VNC_AUTH_VENCRYPT;\n if (password) {\n if (is_x509) {\n- VNC_DEBUG(\"Initializing VNC server with x509 password auth\\n\");\n *subauth = VNC_AUTH_VENCRYPT_X509VNC;\n } else {\n- VNC_DEBUG(\"Initializing VNC server with TLS password auth\\n\");\n *subauth = VNC_AUTH_VENCRYPT_TLSVNC;\n }\n-\n } else if (sasl) {\n if (is_x509) {\n- VNC_DEBUG(\"Initializing VNC server with x509 SASL auth\\n\");\n *subauth = VNC_AUTH_VENCRYPT_X509SASL;\n } else {\n- VNC_DEBUG(\"Initializing VNC server with TLS SASL auth\\n\");\n *subauth = VNC_AUTH_VENCRYPT_TLSSASL;\n }\n } else {\n if (is_x509) {\n- VNC_DEBUG(\"Initializing VNC server with x509 no auth\\n\");\n *subauth = VNC_AUTH_VENCRYPT_X509NONE;\n } else {\n- VNC_DEBUG(\"Initializing VNC server with TLS no auth\\n\");\n *subauth = VNC_AUTH_VENCRYPT_TLSNONE;\n }\n }\n@@ -4216,14 +4193,16 @@ static bool vnc_display_open(VncDisplay *vd, Error **errp)\n sasl, false, errp) < 0) {\n return false;\n }\n- trace_vnc_auth_init(vd, 0, vd->auth, vd->subauth);\n+ trace_vnc_auth_init(vd, 0, vd->auth, vd->subauth,\n+ vnc_auth_name(vd->auth, vd->subauth));\n \n if (vnc_display_setup_auth(&vd->ws_auth, &vd->ws_subauth,\n vd->tlscreds, password,\n sasl, true, errp) < 0) {\n return false;\n }\n- trace_vnc_auth_init(vd, 1, vd->ws_auth, vd->ws_subauth);\n+ trace_vnc_auth_init(vd, 1, vd->ws_auth, vd->ws_subauth,\n+ vnc_auth_name(vd->ws_auth, vd->ws_subauth));\n \n #ifdef CONFIG_VNC_SASL\n if (sasl && !vnc_sasl_server_init(errp)) {\ndiff --git a/ui/trace-events b/ui/trace-events\nindex 3eba9ca3a82..c1ea56874ee 100644\n--- a/ui/trace-events\n+++ b/ui/trace-events\n@@ -83,7 +83,7 @@ vnc_job_discard_rect(void *state, void *job, int x, int y, int w, int h) \"VNC jo\n vnc_job_clamp_rect(void *state, void *job, int x, int y, int w, int h) \"VNC job clamp rect state=%p job=%p offset=%d,%d size=%dx%d\"\n vnc_job_clamped_rect(void *state, void *job, int x, int y, int w, int h) \"VNC job clamp rect state=%p job=%p offset=%d,%d size=%dx%d\"\n vnc_job_nrects(void *state, void *job, int nrects) \"VNC job state=%p job=%p nrects=%d\"\n-vnc_auth_init(void *display, int websock, int auth, int subauth) \"VNC auth init state=%p websock=%d auth=%d subauth=%d\"\n+vnc_auth_init(void *display, int websock, int auth, int subauth, const char *name) \"VNC auth init state=%p websock=%d auth=%d subauth=%d name=%s\"\n vnc_auth_start(void *state, int method) \"VNC client auth start state=%p method=%d\"\n vnc_auth_pass(void *state, int method) \"VNC client auth passed state=%p method=%d\"\n vnc_auth_fail(void *state, int method, const char *message, const char *reason) \"VNC client auth failed state=%p method=%d message=%s reason=%s\"\n@@ -97,6 +97,33 @@ vnc_auth_sasl_step(void *state, const void *clientdata, size_t clientlen, const\n vnc_auth_sasl_ssf(void *state, int ssf) \"VNC client auth SASL SSF state=%p size=%d\"\n vnc_auth_sasl_username(void *state, const char *name) \"VNC client auth SASL user state=%p name=%s\"\n vnc_auth_sasl_acl(void *state, int allow) \"VNC client auth SASL ACL state=%p allow=%d\"\n+vnc_set_share_mode(void *state, void *ioc, int old_mode, int new_mode) \"VNC set share mode state=%p ioc=%p old=%d new=%d\"\n+vnc_client_protocol_error(void *state) \"VNC client protocol error state=%p\"\n+vnc_client_write_wire(void *state, const void *data, size_t datalen, ssize_t ret) \"VNC client write wire state=%p data=%p len=%zu ret=%zd\"\n+vnc_client_write_plain(void *state, const void *buffer, size_t capacity, size_t offset, int wait_ssf) \"VNC client write plain state=%p buffer=%p capacity=%zu offset=%zu wait_ssf=%d\"\n+vnc_client_read_wire(void *state, const void *data, size_t datalen, ssize_t ret) \"VNC client read wire state=%p data=%p len=%zu ret=%zd\"\n+vnc_client_read_plain(void *state, const void *buffer, size_t capacity, size_t offset) \"VNC client read plain state=%p buffer=%p capacity=%zu offset=%zu\"\n+vnc_client_unknown_encoding(void *state, int index, int encoding) \"VNC client unknown encoding state=%p index=%d encoding=0x%x\"\n+vnc_client_invalid_audio_format(void *state, int fmt) \"VNC client invalid audio format state=%p fmt=%d\"\n+vnc_client_invalid_audio_channels(void *state, int channels) \"VNC client invalid audio channel count state=%p channels=%d\"\n+vnc_client_invalid_audio_freq(void *state, unsigned int freq) \"VNC client invalid audio frequency state=%p freq=%u\"\n+vnc_client_invalid_audio_msg(void *state, int msg) \"VNC client invalid audio message state=%p msg=%d\"\n+vnc_client_unknown_qemu_msg(void *state, int msg) \"VNC client unknown QEMU msg state=%p msg=%d\"\n+vnc_client_unknown_msg(void *state, int msg) \"VNC client unknown msg state=%p msg=%d\"\n+vnc_client_protocol_version(void *state, int major, int minor) \"VNC client protocol version state=%p version=%d.%d\"\n+vnc_client_protocol_version_malformed(void *state, const char *version) \"VNC client malformed protocol version state=%p version=%s\"\n+vnc_client_protocol_version_unsupported(void *state) \"VNC client unsupported protocol version state=%p\"\n+vnc_client_auth_method(void *state, int auth) \"VNC client auth method state=%p auth=%d\"\n+vnc_client_setup(void *state, void *ioc, int websocket, int auth, int subauth) \"VNC client setup state=%p ioc=%p websocket=%d auth=%d subauth=%d\"\n+vnc_ws_tls_handshake_fail(void *state, const char *msg) \"VNC WS TLS handshake failed state=%p msg=%s\"\n+vnc_ws_tls_handshake_complete(void *state) \"VNC WS TLS handshake complete state=%p\"\n+vnc_ws_tls_setup_fail(void *state, const char *msg) \"VNC WS TLS setup failed state=%p msg=%s\"\n+vnc_ws_handshake_fail(void *state, const char *msg) \"VNC WS handshake failed state=%p msg=%s\"\n+vnc_ws_handshake_complete(void *state) \"VNC WS handshake complete state=%p\"\n+vnc_sasl_write_pending(void *state, const void *buffer, size_t capacity, size_t offset, const void *encoded, int encoded_len, int encoded_offset) \"VNC SASL write pending state=%p buffer=%p capacity=%zu offset=%zu encoded=%p encoded_len=%d encoded_offset=%d\"\n+vnc_sasl_read_decoded(void *state, const void *encoded, size_t encoded_len, const void *decoded, unsigned int decoded_len) \"VNC SASL read decoded state=%p encoded=%p encoded_len=%zu decoded=%p decoded_len=%u\"\n+vnc_zlib_init(void *state, const void *opaque) \"VNC zlib init state=%p opaque=%p\"\n+vnc_tight_zlib_init(void *state, int stream_id, const void *opaque) \"VNC tight zlib init state=%p stream=%d opaque=%p\"\n \n \n # input.c\n", "prefixes": [ "v2", "62/67" ] }