Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2195633/?format=api
{ "id": 2195633, "url": "http://patchwork.ozlabs.org/api/patches/2195633/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260211152508.732487-6-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": "<20260211152508.732487-6-berrange@redhat.com>", "list_archive_url": null, "date": "2026-02-11T15:24:46", "name": "[v6,05/27] system: unconditionally enable thread naming", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "d8b07c33f2ee99f8992641ab7d1b97c058b8c41c", "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/20260211152508.732487-6-berrange@redhat.com/mbox/", "series": [ { "id": 491862, "url": "http://patchwork.ozlabs.org/api/series/491862/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=491862", "date": "2026-02-11T15:24:41", "name": "util: sync error_report & qemu_log output more closely", "version": 6, "mbox": "http://patchwork.ozlabs.org/series/491862/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2195633/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2195633/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@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=d66G5DL7;\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 (lists.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 4fB2NJ16RRz1xtr\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 12 Feb 2026 02:26:56 +1100 (AEDT)", "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 1vqC6H-0004jX-M6; Wed, 11 Feb 2026 10:25:57 -0500", "from eggs.gnu.org ([2001:470:142:3::10])\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <berrange@redhat.com>)\n id 1vqC6G-0004hc-HI\n for qemu-devel@nongnu.org; Wed, 11 Feb 2026 10:25:56 -0500", "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 <berrange@redhat.com>)\n id 1vqC6C-0005kN-En\n for qemu-devel@nongnu.org; Wed, 11 Feb 2026 10:25:56 -0500", "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-551-v8iV2EDrOeeM8lfubGXdFQ-1; Wed,\n 11 Feb 2026 10:25:47 -0500", "from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4])\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 870F51955E7A; Wed, 11 Feb 2026 15:25:45 +0000 (UTC)", "from toolbx.redhat.com (unknown [10.45.227.9])\n by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP\n id 8D35C30001A8; Wed, 11 Feb 2026 15:25:39 +0000 (UTC)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1770823551;\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=Ui4fD1jz797G3RiFXRHLkhT2i8NLmus/BW0z4PdlSwg=;\n b=d66G5DL7mETeh6Qo7f30pdns1GuJlhwS7m8ZSNqJotSpYYGzn2BwiWJg2n30OQawYUcxIo\n ijlbBmOeTaxUIA8n3c6sOhvi9mkHPDmX827AKM180UlftPvasmnASC8ecHZnevUQrfq4CN\n zq7hh0zNJrE5+cF8aY4KseDYiElgo2A=", "X-MC-Unique": "v8iV2EDrOeeM8lfubGXdFQ-1", "X-Mimecast-MFC-AGG-ID": "v8iV2EDrOeeM8lfubGXdFQ_1770823545", "From": "=?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= <berrange@redhat.com>", "To": "qemu-devel@nongnu.org", "Cc": "Manos Pitsidianakis <manos.pitsidianakis@linaro.org>,\n Stefan Weil <sw@weilnetz.de>, \"Dr. David Alan Gilbert\" <dave@treblig.org>,\n Pierrick Bouvier <pierrick.bouvier@linaro.org>, devel@lists.libvirt.org,\n\t=?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@linaro.org>, =?utf-8?q?Marc?=\n\t=?utf-8?q?-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>,\n Hanna Reitz <hreitz@redhat.com>, Kevin Wolf <kwolf@redhat.com>,\n qemu-block@nongnu.org, qemu-rust@nongnu.org,\n Paolo Bonzini <pbonzini@redhat.com>, Markus Armbruster <armbru@redhat.com>,\n Gerd Hoffmann <kraxel@redhat.com>,\n =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= <berrange@redhat.com>,\n Christian Schoenebeck <qemu_oss@crudebyte.com>,\n Richard Henderson <richard.henderson@linaro.org>", "Subject": "[PATCH v6 05/27] system: unconditionally enable thread naming", "Date": "Wed, 11 Feb 2026 15:24:46 +0000", "Message-ID": "<20260211152508.732487-6-berrange@redhat.com>", "In-Reply-To": "<20260211152508.732487-1-berrange@redhat.com>", "References": "<20260211152508.732487-1-berrange@redhat.com>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "X-Scanned-By": "MIMEDefang 3.4.1 on 10.30.177.4", "Received-SPF": "pass client-ip=170.10.129.124;\n envelope-from=berrange@redhat.com;\n helo=us-smtp-delivery-124.mimecast.com", "X-Spam_score_int": "-20", "X-Spam_score": "-2.1", "X-Spam_bar": "--", "X-Spam_report": "(-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001,\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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001,\n RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001,\n SPF_HELO_PASS=-0.001,\n SPF_PASS=-0.001 autolearn=unavailable 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": "When thread naming was introduced years ago, it was disabled by\ndefault and put behind a command line flag:\n\n commit 8f480de0c91a18d550721f8d9af969ebfbda0793\n Author: Dr. David Alan Gilbert <dgilbert@redhat.com>\n Date: Thu Jan 30 10:20:31 2014 +0000\n\n Add 'debug-threads' suboption to --name\n\nThis was done based on a concern that something might depend\non the historical thread naming. Thread names, however, were\nnever promised to be part of QEMU's public API. The defaults\nwill vary across platforms, so no assumptions should ever be\nmade about naming.\n\nAn opt-in behaviour is also unfortunately incompatible with\nRCU which creates its thread from an constructor function\nwhich is run before command line args are parsed. Thus the\nRCU thread lacks any name.\n\nlibvirt has unconditionally enabled debug-threads=yes on all\nVMs it creates for 10 years. Interestingly this DID expose a\nbug in libvirt, as it parsed /proc/$PID/stat and could not\ncope with a space in the thread name. This was a latent\npre-existing bug in libvirt though, and not a part of QEMU's\nAPI.\n\nHaving thread names always available, will allow thread names\nto be included in error reports and log messags QEMU prints\nby default, which will improve ability to triage QEMU bugs.\n\nReviewed-by: Dr. David Alan Gilbert <dave@treblig.org>\nReviewed-by: Richard Henderson <richard.henderson@linaro.org>\nReviewed-by: Markus Armbruster <armbru@redhat.com>\nSigned-off-by: Daniel P. Berrangé <berrange@redhat.com>\n---\n docs/about/deprecated.rst | 7 +++++++\n include/qemu/thread.h | 1 -\n system/vl.c | 12 +++++++-----\n util/qemu-thread-posix.c | 18 +-----------------\n util/qemu-thread-win32.c | 27 ++++++---------------------\n 5 files changed, 21 insertions(+), 44 deletions(-)", "diff": "diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst\nindex 1d5c4f3707..568a48f21c 100644\n--- a/docs/about/deprecated.rst\n+++ b/docs/about/deprecated.rst\n@@ -54,6 +54,13 @@ as short-form boolean values, and passed to plugins as ``arg_name=on``.\n However, short-form booleans are deprecated and full explicit ``arg_name=on``\n form is preferred.\n \n+``debug-threads`` option for ``-name`` (since 11.0)\n+'''''''''''''''''''''''''''''''''''''''''''''''''''\n+\n+The ``debug-threads`` option of the ``-name`` argument is now\n+ignored. Thread naming is unconditionally enabled for all platforms\n+where it is supported.\n+\n QEMU Machine Protocol (QMP) commands\n ------------------------------------\n \ndiff --git a/include/qemu/thread.h b/include/qemu/thread.h\nindex f0302ed01f..3a286bb3ef 100644\n--- a/include/qemu/thread.h\n+++ b/include/qemu/thread.h\n@@ -215,7 +215,6 @@ void *qemu_thread_join(QemuThread *thread);\n void qemu_thread_get_self(QemuThread *thread);\n bool qemu_thread_is_self(QemuThread *thread);\n G_NORETURN void qemu_thread_exit(void *retval);\n-void qemu_thread_naming(bool enable);\n \n struct Notifier;\n /**\ndiff --git a/system/vl.c b/system/vl.c\nindex aa9a155041..d8676b3adf 100644\n--- a/system/vl.c\n+++ b/system/vl.c\n@@ -403,9 +403,8 @@ static QemuOptsList qemu_name_opts = {\n }, {\n .name = \"debug-threads\",\n .type = QEMU_OPT_BOOL,\n- .help = \"When enabled, name the individual threads; defaults off.\\n\"\n- \"NOTE: The thread names are for debugging and not a\\n\"\n- \"stable API.\",\n+ .help = \"Enable thread names\"\n+ \"(deprecated, always enabled where supported)\",\n },\n { /* End of list */ }\n },\n@@ -554,9 +553,12 @@ static int parse_name(void *opaque, QemuOpts *opts, Error **errp)\n {\n const char *proc_name;\n \n- if (qemu_opt_get(opts, \"debug-threads\")) {\n- qemu_thread_naming(qemu_opt_get_bool(opts, \"debug-threads\", false));\n+ if (qemu_opt_get(opts, \"debug-threads\") &&\n+ !qemu_opt_get_bool(opts, \"debug-threads\", false)) {\n+ fprintf(stderr, \"Ignoring deprecated 'debug-threads=no' option, \" \\\n+ \"thread naming is unconditionally enabled\\n\");\n }\n+\n qemu_name = qemu_opt_get(opts, \"guest\");\n \n proc_name = qemu_opt_get(opts, \"process\");\ndiff --git a/util/qemu-thread-posix.c b/util/qemu-thread-posix.c\nindex ba725444ba..7c985b5d38 100644\n--- a/util/qemu-thread-posix.c\n+++ b/util/qemu-thread-posix.c\n@@ -22,22 +22,6 @@\n #include <pthread_np.h>\n #endif\n \n-static bool name_threads;\n-\n-void qemu_thread_naming(bool enable)\n-{\n- name_threads = enable;\n-\n-#if !defined CONFIG_PTHREAD_SETNAME_NP_W_TID && \\\n- !defined CONFIG_PTHREAD_SETNAME_NP_WO_TID && \\\n- !defined CONFIG_PTHREAD_SET_NAME_NP\n- /* This is a debugging option, not fatal */\n- if (enable) {\n- fprintf(stderr, \"qemu: thread naming not supported on this host\\n\");\n- }\n-#endif\n-}\n-\n static void error_exit(int err, const char *msg)\n {\n fprintf(stderr, \"qemu: %s: %s\\n\", msg, strerror(err));\n@@ -361,7 +345,7 @@ static void *qemu_thread_start(void *args)\n /* Attempt to set the threads name; note that this is for debug, so\n * we're not going to fail if we can't set it.\n */\n- if (name_threads && qemu_thread_args->name) {\n+ if (qemu_thread_args->name) {\n # if defined(CONFIG_PTHREAD_SETNAME_NP_W_TID)\n pthread_setname_np(pthread_self(), qemu_thread_args->name);\n # elif defined(CONFIG_PTHREAD_SETNAME_NP_WO_TID)\ndiff --git a/util/qemu-thread-win32.c b/util/qemu-thread-win32.c\nindex ca2e0b512e..9595a5b090 100644\n--- a/util/qemu-thread-win32.c\n+++ b/util/qemu-thread-win32.c\n@@ -17,8 +17,6 @@\n #include \"qemu-thread-common.h\"\n #include <process.h>\n \n-static bool name_threads;\n-\n typedef HRESULT (WINAPI *pSetThreadDescription) (HANDLE hThread,\n PCWSTR lpThreadDescription);\n static pSetThreadDescription SetThreadDescriptionFunc;\n@@ -44,16 +42,6 @@ static bool load_set_thread_description(void)\n return !!SetThreadDescriptionFunc;\n }\n \n-void qemu_thread_naming(bool enable)\n-{\n- name_threads = enable;\n-\n- if (enable && !load_set_thread_description()) {\n- fprintf(stderr, \"qemu: thread naming not supported on this host\\n\");\n- name_threads = false;\n- }\n-}\n-\n static void error_exit(int err, const char *msg)\n {\n char *pstr;\n@@ -328,23 +316,20 @@ void *qemu_thread_join(QemuThread *thread)\n return ret;\n }\n \n-static bool set_thread_description(HANDLE h, const char *name)\n+static void set_thread_description(HANDLE h, const char *name)\n {\n- HRESULT hr;\n g_autofree wchar_t *namew = NULL;\n \n if (!load_set_thread_description()) {\n- return false;\n+ return;\n }\n \n namew = g_utf8_to_utf16(name, -1, NULL, NULL, NULL);\n if (!namew) {\n- return false;\n+ return;\n }\n \n- hr = SetThreadDescriptionFunc(h, namew);\n-\n- return SUCCEEDED(hr);\n+ SetThreadDescriptionFunc(h, namew);\n }\n \n void qemu_thread_create(QemuThread *thread, const char *name,\n@@ -370,8 +355,8 @@ void qemu_thread_create(QemuThread *thread, const char *name,\n if (!hThread) {\n error_exit(GetLastError(), __func__);\n }\n- if (name_threads && name && !set_thread_description(hThread, name)) {\n- fprintf(stderr, \"qemu: failed to set thread description: %s\\n\", name);\n+ if (name) {\n+ set_thread_description(hThread, name);\n }\n CloseHandle(hThread);\n \n", "prefixes": [ "v6", "05/27" ] }