get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 284075,
    "url": "http://patchwork.ozlabs.org/api/patches/284075/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/1381982022-19291-3-git-send-email-rusty@rustcorp.com.au/",
    "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": "<1381982022-19291-3-git-send-email-rusty@rustcorp.com.au>",
    "list_archive_url": null,
    "date": "2013-10-17T03:53:37",
    "name": "[2/7] virtio: allow byte swapping for vring and config access",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "fa911bd7e81569fb299f12163c00017a533c01c5",
    "submitter": {
        "id": 553,
        "url": "http://patchwork.ozlabs.org/api/people/553/?format=api",
        "name": "Rusty Russell",
        "email": "rusty@rustcorp.com.au"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/1381982022-19291-3-git-send-email-rusty@rustcorp.com.au/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/284075/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/284075/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",
        "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(Client did not present a certificate)\n\tby ozlabs.org (Postfix) with ESMTPS id 90FB02C008C\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 17 Oct 2013 15:00:11 +1100 (EST)",
            "from localhost ([::1]:50210 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 1VWekr-0008S9-HC\n\tfor incoming@patchwork.ozlabs.org; Thu, 17 Oct 2013 00:00:09 -0400",
            "from eggs.gnu.org ([2001:4830:134:3::10]:59674)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <rusty@ozlabs.org>) id 1VWejn-0007ff-QI\n\tfor qemu-devel@nongnu.org; Wed, 16 Oct 2013 23:59:08 -0400",
            "from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <rusty@ozlabs.org>) id 1VWejh-0001EQ-Ae\n\tfor qemu-devel@nongnu.org; Wed, 16 Oct 2013 23:59:03 -0400",
            "from ozlabs.org ([203.10.76.45]:55691)\n\tby eggs.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <rusty@ozlabs.org>) id 1VWejg-0001DS-Or\n\tfor qemu-devel@nongnu.org; Wed, 16 Oct 2013 23:58:57 -0400",
            "by ozlabs.org (Postfix, from userid 1011)\n\tid B7B092C00CC; Thu, 17 Oct 2013 14:58:50 +1100 (EST)"
        ],
        "From": "Rusty Russell <rusty@rustcorp.com.au>",
        "To": "\"Marc Zyngier\" <marc.zyngier@arm.com>,\n\tqemu-devel@nongnu.org",
        "Date": "Thu, 17 Oct 2013 14:23:37 +1030",
        "Message-Id": "<1381982022-19291-3-git-send-email-rusty@rustcorp.com.au>",
        "X-Mailer": "git-send-email 1.8.1.2",
        "In-Reply-To": "<1381982022-19291-1-git-send-email-rusty@rustcorp.com.au>",
        "References": "<1381982022-19291-1-git-send-email-rusty@rustcorp.com.au>",
        "X-detected-operating-system": "by eggs.gnu.org: GNU/Linux 3.x",
        "X-Received-From": "203.10.76.45",
        "Cc": "Rusty Russell <rusty@rustcorp.com.au>",
        "Subject": "[Qemu-devel] [PATCH 2/7] virtio: allow byte swapping for vring and\n\tconfig access",
        "X-BeenThere": "qemu-devel@nongnu.org",
        "X-Mailman-Version": "2.1.14",
        "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>",
        "Errors-To": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org",
        "Sender": "qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"
    },
    "content": "This is based on a simpler patch by Anthony Liguouri, which only handled\nthe vring accesses.  We also need some drivers to access these helpers,\neg. for data which contains headers.\n\nSigned-off-by: Rusty Russell <rusty@rustcorp.com.au>\n---\n hw/virtio/virtio.c | 28 ++++++++++++++--------------\n 1 file changed, 14 insertions(+), 14 deletions(-)",
    "diff": "diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c\nindex 7730780..bbf9f15 100644\n--- a/hw/virtio/virtio.c\n+++ b/hw/virtio/virtio.c\n@@ -107,49 +107,49 @@ static inline uint64_t vring_desc_addr(hwaddr desc_pa, int i)\n {\n     hwaddr pa;\n     pa = desc_pa + sizeof(VRingDesc) * i + offsetof(VRingDesc, addr);\n-    return ldq_phys(pa);\n+    return virtio_ldq_phys(pa);\n }\n \n static inline uint32_t vring_desc_len(hwaddr desc_pa, int i)\n {\n     hwaddr pa;\n     pa = desc_pa + sizeof(VRingDesc) * i + offsetof(VRingDesc, len);\n-    return ldl_phys(pa);\n+    return virtio_ldl_phys(pa);\n }\n \n static inline uint16_t vring_desc_flags(hwaddr desc_pa, int i)\n {\n     hwaddr pa;\n     pa = desc_pa + sizeof(VRingDesc) * i + offsetof(VRingDesc, flags);\n-    return lduw_phys(pa);\n+    return virtio_lduw_phys(pa);\n }\n \n static inline uint16_t vring_desc_next(hwaddr desc_pa, int i)\n {\n     hwaddr pa;\n     pa = desc_pa + sizeof(VRingDesc) * i + offsetof(VRingDesc, next);\n-    return lduw_phys(pa);\n+    return virtio_lduw_phys(pa);\n }\n \n static inline uint16_t vring_avail_flags(VirtQueue *vq)\n {\n     hwaddr pa;\n     pa = vq->vring.avail + offsetof(VRingAvail, flags);\n-    return lduw_phys(pa);\n+    return virtio_lduw_phys(pa);\n }\n \n static inline uint16_t vring_avail_idx(VirtQueue *vq)\n {\n     hwaddr pa;\n     pa = vq->vring.avail + offsetof(VRingAvail, idx);\n-    return lduw_phys(pa);\n+    return virtio_lduw_phys(pa);\n }\n \n static inline uint16_t vring_avail_ring(VirtQueue *vq, int i)\n {\n     hwaddr pa;\n     pa = vq->vring.avail + offsetof(VRingAvail, ring[i]);\n-    return lduw_phys(pa);\n+    return virtio_lduw_phys(pa);\n }\n \n static inline uint16_t vring_used_event(VirtQueue *vq)\n@@ -161,42 +161,42 @@ static inline void vring_used_ring_id(VirtQueue *vq, int i, uint32_t val)\n {\n     hwaddr pa;\n     pa = vq->vring.used + offsetof(VRingUsed, ring[i].id);\n-    stl_phys(pa, val);\n+    virtio_stl_phys(pa, val);\n }\n \n static inline void vring_used_ring_len(VirtQueue *vq, int i, uint32_t val)\n {\n     hwaddr pa;\n     pa = vq->vring.used + offsetof(VRingUsed, ring[i].len);\n-    stl_phys(pa, val);\n+    virtio_stl_phys(pa, val);\n }\n \n static uint16_t vring_used_idx(VirtQueue *vq)\n {\n     hwaddr pa;\n     pa = vq->vring.used + offsetof(VRingUsed, idx);\n-    return lduw_phys(pa);\n+    return virtio_lduw_phys(pa);\n }\n \n static inline void vring_used_idx_set(VirtQueue *vq, uint16_t val)\n {\n     hwaddr pa;\n     pa = vq->vring.used + offsetof(VRingUsed, idx);\n-    stw_phys(pa, val);\n+    virtio_stw_phys(pa, val);\n }\n \n static inline void vring_used_flags_set_bit(VirtQueue *vq, int mask)\n {\n     hwaddr pa;\n     pa = vq->vring.used + offsetof(VRingUsed, flags);\n-    stw_phys(pa, lduw_phys(pa) | mask);\n+    virtio_stw_phys(pa, virtio_lduw_phys(pa) | mask);\n }\n \n static inline void vring_used_flags_unset_bit(VirtQueue *vq, int mask)\n {\n     hwaddr pa;\n     pa = vq->vring.used + offsetof(VRingUsed, flags);\n-    stw_phys(pa, lduw_phys(pa) & ~mask);\n+    virtio_stw_phys(pa, virtio_lduw_phys(pa) & ~mask);\n }\n \n static inline void vring_avail_event(VirtQueue *vq, uint16_t val)\n@@ -206,7 +206,7 @@ static inline void vring_avail_event(VirtQueue *vq, uint16_t val)\n         return;\n     }\n     pa = vq->vring.used + offsetof(VRingUsed, ring[vq->vring.num]);\n-    stw_phys(pa, val);\n+    virtio_stw_phys(pa, val);\n }\n \n void virtio_queue_set_notification(VirtQueue *vq, int enable)\n",
    "prefixes": [
        "2/7"
    ]
}