get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 57108,
    "url": "http://patches.dpdk.org/api/patches/57108/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/40f22587dad19f2dd08a0f2b963e7fb0ebd24d74.1564062922.git.anatoly.burakov@intel.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": "<40f22587dad19f2dd08a0f2b963e7fb0ebd24d74.1564062922.git.anatoly.burakov@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/40f22587dad19f2dd08a0f2b963e7fb0ebd24d74.1564062922.git.anatoly.burakov@intel.com",
    "date": "2019-07-25T13:55:44",
    "name": "[v3,1/3] usertools/devbind: add error on forgetting to specify driver",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "79367086cc0db37a7db89919d6f6ba689329aa32",
    "submitter": {
        "id": 4,
        "url": "http://patches.dpdk.org/api/people/4/?format=api",
        "name": "Anatoly Burakov",
        "email": "anatoly.burakov@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/40f22587dad19f2dd08a0f2b963e7fb0ebd24d74.1564062922.git.anatoly.burakov@intel.com/mbox/",
    "series": [
        {
            "id": 5751,
            "url": "http://patches.dpdk.org/api/series/5751/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=5751",
            "date": "2019-07-25T13:55:43",
            "name": "Small usability improvements for devbind",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/5751/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/57108/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/57108/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 55B851C34E;\n\tThu, 25 Jul 2019 15:55:54 +0200 (CEST)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id E4EFD1C340\n\tfor <dev@dpdk.org>; Thu, 25 Jul 2019 15:55:49 +0200 (CEST)",
            "from fmsmga006.fm.intel.com ([10.253.24.20])\n\tby fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t25 Jul 2019 06:55:49 -0700",
            "from silpixa00399498.ir.intel.com (HELO\n\tsilpixa00399498.ger.corp.intel.com) ([10.237.223.125])\n\tby fmsmga006.fm.intel.com with ESMTP; 25 Jul 2019 06:55:48 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.64,306,1559545200\"; d=\"scan'208\";a=\"369654497\"",
        "From": "Anatoly Burakov <anatoly.burakov@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "thomas@monjalon.net, john.mcnamara@intel.com, stephen@networkplumber.org",
        "Date": "Thu, 25 Jul 2019 14:55:44 +0100",
        "Message-Id": "<40f22587dad19f2dd08a0f2b963e7fb0ebd24d74.1564062922.git.anatoly.burakov@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": [
            "<cover.1564062922.git.anatoly.burakov@intel.com>",
            "<cover.1564062922.git.anatoly.burakov@intel.com>"
        ],
        "References": [
            "<cover.1564062922.git.anatoly.burakov@intel.com>",
            "<cover.1564062435.git.anatoly.burakov@intel.com>\n\t<cover.1564062922.git.anatoly.burakov@intel.com>"
        ],
        "Subject": "[dpdk-dev] [PATCH v3 1/3] usertools/devbind: add error on\n\tforgetting to specify driver",
        "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": "A common user error is to forget driver to which the PCI devices should\nbe bound to. Currently, the error message in this case looks unhelpful\nmisleading and indecipherable to anyone but people who know how devbind\nworks.\n\nFix this by checking if the driver string is actually a valid device\nstring. If it is, we assume that the user has just forgot to specify the\ndriver, and display appropriate error. We also assume that no one will\nname their driver in a format that looks like a PCI address, but that\nseems like a reasonable assumption to make.\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n usertools/dpdk-devbind.py | 30 +++++++++++++++++++++++++-----\n 1 file changed, 25 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py\nindex 542ecffcc..fca79e66d 100755\n--- a/usertools/dpdk-devbind.py\n+++ b/usertools/dpdk-devbind.py\n@@ -342,9 +342,8 @@ def dev_id_from_dev_name(dev_name):\n             if dev_name in devices[d][\"Interface\"].split(\",\"):\n                 return devices[d][\"Slot\"]\n     # if nothing else matches - error\n-    print(\"Unknown device: %s. \"\n-          \"Please specify device in \\\"bus:slot.func\\\" format\" % dev_name)\n-    sys.exit(1)\n+    raise ValueError(\"Unknown device: %s. \"\n+\t    \"Please specify device in \\\"bus:slot.func\\\" format\" % dev_name)\n \n \n def unbind_one(dev_id, force):\n@@ -493,7 +492,12 @@ def unbind_all(dev_list, force=False):\n                     unbind_one(devices[d][\"Slot\"], force)\n         return\n \n-    dev_list = map(dev_id_from_dev_name, dev_list)\n+    try:\n+        dev_list = map(dev_id_from_dev_name, dev_list)\n+    except ValueError as ex:\n+        print(ex)\n+        sys.exit(1)\n+\n     for d in dev_list:\n         unbind_one(d, force)\n \n@@ -502,7 +506,23 @@ def bind_all(dev_list, driver, force=False):\n     \"\"\"Bind method, takes a list of device locations\"\"\"\n     global devices\n \n-    dev_list = map(dev_id_from_dev_name, dev_list)\n+    # a common user error is to forget to specify the driver the devices need to\n+    # be bound to. check if the driver is a valid device, and if it is, show\n+    # a meaningful error.\n+    try:\n+        dev_id_from_dev_name(driver)\n+        # if we've made it this far, this means that the \"driver\" was a valid\n+        # device string, so it's probably not a valid driver name.\n+        sys.exit(\"Error: Driver '%s' does not look like a valid driver. \" \\\n+                 \"Did you forget to specify the driver to bind devices to?\" % driver)\n+    except ValueError:\n+        # driver generated error - it's not a valid device ID, so all is well\n+        pass\n+\n+    try:\n+        dev_list = map(dev_id_from_dev_name, dev_list)\n+    except ValueError as ex:\n+        sys.exit(ex)\n \n     for d in dev_list:\n         bind_one(d, driver, force)\n",
    "prefixes": [
        "v3",
        "1/3"
    ]
}