get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 813525,
    "url": "http://patchwork.ozlabs.org/api/patches/813525/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20170913160333.23622-17-eblake@redhat.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": "<20170913160333.23622-17-eblake@redhat.com>",
    "list_archive_url": null,
    "date": "2017-09-13T16:03:26",
    "name": "[v4,16/23] qemu-img: Drop redundant error message in compare",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "91b7cc81e5a0769ca6ef92d51248aa85c574e47d",
    "submitter": {
        "id": 6591,
        "url": "http://patchwork.ozlabs.org/api/people/6591/?format=api",
        "name": "Eric Blake",
        "email": "eblake@redhat.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20170913160333.23622-17-eblake@redhat.com/mbox/",
    "series": [
        {
            "id": 2944,
            "url": "http://patchwork.ozlabs.org/api/series/2944/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=2944",
            "date": "2017-09-13T16:03:10",
            "name": "make bdrv_get_block_status byte-based",
            "version": 4,
            "mbox": "http://patchwork.ozlabs.org/series/2944/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/813525/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/813525/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=208.118.235.17; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)",
            "ext-mx07.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com",
            "ext-mx07.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=eblake@redhat.com"
        ],
        "Received": [
            "from lists.gnu.org (lists.gnu.org [208.118.235.17])\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 3xsn1S3Whyz9s72\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 14 Sep 2017 02:19:40 +1000 (AEST)",
            "from localhost ([::1]:43429 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 1dsAO2-00016j-Cc\n\tfor incoming@patchwork.ozlabs.org; Wed, 13 Sep 2017 12:19:38 -0400",
            "from eggs.gnu.org ([2001:4830:134:3::10]:46016)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1dsA9e-000202-3H\n\tfor qemu-devel@nongnu.org; Wed, 13 Sep 2017 12:04:50 -0400",
            "from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1dsA9d-0006MT-0p\n\tfor qemu-devel@nongnu.org; Wed, 13 Sep 2017 12:04:46 -0400",
            "from mx1.redhat.com ([209.132.183.28]:58350)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <eblake@redhat.com>)\n\tid 1dsA9a-0006Jy-GV; Wed, 13 Sep 2017 12:04:42 -0400",
            "from smtp.corp.redhat.com\n\t(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby mx1.redhat.com (Postfix) with ESMTPS id 9C788C04B310;\n\tWed, 13 Sep 2017 16:04:41 +0000 (UTC)",
            "from red.redhat.com (ovpn-120-201.rdu2.redhat.com [10.10.120.201])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id 81C8F19E72;\n\tWed, 13 Sep 2017 16:04:38 +0000 (UTC)"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.3.2 mx1.redhat.com 9C788C04B310",
        "From": "Eric Blake <eblake@redhat.com>",
        "To": "qemu-devel@nongnu.org",
        "Date": "Wed, 13 Sep 2017 11:03:26 -0500",
        "Message-Id": "<20170913160333.23622-17-eblake@redhat.com>",
        "In-Reply-To": "<20170913160333.23622-1-eblake@redhat.com>",
        "References": "<20170913160333.23622-1-eblake@redhat.com>",
        "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.11",
        "X-Greylist": "Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.31]);\n\tWed, 13 Sep 2017 16:04:41 +0000 (UTC)",
        "X-detected-operating-system": "by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]\n\t[fuzzy]",
        "X-Received-From": "209.132.183.28",
        "Subject": "[Qemu-devel] [PATCH v4 16/23] qemu-img: Drop redundant error\n\tmessage in compare",
        "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": "kwolf@redhat.com, jsnow@redhat.com, famz@redhat.com,\n\tqemu-block@nongnu.org, Max Reitz <mreitz@redhat.com>",
        "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": "If a read error is encountered during 'qemu-img compare', we\nwere printing the \"Error while reading offset ...\" message twice.\nUpdate the testsuite for the improved output.\n\nFurther simplify the code by hoisting the error code conversion\ninto the helper function, rather than repeating it at the callers.\n\nSigned-off-by: Eric Blake <eblake@redhat.com>\n\n---\nv3: new patch\n---\n qemu-img.c                 | 19 +++++--------------\n tests/qemu-iotests/074.out |  2 --\n 2 files changed, 5 insertions(+), 16 deletions(-)",
    "diff": "diff --git a/qemu-img.c b/qemu-img.c\nindex dfccebe6bc..3e1e373e8f 100644\n--- a/qemu-img.c\n+++ b/qemu-img.c\n@@ -1196,8 +1196,10 @@ static int64_t sectors_to_bytes(int64_t sectors)\n /*\n  * Check if passed sectors are empty (not allocated or contain only 0 bytes)\n  *\n- * Returns 0 in case sectors are filled with 0, 1 if sectors contain non-zero\n- * data and negative value on error.\n+ * Intended for use by 'qemu-img compare': Returns 0 in case sectors are\n+ * filled with 0, 1 if sectors contain non-zero data (this is a comparison\n+ * failure), and 4 on error (the exit status for read errors), after emitting\n+ * an error message.\n  *\n  * @param blk:  BlockBackend for the image\n  * @param sect_num: Number of first sector to check\n@@ -1218,7 +1220,7 @@ static int check_empty_sectors(BlockBackend *blk, int64_t sect_num,\n     if (ret < 0) {\n         error_report(\"Error while reading offset %\" PRId64 \" of %s: %s\",\n                      sectors_to_bytes(sect_num), filename, strerror(-ret));\n-        return ret;\n+        return 4;\n     }\n     idx = find_nonzero(buffer, sect_count * BDRV_SECTOR_SIZE);\n     if (idx >= 0) {\n@@ -1473,11 +1475,6 @@ static int img_compare(int argc, char **argv)\n                                           filename2, buf1, quiet);\n             }\n             if (ret) {\n-                if (ret < 0) {\n-                    error_report(\"Error while reading offset %\" PRId64 \": %s\",\n-                                 sectors_to_bytes(sector_num), strerror(-ret));\n-                    ret = 4;\n-                }\n                 goto out;\n             }\n         }\n@@ -1522,12 +1519,6 @@ static int img_compare(int argc, char **argv)\n                 ret = check_empty_sectors(blk_over, sector_num, nb_sectors,\n                                           filename_over, buf1, quiet);\n                 if (ret) {\n-                    if (ret < 0) {\n-                        error_report(\"Error while reading offset %\" PRId64\n-                                     \" of %s: %s\", sectors_to_bytes(sector_num),\n-                                     filename_over, strerror(-ret));\n-                        ret = 4;\n-                    }\n                     goto out;\n                 }\n             }\ndiff --git a/tests/qemu-iotests/074.out b/tests/qemu-iotests/074.out\nindex 8fba5aea9c..ede66c3f81 100644\n--- a/tests/qemu-iotests/074.out\n+++ b/tests/qemu-iotests/074.out\n@@ -4,7 +4,6 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824\n wrote 512/512 bytes at offset 512\n 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)\n qemu-img: Error while reading offset 0 of blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.IMGFMT: Input/output error\n-qemu-img: Error while reading offset 0: Input/output error\n 4\n Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=1073741824\n Formatting 'TEST_DIR/t.IMGFMT.2', fmt=IMGFMT size=0\n@@ -12,7 +11,6 @@ Formatting 'TEST_DIR/t.IMGFMT.2', fmt=IMGFMT size=0\n wrote 512/512 bytes at offset 512\n 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)\n qemu-img: Error while reading offset 0 of blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.IMGFMT: Input/output error\n-qemu-img: Error while reading offset 0 of blkdebug:TEST_DIR/blkdebug.conf:TEST_DIR/t.IMGFMT: Input/output error\n Warning: Image size mismatch!\n 4\n Cleanup\n",
    "prefixes": [
        "v4",
        "16/23"
    ]
}