get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2195653,
    "url": "http://patchwork.ozlabs.org/api/patches/2195653/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260211152508.732487-25-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-25-berrange@redhat.com>",
    "list_archive_url": null,
    "date": "2026-02-11T15:25:05",
    "name": "[v6,24/27] util: add support for formatting a workload name in messages",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "86571358e62177ff0c07930a3c2f5101e22b9539",
    "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-25-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/2195653/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2195653/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=NN1mCbSp;\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 4fB2Tq5m8Cz1xpY\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 12 Feb 2026 02:31:43 +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 1vqC7x-0000wG-1r; Wed, 11 Feb 2026 10:27:41 -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 1vqC7v-0000jk-Tt\n for qemu-devel@nongnu.org; Wed, 11 Feb 2026 10:27:39 -0500",
            "from us-smtp-delivery-124.mimecast.com ([170.10.133.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 1vqC7t-0006Af-Vp\n for qemu-devel@nongnu.org; Wed, 11 Feb 2026 10:27:39 -0500",
            "from mx-prod-mc-05.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-322-0HSJ2GshM8evB-fM57QhBg-1; Wed,\n 11 Feb 2026 10:27:34 -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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id 6F6A819560B9; Wed, 11 Feb 2026 15:27:32 +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 705C430001A8; Wed, 11 Feb 2026 15:27:27 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1770823657;\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=Ife0kgX5LU9dVRlkos1BTWzRMejsgLQmrReuIHPiUu8=;\n b=NN1mCbSpNqaXhyw9BD9BazMsAL8Ex8RbQKT1K/4s3VmNcWyDjI9/nni5Vo0B7H+8vIeiIE\n zO1JrKdpUb0CO6vcel2UIAX0Sq+1gYDXQypLqqKvfiLdfMztR1RdsaqkY7Z3FoqZF8J3Db\n SyoPw9ajOJ/rf0KIIbpCGgfGdIHu638=",
        "X-MC-Unique": "0HSJ2GshM8evB-fM57QhBg-1",
        "X-Mimecast-MFC-AGG-ID": "0HSJ2GshM8evB-fM57QhBg_1770823652",
        "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 24/27] util: add support for formatting a workload name in\n messages",
        "Date": "Wed, 11 Feb 2026 15:25:05 +0000",
        "Message-ID": "<20260211152508.732487-25-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.133.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_H2=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": "The error_report function can include the guest name in any\nmessages it prints. The qemu_log function has no equivalent\nbehaviour.\n\nThis introduces support for a \"workload name\" in the new\nmessages API, which in the case of system emulators will\nbe the guest name. The possibility of defining a workload\nname for other binaries is left as an exercise for the\nfuture.\n\nThis change has no impact on the output of the error_report\nfunction, but will change the qemu_log function. This can\nbe easily seen with the 'log' trace backend, and how it is\nnow more closely matching error_report output.\n\nBefore:\n\n  # qemu-system-x86_64 -msg guest-name=on -name blah -object tls-creds-x509,id=t0,dir=fish -d 'trace:qcrypto*'\n  qcrypto_tls_creds_x509_load TLS creds x509 load creds=0x55b3af3fd870 dir=fish\n  qcrypto_tls_creds_get_path TLS creds path creds=0x55b3af3fd870 filename=ca-cert.pem path=<none>\n  blah qemu-system-x86_64: Unable to access credentials fish/ca-cert.pem: No such file or directory\n\nAfter:\n\n  # qemu-system-x86_64 -msg guest-name=on -name blah -object tls-creds-x509,id=t0,dir=fish -d 'trace:qcrypto*'\n  blah qcrypto_tls_creds_x509_load TLS creds x509 load creds=0x55b3af3fd870 dir=fish\n  blah qcrypto_tls_creds_get_path TLS creds path creds=0x55b3af3fd870 filename=ca-cert.pem path=<none>\n  blah qemu-system-x86_64: Unable to access credentials fish/ca-cert.pem: No such file or directory\n\nReviewed-by: Richard Henderson <richard.henderson@linaro.org>\nSigned-off-by: Daniel P. Berrangé <berrange@redhat.com>\n---\n include/qemu/error-report.h |  3 ---\n include/qemu/message.h      | 10 ++++++++++\n system/vl.c                 |  6 ++++--\n util/error-report.c         |  7 -------\n util/message.c              | 12 ++++++++++++\n 5 files changed, 26 insertions(+), 12 deletions(-)",
    "diff": "diff --git a/include/qemu/error-report.h b/include/qemu/error-report.h\nindex c8000778ec..ffc305f828 100644\n--- a/include/qemu/error-report.h\n+++ b/include/qemu/error-report.h\n@@ -70,7 +70,4 @@ void error_init(const char *argv0);\n                               fmt, ##__VA_ARGS__);      \\\n     })\n \n-extern bool error_with_guestname;\n-extern const char *error_guest_name;\n-\n #endif\ndiff --git a/include/qemu/message.h b/include/qemu/message.h\nindex 0a06421f77..cfc3c92648 100644\n--- a/include/qemu/message.h\n+++ b/include/qemu/message.h\n@@ -5,6 +5,7 @@\n \n enum QMessageFormatFlags {\n     QMESSAGE_FORMAT_TIMESTAMP = (1 << 0),\n+    QMESSAGE_FORMAT_WORKLOAD_NAME = (1 << 1),\n };\n \n /**\n@@ -16,6 +17,15 @@ enum QMessageFormatFlags {\n  */\n void qmessage_set_format(int flags);\n \n+/**\n+ * qmessage_set_workload_name:\n+ * @name: the name of the workload\n+ *\n+ * Set the workload name, which for a system emulator\n+ * will be the guest VM name.\n+ */\n+void qmessage_set_workload_name(const char *name);\n+\n /**\n  * qmessage_context_print:\n  * @fp: file to emit the prefix on\ndiff --git a/system/vl.c b/system/vl.c\nindex 4ef41df747..be5862e55e 100644\n--- a/system/vl.c\n+++ b/system/vl.c\n@@ -823,7 +823,9 @@ static void configure_msg(QemuOpts *opts)\n     if (qemu_opt_get_bool(opts, \"timestamp\", false)) {\n         flags |= QMESSAGE_FORMAT_TIMESTAMP;\n     }\n-    error_with_guestname = qemu_opt_get_bool(opts, \"guest-name\", false);\n+    if (qemu_opt_get_bool(opts, \"guest-name\", false)) {\n+        flags |= QMESSAGE_FORMAT_WORKLOAD_NAME;\n+    }\n     qmessage_set_format(flags);\n }\n \n@@ -3526,7 +3528,7 @@ void qemu_init(int argc, char **argv)\n                     exit(1);\n                 }\n                 /* Capture guest name if -msg guest-name is used later */\n-                error_guest_name = qemu_opt_get(opts, \"guest\");\n+                qmessage_set_workload_name(qemu_opt_get(opts, \"guest\"));\n                 break;\n             case QEMU_OPTION_prom_env:\n                 if (nb_prom_envs >= MAX_PROM_ENVS) {\ndiff --git a/util/error-report.c b/util/error-report.c\nindex 1ef65a7475..3009b93c23 100644\n--- a/util/error-report.c\n+++ b/util/error-report.c\n@@ -25,8 +25,6 @@ typedef enum {\n     REPORT_TYPE_INFO,\n } report_type;\n \n-bool error_with_guestname;\n-const char *error_guest_name;\n \n /*\n  * Print to the current human monitor if we have one, else to stderr.\n@@ -230,11 +228,6 @@ static void vreport(report_type type, const char *fmt, va_list ap)\n         qmessage_context_print(stderr);\n     }\n \n-    /* Only prepend guest name if -msg guest-name and -name guest=... are set */\n-    if (error_with_guestname && error_guest_name && !cur) {\n-        fprintf(stderr, \"%s \", error_guest_name);\n-    }\n-\n     print_loc(cur);\n \n     switch (type) {\ndiff --git a/util/message.c b/util/message.c\nindex 99a403f9d0..fb2c947153 100644\n--- a/util/message.c\n+++ b/util/message.c\n@@ -6,12 +6,18 @@\n #include \"monitor/monitor.h\"\n \n static int message_format;\n+static char *message_workloadname;\n \n void qmessage_set_format(int flags)\n {\n     message_format = flags;\n }\n \n+void qmessage_set_workload_name(const char *name)\n+{\n+    message_workloadname = g_strdup(name);\n+}\n+\n void qmessage_context_print(FILE *fp)\n {\n     if (message_format & QMESSAGE_FORMAT_TIMESTAMP) {\n@@ -20,4 +26,10 @@ void qmessage_context_print(FILE *fp)\n         fputs(timestr, fp);\n         fputc(' ', fp);\n     }\n+\n+    if ((message_format & QMESSAGE_FORMAT_WORKLOAD_NAME) &&\n+        message_workloadname) {\n+        fputs(message_workloadname, fp);\n+        fputc(' ', fp);\n+    }\n }\n",
    "prefixes": [
        "v6",
        "24/27"
    ]
}