get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2194388,
    "url": "http://patchwork.ozlabs.org/api/patches/2194388/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260208-bsd-user-claude-v2-20-58e5fcfdb84f@bsdimp.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": "<20260208-bsd-user-claude-v2-20-58e5fcfdb84f@bsdimp.com>",
    "list_archive_url": null,
    "date": "2026-02-08T19:26:29",
    "name": "[v2,20/24] bsd-user: Add message queue implementations",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "fe1203b7450b0bae8d38ce36eb055d39f41ec384",
    "submitter": {
        "id": 1896,
        "url": "http://patchwork.ozlabs.org/api/people/1896/?format=api",
        "name": "Warner Losh",
        "email": "imp@bsdimp.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20260208-bsd-user-claude-v2-20-58e5fcfdb84f@bsdimp.com/mbox/",
    "series": [
        {
            "id": 491434,
            "url": "http://patchwork.ozlabs.org/api/series/491434/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=491434",
            "date": "2026-02-08T19:26:09",
            "name": "bsd-user: Upstream misc system calls (System V IPC, reboot, etc)",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/491434/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2194388/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2194388/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 (2048-bit key;\n unprotected) header.d=bsdimp-com.20230601.gappssmtp.com\n header.i=@bsdimp-com.20230601.gappssmtp.com header.a=rsa-sha256\n header.s=20230601 header.b=VEalQyKa;\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 4f8HvV1Zs0z1xvc\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 09 Feb 2026 06:29:26 +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 1vpASj-0001TN-GX; Sun, 08 Feb 2026 14:28:53 -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 <imp@bsdimp.com>) id 1vpARA-0000dR-7Y\n for qemu-devel@nongnu.org; Sun, 08 Feb 2026 14:27:23 -0500",
            "from mail-oi1-x22e.google.com ([2607:f8b0:4864:20::22e])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)\n (Exim 4.90_1) (envelope-from <imp@bsdimp.com>) id 1vpAQs-00007U-T5\n for qemu-devel@nongnu.org; Sun, 08 Feb 2026 14:27:14 -0500",
            "by mail-oi1-x22e.google.com with SMTP id\n 5614622812f47-45c8e85deffso738052b6e.1\n for <qemu-devel@nongnu.org>; Sun, 08 Feb 2026 11:26:53 -0800 (PST)",
            "from rebo.bsdimp.com ([50.253.99.174])\n by smtp.gmail.com with ESMTPSA id\n 006d021491bc7-66fdf303607sm1741301eaf.14.2026.02.08.11.26.51\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Sun, 08 Feb 2026 11:26:51 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1770578813; x=1771183613;\n darn=nongnu.org;\n h=cc:to:in-reply-to:references:message-id:content-transfer-encoding\n :mime-version:subject:date:from:from:to:cc:subject:date:message-id\n :reply-to; bh=zHW6LQFaIzwSaKkoHeZZjH30Ksax78GgwX4zPL/ZVxM=;\n b=VEalQyKak4aiFX77FVQ94GfN1slti+l7a1iXFMlQ/imGyLwGQ6HMEsHmiikt6pdT+y\n w/NPtB6MsJgAazD0vdtbYP0MdlPR38BGbY4WtrX0B1OQA2Fff6ZQEdaQM9r9uGpFwapH\n pAuOjhVkqGo36pnZ37kZZGJp7ByIDbi0u5qEh82i/kVOOxpHjcEkdZv20byPko9Qu99J\n kKTnva1PTZ2MKpR2+p0ouFqNcpc6U8dCQviv0hnqybE93oLwzXifvEoXN/ZbqUOi3ItS\n GzQEKujnx9wdV44Zfgb6/qI620M9m45LlsCIJbkvYA/fFE7VijF/Mq7DVoP4O5TqDeiY\n gFxQ==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1770578813; x=1771183613;\n h=cc:to:in-reply-to:references:message-id:content-transfer-encoding\n :mime-version:subject:date:from:x-gm-gg:x-g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W1MWhcd",
        "X-Received": "by 2002:a05:6820:2d42:b0:65c:f019:ccca with SMTP id\n 006d021491bc7-66d0a37cedamr4599346eaf.21.1770578812650;\n Sun, 08 Feb 2026 11:26:52 -0800 (PST)",
        "From": "Warner Losh <imp@bsdimp.com>",
        "Date": "Sun, 08 Feb 2026 12:26:29 -0700",
        "Subject": "[PATCH v2 20/24] bsd-user: Add message queue implementations",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "7bit",
        "Message-Id": "<20260208-bsd-user-claude-v2-20-58e5fcfdb84f@bsdimp.com>",
        "References": "<20260208-bsd-user-claude-v2-0-58e5fcfdb84f@bsdimp.com>",
        "In-Reply-To": "<20260208-bsd-user-claude-v2-0-58e5fcfdb84f@bsdimp.com>",
        "To": "qemu-devel@nongnu.org",
        "Cc": "=?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= <berrange@redhat.com>,\n  Kyle Evans <kevans@freebsd.org>,\n =?utf-8?q?Marc-Andr=C3=A9_Lureau?= <marcandre.lureau@redhat.com>,\n  Paolo Bonzini <pbonzini@redhat.com>,\n =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= <philmd@linaro.org>,\n  Riku Voipio <riku.voipio@iki.fi>, Warner Losh <imp@bsdimp.com>,\n  Stacey Son <sson@FreeBSD.org>,\n  Richard Henderson <richard.henderson@linaro.org>",
        "X-Mailer": "b4 0.14.3",
        "X-Developer-Signature": "v=1; a=openpgp-sha256; l=3717; i=imp@bsdimp.com;\n h=from:subject:message-id; bh=MFUKW2hCFFpmO24KyOwSzU6K7ikVw+umbnly3Xmf3hs=;\n b=owEBbQKS/ZANAwAKAWwc0Sh9sBEAAcsmYgBpiONhZmgirpDto1qpbJSzre480uHCeths7limQ\n o0FyjjJpE6JAjMEAAEKAB0WIQQgNfiUsAqjz3zN4bdsHNEofbARAAUCaYjjYQAKCRBsHNEofbAR\n AEXSEACp+tdnupBS+nkVZ9KW57DYRbsMdOtvZH2aIIHrAAkNcdSZyIK7j7ab73RcSDahy1QDZGn\n EkOPy4nTzl4zaaZQsV9GeQeT6dcB4rDEPPefu3xCm1bGu8lTx/8mmX+eBn4yW3RbNhxm0ELuKLP\n skt1tjldCRommb8yGPaVAKrx4HGKh5Cdn2SKN8MFyQoP0wCivhZrvfyoo/tRMu+praRZosrW0VY\n En5dygH586wH7axAGzffIMlk6DhpzRBnNEEo8BJ7jLtWdf7EYavJQmeCKKq9wwATGpQy7B8uXmJ\n yeP/br5etuII4+pNJZFFrlLbdkTWy4J/YZzBWZWufWkRrTwrdVJw05BgvpzbRsKuEFItAdOJfb7\n bamVNLT5UAIHbcr8Bwgmu3sbijZ92+Fu8PR4sqKd7ixA1SvnXdzu56PRd1A76wXLjT7QIBj3EOb\n Oo7tkgY3YFmtuCePDSbC/1XTc9Cd1IvZx7N/oWHVinY0qPlKgQkODcI+dFjiQAfwgkVWA8hkp4d\n IkaGGEQ25dodUM1IyOjdlPEt2XuCy9szavWkEUpQo69weOdstnw9nD7w8LUh2Bl2YVjdbMAflip\n mJjr9HnufBNVUUiNSGjtRuMzhnuthty86tQEHm+TnKlIKTFDI6b+VUrWaVY9sPwbbhTebhVQ93e\n mZyTpCKvo9rRcvw==",
        "X-Developer-Key": "i=imp@bsdimp.com; a=openpgp;\n fpr=2035F894B00AA3CF7CCDE1B76C1CD1287DB01100",
        "Received-SPF": "none client-ip=2607:f8b0:4864:20::22e;\n envelope-from=imp@bsdimp.com; helo=mail-oi1-x22e.google.com",
        "X-Spam_score_int": "-18",
        "X-Spam_score": "-1.9",
        "X-Spam_bar": "-",
        "X-Spam_report": "(-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001,\n SPF_NONE=0.001 autolearn=ham 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": "From: Stacey Son <sson@FreeBSD.org>\n\nAdd implementations for:\n- msgsnd(2): Send message to queue with size validation\n- msgget(2): Get message queue identifier\n- msgrcv(2): Receive message from queue with size validation\n\nSigned-off-by: Stacey Son <sson@FreeBSD.org>\nReviewed-by: Richard Henderson <richard.henderson@linaro.org>\nSigned-off-by: Warner Losh <imp@bsdimp.com>\n---\n bsd-user/bsd-misc.h | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 97 insertions(+)",
    "diff": "diff --git a/bsd-user/bsd-misc.h b/bsd-user/bsd-misc.h\nindex a45fe8edb5..ff27f94944 100644\n--- a/bsd-user/bsd-misc.h\n+++ b/bsd-user/bsd-misc.h\n@@ -28,6 +28,8 @@\n \n #include \"qemu-bsd.h\"\n \n+static int bsd_msgmax;\n+\n /* quotactl(2) */\n static inline abi_long do_bsd_quotactl(abi_ulong path, abi_long cmd,\n         __unused abi_ulong target_addr)\n@@ -268,6 +270,101 @@ static inline abi_long do_bsd_msgctl(int msgid, int target_cmd, abi_long ptr)\n     return ret;\n }\n \n+struct kern_mymsg {\n+    long mtype;\n+    char mtext[1];\n+};\n+\n+static inline abi_long bsd_validate_msgsz(abi_ulong msgsz)\n+{\n+    /* Fetch msgmax the first time we need it. */\n+    if (bsd_msgmax == 0) {\n+        size_t len = sizeof(bsd_msgmax);\n+\n+        if (sysctlbyname(\"kern.ipc.msgmax\", &bsd_msgmax, &len, NULL, 0) == -1) {\n+            return -TARGET_EINVAL;\n+        }\n+    }\n+\n+    if (msgsz > bsd_msgmax) {\n+        return -TARGET_EINVAL;\n+    }\n+    return 0;\n+}\n+\n+/* msgsnd(2) */\n+static inline abi_long do_bsd_msgsnd(int msqid, abi_long msgp,\n+        abi_ulong msgsz, int msgflg)\n+{\n+    struct target_msgbuf *target_mb;\n+    struct kern_mymsg *host_mb;\n+    abi_long ret;\n+\n+    ret = bsd_validate_msgsz(msgsz);\n+    if (is_error(ret)) {\n+        return ret;\n+    }\n+    if (!lock_user_struct(VERIFY_READ, target_mb, msgp, 0)) {\n+        return -TARGET_EFAULT;\n+    }\n+    host_mb = g_malloc(msgsz + sizeof(long));\n+    host_mb->mtype = (abi_long) tswapal(target_mb->mtype);\n+    memcpy(host_mb->mtext, target_mb->mtext, msgsz);\n+    ret = get_errno(msgsnd(msqid, host_mb, msgsz, msgflg));\n+    g_free(host_mb);\n+    unlock_user_struct(target_mb, msgp, 0);\n+\n+    return ret;\n+}\n+\n+/* msgget(2) */\n+static inline abi_long do_bsd_msgget(abi_long key, abi_long msgflag)\n+{\n+    abi_long ret;\n+\n+    ret = get_errno(msgget(key, msgflag));\n+    return ret;\n+}\n+\n+/* msgrcv(2) */\n+static inline abi_long do_bsd_msgrcv(int msqid, abi_long msgp,\n+        abi_ulong msgsz, abi_long msgtyp, int msgflg)\n+{\n+    struct target_msgbuf *target_mb = NULL;\n+    char *target_mtext;\n+    struct kern_mymsg *host_mb;\n+    abi_long ret = 0;\n+\n+    ret = bsd_validate_msgsz(msgsz);\n+    if (is_error(ret)) {\n+        return ret;\n+    }\n+    if (!lock_user_struct(VERIFY_WRITE, target_mb, msgp, 0)) {\n+        return -TARGET_EFAULT;\n+    }\n+    host_mb = g_malloc(msgsz + sizeof(long));\n+    ret = get_errno(msgrcv(msqid, host_mb, msgsz, tswapal(msgtyp), msgflg));\n+    if (ret > 0) {\n+        abi_ulong target_mtext_addr = msgp + sizeof(abi_ulong);\n+        target_mtext = lock_user(VERIFY_WRITE, target_mtext_addr, ret, 0);\n+        if (target_mtext == NULL) {\n+            ret = -TARGET_EFAULT;\n+            goto end;\n+        }\n+        memcpy(target_mb->mtext, host_mb->mtext, ret);\n+        unlock_user(target_mtext, target_mtext_addr, ret);\n+    }\n+    if (!is_error(ret)) {\n+        target_mb->mtype = tswapal(host_mb->mtype);\n+    }\n+end:\n+    if (target_mb != NULL) {\n+        unlock_user_struct(target_mb, msgp, 1);\n+    }\n+    g_free(host_mb);\n+    return ret;\n+}\n+\n /* getdtablesize(2) */\n static inline abi_long do_bsd_getdtablesize(void)\n {\n",
    "prefixes": [
        "v2",
        "20/24"
    ]
}