get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 54990,
    "url": "http://patches.dpdk.org/api/patches/54990/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1560957293-17294-25-git-send-email-ndragazis@arrikto.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<1560957293-17294-25-git-send-email-ndragazis@arrikto.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1560957293-17294-25-git-send-email-ndragazis@arrikto.com",
    "date": "2019-06-19T15:14:49",
    "name": "[24/28] examples/vhost_scsi: add --socket-file argument",
    "commit_ref": null,
    "pull_url": null,
    "state": "rfc",
    "archived": true,
    "hash": "e1e70b4425cf767458863d178b109cec6298fa72",
    "submitter": {
        "id": 1339,
        "url": "http://patches.dpdk.org/api/people/1339/?format=api",
        "name": "Nikos Dragazis",
        "email": "ndragazis@arrikto.com"
    },
    "delegate": {
        "id": 2642,
        "url": "http://patches.dpdk.org/api/users/2642/?format=api",
        "username": "mcoquelin",
        "first_name": "Maxime",
        "last_name": "Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1560957293-17294-25-git-send-email-ndragazis@arrikto.com/mbox/",
    "series": [
        {
            "id": 5082,
            "url": "http://patches.dpdk.org/api/series/5082/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=5082",
            "date": "2019-06-19T15:14:25",
            "name": "vhost: add virtio-vhost-user transport",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/5082/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/54990/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/54990/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id CBD861C43E;\n\tWed, 19 Jun 2019 17:16:44 +0200 (CEST)",
            "from mx0.arrikto.com (mx0.arrikto.com [212.71.252.59])\n\tby dpdk.org (Postfix) with ESMTP id 5154C1C3A0\n\tfor <dev@dpdk.org>; Wed, 19 Jun 2019 17:15:47 +0200 (CEST)",
            "from troi.prod.arr (mail.arr [10.99.0.5])\n\tby mx0.arrikto.com (Postfix) with ESMTP id 21CD018201C;\n\tWed, 19 Jun 2019 18:15:47 +0300 (EEST)",
            "from localhost.localdomain (unknown [10.89.50.133])\n\tby troi.prod.arr (Postfix) with ESMTPSA id BD9052B2;\n\tWed, 19 Jun 2019 18:15:46 +0300 (EEST)"
        ],
        "From": "Nikos Dragazis <ndragazis@arrikto.com>",
        "To": "dev@dpdk.org",
        "Cc": "Maxime Coquelin <maxime.coquelin@redhat.com>,\n\tTiwei Bie <tiwei.bie@intel.com>, Zhihong Wang <zhihong.wang@intel.com>,\n\tStefan Hajnoczi <stefanha@redhat.com>, Wei Wang <wei.w.wang@intel.com>,\n\tStojaczyk Dariusz <dariusz.stojaczyk@intel.com>,\n\tVangelis Koukis <vkoukis@arrikto.com>",
        "Date": "Wed, 19 Jun 2019 18:14:49 +0300",
        "Message-Id": "<1560957293-17294-25-git-send-email-ndragazis@arrikto.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1560957293-17294-1-git-send-email-ndragazis@arrikto.com>",
        "References": "<1560957293-17294-1-git-send-email-ndragazis@arrikto.com>",
        "Subject": "[dpdk-dev] [PATCH 24/28] examples/vhost_scsi: add --socket-file\n\targument",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Stefan Hajnoczi <stefanha@redhat.com>\n\nThe default filename built into examples/vhost_scsi may not be\nconvenient.  Allow the user to specify the full UNIX domain socket path\non the command-line.\n\nSigned-off-by: Stefan Hajnoczi <stefanha@redhat.com>\n---\n examples/vhost_scsi/vhost_scsi.c | 93 ++++++++++++++++++++++++++++++++--------\n 1 file changed, 75 insertions(+), 18 deletions(-)",
    "diff": "diff --git a/examples/vhost_scsi/vhost_scsi.c b/examples/vhost_scsi/vhost_scsi.c\nindex 513af0c..d2d02fd 100644\n--- a/examples/vhost_scsi/vhost_scsi.c\n+++ b/examples/vhost_scsi/vhost_scsi.c\n@@ -2,6 +2,7 @@\n  * Copyright(c) 2010-2017 Intel Corporation\n  */\n \n+#include <getopt.h>\n #include <stdint.h>\n #include <unistd.h>\n #include <stdbool.h>\n@@ -402,26 +403,10 @@ static const struct vhost_device_ops vhost_scsi_device_ops = {\n };\n \n static struct vhost_scsi_ctrlr *\n-vhost_scsi_ctrlr_construct(const char *ctrlr_name)\n+vhost_scsi_ctrlr_construct(void)\n {\n \tint ret;\n \tstruct vhost_scsi_ctrlr *ctrlr;\n-\tchar *path;\n-\tchar cwd[PATH_MAX];\n-\n-\t/* always use current directory */\n-\tpath = getcwd(cwd, PATH_MAX);\n-\tif (!path) {\n-\t\tfprintf(stderr, \"Cannot get current working directory\\n\");\n-\t\treturn NULL;\n-\t}\n-\tsnprintf(dev_pathname, sizeof(dev_pathname), \"%s/%s\", path, ctrlr_name);\n-\n-\tif (access(dev_pathname, F_OK) != -1) {\n-\t\tif (unlink(dev_pathname) != 0)\n-\t\t\trte_exit(EXIT_FAILURE, \"Cannot remove %s.\\n\",\n-\t\t\t\t dev_pathname);\n-\t}\n \n \tif (rte_vhost_driver_register(dev_pathname, 0) != 0) {\n \t\tfprintf(stderr, \"socket %s already exists\\n\", dev_pathname);\n@@ -455,6 +440,71 @@ signal_handler(__rte_unused int signum)\n \texit(0);\n }\n \n+static void\n+set_dev_pathname(const char *path)\n+{\n+\tif (dev_pathname[0])\n+\t\trte_exit(EXIT_FAILURE, \"--socket-file can only be given once.\\n\");\n+\n+\tsnprintf(dev_pathname, sizeof(dev_pathname), \"%s\", path);\n+}\n+\n+static void\n+vhost_scsi_usage(const char *prgname)\n+{\n+\tfprintf(stderr, \"%s [EAL options] --\\n\"\n+\t\"    --socket-file PATH: The path of the UNIX domain socket\\n\",\n+\t\tprgname);\n+}\n+\n+static void\n+vhost_scsi_parse_args(int argc, char **argv)\n+{\n+\tint opt;\n+\tint option_index;\n+\tconst char *prgname = argv[0];\n+\tstatic struct option long_option[] = {\n+\t\t{\"socket-file\", required_argument, NULL, 0},\n+\t\t{NULL, 0, 0, 0},\n+\t};\n+\n+\twhile ((opt = getopt_long(argc, argv, \"\", long_option,\n+\t\t\t\t  &option_index)) != -1) {\n+\t\tswitch (opt) {\n+\t\tcase 0:\n+\t\t\tif (!strcmp(long_option[option_index].name,\n+\t\t\t\t    \"socket-file\")) {\n+\t\t\t\tset_dev_pathname(optarg);\n+\t\t\t}\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\tvhost_scsi_usage(prgname);\n+\t\t\trte_exit(EXIT_FAILURE, \"Invalid argument\\n\");\n+\t\t}\n+\t}\n+}\n+\n+static void\n+vhost_scsi_set_default_dev_pathname(void)\n+{\n+\tchar *path;\n+\tchar cwd[PATH_MAX];\n+\n+\t/* always use current directory */\n+\tpath = getcwd(cwd, PATH_MAX);\n+\tif (!path) {\n+\t\trte_exit(EXIT_FAILURE,\n+\t\t\t \"Cannot get current working directory\\n\");\n+\t}\n+\tsnprintf(dev_pathname, sizeof(dev_pathname), \"%s/vhost.socket\", path);\n+\n+\tif (access(dev_pathname, F_OK) != -1) {\n+\t\tif (unlink(dev_pathname) != 0)\n+\t\t\trte_exit(EXIT_FAILURE, \"Cannot remove %s.\\n\",\n+\t\t\t\t dev_pathname);\n+\t}\n+}\n+\n int main(int argc, char *argv[])\n {\n \tint ret;\n@@ -465,8 +515,15 @@ int main(int argc, char *argv[])\n \tret = rte_eal_init(argc, argv);\n \tif (ret < 0)\n \t\trte_exit(EXIT_FAILURE, \"Error with EAL initialization\\n\");\n+\targc -= ret;\n+\targv += ret;\n+\n+\tvhost_scsi_parse_args(argc, argv);\n+\n+\tif (!dev_pathname[0])\n+\t\tvhost_scsi_set_default_dev_pathname();\n \n-\tg_vhost_ctrlr = vhost_scsi_ctrlr_construct(\"vhost.socket\");\n+\tg_vhost_ctrlr = vhost_scsi_ctrlr_construct();\n \tif (g_vhost_ctrlr == NULL) {\n \t\tfprintf(stderr, \"Construct vhost scsi controller failed\\n\");\n \t\treturn 0;\n",
    "prefixes": [
        "24/28"
    ]
}