get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 812522,
    "url": "http://patchwork.ozlabs.org/api/patches/812522/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20170911171639.22005-1-n54@gmx.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": "<20170911171639.22005-1-n54@gmx.com>",
    "list_archive_url": null,
    "date": "2017-09-11T17:16:39",
    "name": "[v2] Discover openpty(3) dynamically in configure",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "64caee6f8ed73e4198adf8c8192122693a176e32",
    "submitter": {
        "id": 11273,
        "url": "http://patchwork.ozlabs.org/api/people/11273/?format=api",
        "name": "Kamil Rytarowski",
        "email": "n54@gmx.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20170911171639.22005-1-n54@gmx.com/mbox/",
    "series": [
        {
            "id": 2538,
            "url": "http://patchwork.ozlabs.org/api/series/2538/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=2538",
            "date": "2017-09-11T17:16:39",
            "name": "[v2] Discover openpty(3) dynamically in configure",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/2538/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/812522/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/812522/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>)",
        "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 3xrbLC6jTCz9s7F\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 12 Sep 2017 04:00:03 +1000 (AEST)",
            "from localhost ([::1]:59550 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 1drT06-0001XO-1j\n\tfor incoming@patchwork.ozlabs.org; Mon, 11 Sep 2017 14:00:02 -0400",
            "from eggs.gnu.org ([2001:4830:134:3::10]:41945)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from <n54@gmx.com>)\n\tid 1drSWA-00075t-QJ\n\tfor qemu-devel@nongnu.org; Mon, 11 Sep 2017 13:29:12 -0400",
            "from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <n54@gmx.com>) id 1drSW9-000625-NV\n\tfor qemu-devel@nongnu.org; Mon, 11 Sep 2017 13:29:06 -0400",
            "from mout.gmx.net ([212.227.15.19]:55125)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16)\n\t(Exim 4.71) (envelope-from <n54@gmx.com>)\n\tid 1drSW5-0005wk-0K; Mon, 11 Sep 2017 13:29:01 -0400",
            "from localhost.localdomain ([185.58.161.191]) by mail.gmx.com\n\t(mrgmx003 [212.227.17.184]) with ESMTPSA (Nemesis) id\n\t0LiDrv-1d4hIo1rSV-00nOSM; Mon, 11 Sep 2017 19:28:57 +0200"
        ],
        "From": "Kamil Rytarowski <n54@gmx.com>",
        "To": "qemu-trivial@nongnu.org",
        "Date": "Mon, 11 Sep 2017 19:16:39 +0200",
        "Message-Id": "<20170911171639.22005-1-n54@gmx.com>",
        "X-Mailer": "git-send-email 2.14.1",
        "In-Reply-To": "<20170903164952.26760-1-n54@gmx.com>",
        "References": "<20170903164952.26760-1-n54@gmx.com>",
        "X-Provags-ID": "V03:K0:tFQ8LyO7mIgWyEwQVsNmdpbsXcj4jSrSiWlbLtb38HYOGhH+Fdk\n\taZpFTSPUsjBp51VeprKf6n0fN6iX5jm1k8JbiAGimJI+/aCSzQ/WhByuDU7ks6ztY76qb/k\n\trS40NSgY5xnlt07mSqk1f89MgcvSghazVMfyYYka8dWsvWTFqZEIIHJzFk0hS1FKtcXS17d\n\tddP2KbeHqvGIyTR8sGNEA==",
        "X-UI-Out-Filterresults": "notjunk:1; V01:K0:IF+4N/kQpgc=:B6+mW7IdvT/uxKvsU7ShT7\n\tTYrNELMFPXDs0HSTgdGW+Nq+XEM+djQgiAdCa+ARpxI5eEy87NOtmHE9wt5FnZhhalTWbM1iE\n\tzTrT9WASlQstn5a42PwcpsSPdJ2KweULNs1FWTMbJbp4nf4vhFdqSSkpYRffRyex+UcfEbULw\n\tLbhBvGZmccEQgoVTJKSaejGXvFCcyLLN0GaSwCeGF86pi0bRZdDACy697aFChK/v3jdVIjR4Y\n\tXkf8dREb0r9Dcg5InGbClnkGxBG87rqV1pEmOJYWZzFwtoAJ6IkP8rMafG8AT5SzSMEo509VC\n\tJDI5TD4HpydzIHoZe7Pr5jUJ2fVvQ6HcH9pI4rdBg4DsKeIaQM460t0naPFypfj3ODcHxAtxg\n\tuvs9KDDiYjED7nLQmD3l5zw4uCtmBEjEDIY83YvNRq/lD9t0UsB0mwtCruGDRVNyqRrCaPc/y\n\tGZnI3CuMouus3Ct+YJJSwJyTIQ6DzznoryM/y4FX15ZSiTvGX9rgCZa4XUyOjrxiWkZzy95/e\n\tiefjCp7UjFP0T4BBerDX70upSkWVavZMXp1l6qISuQNX/0cDskH90GJSuShusKY80RmS9W/yR\n\tstROMGTadk6OEmEs2xrHi2mUtZxMQuBOTJoa7L6W4Sg8UwMeWyrmCguhW49plFE+YBSpFSlsg\n\tLPZfjvUW8lErHwNV7RShniMyouShFuIvpZDCbU7Qmzp4XX6tZDTv8/qs4nX7YytNKvnO52bQP\n\tm6HH83Mkjo40WbWQmzVpNcPczUEpcUT1kvQBjm84EpQUukNy8tg75864iGxsLtjzQyR5SZqXE\n\tDfUImB4Qa9Om/9GpvmUOXx1D42A7w==",
        "X-detected-operating-system": "by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]",
        "X-Received-From": "212.227.15.19",
        "Subject": "[Qemu-devel] [PATCH v2] Discover openpty(3) dynamically in configure",
        "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": "Kamil Rytarowski <n54@gmx.com>, peter.maydell@linaro.org,\n\tjperkin@joyent.com, qemu-devel@nongnu.org",
        "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": "openpty(3) might:\n - exists in libc (OSX)\n - exists in libutil (GNU, BSD)\n - does not exist (SmartOS)\n\nAdd a function to discover this function in the ./configure script.\nAdd new config types: CONFIG_OPENPTY_LIBC and CONFIG_OPENPTY_LIBUTIL,\nrespectively defined when openpts(3) links with -lc or -lutil.\n\nReplace the condition adding -lutil in tests (for openpty(3)) from\nCONFIG_POSIX to CONFIG_OPENPTY_LIBUTIL.\n\nReplace the fallback openpty(3) impelementation comment from Solaris\nto SmartOS. Solaris is EOL'ed and it's confirmed that it does not work\non Oracle Solaris.\n---\n configure              | 25 +++++++++++++++++++++++++\n tests/Makefile.include |  2 +-\n util/qemu-openpty.c    |  4 ++--\n 3 files changed, 28 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/configure b/configure\nindex fd7e3a5e81..a614adcd29 100755\n--- a/configure\n+++ b/configure\n@@ -3819,6 +3819,25 @@ EOF\n   fi\n fi\n \n+##########################################\n+# openpty probe\n+openpty_libc=no\n+openpty_libutil=no\n+cat > $TMPC << EOF\n+extern int openpty(int *amaster, int *aslave, char *name, void *termp, void *winp);\n+\n+int main(void)\n+{\n+    int master_fd, slave_fd;\n+    return openpty(&master_fd, &slave_fd, 0, 0, 0) == 0;\n+}\n+EOF\n+if compile_prog \"\" \"\" ; then\n+  openpty_libc=yes\n+elif compile_prog \"\" \"-lutil\" ; then\n+  openpty_libutil=yes\n+fi\n+\n ##########################################\n # signalfd probe\n signalfd=\"no\"\n@@ -5788,6 +5807,12 @@ fi\n if test \"$fdt\" = \"yes\" ; then\n   echo \"CONFIG_FDT=y\" >> $config_host_mak\n fi\n+if test \"$openpty_libc\" = \"yes\" ; then\n+  echo \"CONFIG_OPENPTY_LIBC=y\" >> $config_host_mak\n+fi\n+if test \"$openpty_libutil\" = \"yes\" ; then\n+  echo \"CONFIG_OPENPTY_LIBUTIL=y\" >> $config_host_mak\n+fi\n if test \"$signalfd\" = \"yes\" ; then\n   echo \"CONFIG_SIGNALFD=y\" >> $config_host_mak\n fi\ndiff --git a/tests/Makefile.include b/tests/Makefile.include\nindex fae5715e9c..e7e0bc2724 100644\n--- a/tests/Makefile.include\n+++ b/tests/Makefile.include\n@@ -814,7 +814,7 @@ tests/migration/initrd-stress.img: tests/migration/stress$(EXESUF)\n \trm $(INITRD_WORK_DIR)/init\n \trmdir $(INITRD_WORK_DIR)\n \n-ifeq ($(CONFIG_POSIX),y)\n+ifeq ($(CONFIG_OPENPTY_LIBUTIL),y)\n LIBS += -lutil\n endif\n \ndiff --git a/util/qemu-openpty.c b/util/qemu-openpty.c\nindex 2e8b43bdf5..62c87e5563 100644\n--- a/util/qemu-openpty.c\n+++ b/util/qemu-openpty.c\n@@ -51,8 +51,8 @@\n # include <termios.h>\n #endif\n \n-#ifdef __sun__\n-/* Once Solaris has openpty(), this is going to be removed. */\n+/* The fallback implementation is needed at least on SmartOS. */\n+#if !defined(CONFIG_OPENPTY_LIBC) && !defined(CONFIG_OPENPTY_LIBUTIL)\n static int openpty(int *amaster, int *aslave, char *name,\n                    struct termios *termp, struct winsize *winp)\n {\n",
    "prefixes": [
        "v2"
    ]
}