get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 985243,
    "url": "http://patchwork.ozlabs.org/api/patches/985243/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20181017082702.5581-38-armbru@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": "<20181017082702.5581-38-armbru@redhat.com>",
    "list_archive_url": null,
    "date": "2018-10-17T08:27:01",
    "name": "[v4,37/38] raw: Convert a warning to warn_report()",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "dfd8a76ffc186819e403f791454a1fd21d6aa5e5",
    "submitter": {
        "id": 2645,
        "url": "http://patchwork.ozlabs.org/api/people/2645/?format=api",
        "name": "Markus Armbruster",
        "email": "armbru@redhat.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20181017082702.5581-38-armbru@redhat.com/mbox/",
    "series": [
        {
            "id": 71196,
            "url": "http://patchwork.ozlabs.org/api/series/71196/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=71196",
            "date": "2018-10-17T08:26:36",
            "name": "Replace some unwise uses of error_report() & friends",
            "version": 4,
            "mbox": "http://patchwork.ozlabs.org/series/71196/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/985243/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/985243/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>)",
            "ozlabs.org;\n\tdmarc=fail (p=none dis=none) header.from=redhat.com"
        ],
        "Received": [
            "from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 42ZmC73Hj5z9s55\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 17 Oct 2018 19:52:17 +1100 (AEDT)",
            "from localhost ([::1]:34623 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 1gChYs-0003du-8A\n\tfor incoming@patchwork.ozlabs.org; Wed, 17 Oct 2018 04:52:14 -0400",
            "from eggs.gnu.org ([2001:4830:134:3::10]:51473)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <armbru@redhat.com>) id 1gChB4-0000Kx-Ux\n\tfor qemu-devel@nongnu.org; Wed, 17 Oct 2018 04:27:40 -0400",
            "from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <armbru@redhat.com>) id 1gChB2-0001yf-5u\n\tfor qemu-devel@nongnu.org; Wed, 17 Oct 2018 04:27:38 -0400",
            "from mx1.redhat.com ([209.132.183.28]:41244)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <armbru@redhat.com>) id 1gChB1-00018X-N4\n\tfor qemu-devel@nongnu.org; Wed, 17 Oct 2018 04:27:35 -0400",
            "from smtp.corp.redhat.com\n\t(int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15])\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 24001D3C14\n\tfor <qemu-devel@nongnu.org>; Wed, 17 Oct 2018 08:27:11 +0000 (UTC)",
            "from blackfin.pond.sub.org (ovpn-116-50.ams2.redhat.com\n\t[10.36.116.50])\n\tby smtp.corp.redhat.com (Postfix) with ESMTPS id 8BCAE18763;\n\tWed, 17 Oct 2018 08:27:10 +0000 (UTC)",
            "by blackfin.pond.sub.org (Postfix, from userid 1000)\n\tid 9B12C1162B62; Wed, 17 Oct 2018 10:27:02 +0200 (CEST)"
        ],
        "From": "Markus Armbruster <armbru@redhat.com>",
        "To": "qemu-devel@nongnu.org",
        "Date": "Wed, 17 Oct 2018 10:27:01 +0200",
        "Message-Id": "<20181017082702.5581-38-armbru@redhat.com>",
        "In-Reply-To": "<20181017082702.5581-1-armbru@redhat.com>",
        "References": "<20181017082702.5581-1-armbru@redhat.com>",
        "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.15",
        "X-Greylist": "Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.38]);\n\tWed, 17 Oct 2018 08:27:11 +0000 (UTC)",
        "X-detected-operating-system": "by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]",
        "X-Received-From": "209.132.183.28",
        "Subject": "[Qemu-devel] [PATCH v4 37/38] raw: Convert a warning to\n\twarn_report()",
        "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": "Kevin Wolf <kwolf@redhat.com>, 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": "Convert the warning about dangerous automatic probing of raw images to\nwarn_report().  Split its text to conform to conventions spelled out\nin warn_report()'s contract.\n\nUpdate expected output of qemu-iotest 109 accordingly.  Update\nqemu-iotest 099's output filtering to keep filtering out the warning.\n\nCc: Kevin Wolf <kwolf@redhat.com>\nCc: Max Reitz <mreitz@redhat.com>\nSigned-off-by: Markus Armbruster <armbru@redhat.com>\n---\n block/raw-format.c         | 17 ++++++------\n tests/qemu-iotests/099     |  3 ++-\n tests/qemu-iotests/109.out | 55 +++++++++++++++++++++++---------------\n 3 files changed, 44 insertions(+), 31 deletions(-)",
    "diff": "diff --git a/block/raw-format.c b/block/raw-format.c\nindex 6f6dc99b2c..d65fd0ffce 100644\n--- a/block/raw-format.c\n+++ b/block/raw-format.c\n@@ -29,6 +29,7 @@\n #include \"qemu/osdep.h\"\n #include \"block/block_int.h\"\n #include \"qapi/error.h\"\n+#include \"qemu/error-report.h\"\n #include \"qemu/option.h\"\n \n typedef struct BDRVRawState {\n@@ -436,14 +437,14 @@ static int raw_open(BlockDriverState *bs, QDict *options, int flags,\n             bs->file->bs->supported_zero_flags);\n \n     if (bs->probed && !bdrv_is_read_only(bs)) {\n-        fprintf(stderr,\n-                \"WARNING: Image format was not specified for '%s' and probing \"\n-                \"guessed raw.\\n\"\n-                \"         Automatically detecting the format is dangerous for \"\n-                \"raw images, write operations on block 0 will be restricted.\\n\"\n-                \"         Specify the 'raw' format explicitly to remove the \"\n-                \"restrictions.\\n\",\n-                bs->file->bs->filename);\n+        warn_report(\"Image format was not specified for '%s' and probing \"\n+                    \"guessed raw\",\n+                    bs->file->bs->filename);\n+        error_printf(\"Automatically detecting the format is dangerous for \"\n+                     \"raw images, write\\n\"\n+                     \"operations on block 0 will be restricted.\\n\"\n+                     \"Specify the 'raw' format explicitly to remove the \"\n+                     \"restrictions.\\n\");\n     }\n \n     ret = raw_read_options(options, bs, s, errp);\ndiff --git a/tests/qemu-iotests/099 b/tests/qemu-iotests/099\nindex caaf58eee5..f2a62448d8 100755\n--- a/tests/qemu-iotests/099\n+++ b/tests/qemu-iotests/099\n@@ -57,7 +57,8 @@ function run_qemu()\n     # which is how we can extract it)\n     do_run_qemu \"$@\" 2>&1 | _filter_testdir | _filter_imgfmt | _filter_qmp \\\n         | _filter_qemu | grep \"drv0\" \\\n-        | sed -e 's/^.*\"file\": \"\\(\\(\\\\\"\\|[^\"]\\)*\\)\".*$/\\1/' -e 's/\\\\\"/\"/g'\n+        | sed -e 's/^.*\"file\": \"\\(\\(\\\\\"\\|[^\"]\\)*\\)\".*$/\\1/' -e 's/\\\\\"/\"/g' \\\n+\t      -e '/probing guessed raw/d'\n }\n \n function test_qemu()\ndiff --git a/tests/qemu-iotests/109.out b/tests/qemu-iotests/109.out\nindex ad0ee6fb48..99add53271 100644\n--- a/tests/qemu-iotests/109.out\n+++ b/tests/qemu-iotests/109.out\n@@ -5,8 +5,9 @@ QA output created by 109\n Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864\n Formatting 'TEST_DIR/t.raw.src', fmt=IMGFMT size=67108864\n {\"return\": {}}\n-WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed raw.\n-         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.\n+warning: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed raw\n+Automatically detecting the format is dangerous for raw images, write\n+operations on block 0 will be restricted.\n          Specify the 'raw' format explicitly to remove the restrictions.\n {\"timestamp\": {\"seconds\":  TIMESTAMP, \"microseconds\":  TIMESTAMP}, \"event\": \"JOB_STATUS_CHANGE\", \"data\": {\"status\": \"created\", \"id\": \"src\"}}\n {\"timestamp\": {\"seconds\":  TIMESTAMP, \"microseconds\":  TIMESTAMP}, \"event\": \"JOB_STATUS_CHANGE\", \"data\": {\"status\": \"running\", \"id\": \"src\"}}\n@@ -43,8 +44,9 @@ Images are identical.\n Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864\n Formatting 'TEST_DIR/t.raw.src', fmt=IMGFMT size=67108864\n {\"return\": {}}\n-WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed raw.\n-         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.\n+warning: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed raw\n+Automatically detecting the format is dangerous for raw images, write\n+operations on block 0 will be restricted.\n          Specify the 'raw' format explicitly to remove the restrictions.\n {\"timestamp\": {\"seconds\":  TIMESTAMP, \"microseconds\":  TIMESTAMP}, \"event\": \"JOB_STATUS_CHANGE\", \"data\": {\"status\": \"created\", \"id\": \"src\"}}\n {\"timestamp\": {\"seconds\":  TIMESTAMP, \"microseconds\":  TIMESTAMP}, \"event\": \"JOB_STATUS_CHANGE\", \"data\": {\"status\": \"running\", \"id\": \"src\"}}\n@@ -81,8 +83,9 @@ Images are identical.\n Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864\n Formatting 'TEST_DIR/t.raw.src', fmt=IMGFMT size=67108864\n {\"return\": {}}\n-WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed raw.\n-         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.\n+warning: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed raw\n+Automatically detecting the format is dangerous for raw images, write\n+operations on block 0 will be restricted.\n          Specify the 'raw' format explicitly to remove the restrictions.\n {\"timestamp\": {\"seconds\":  TIMESTAMP, \"microseconds\":  TIMESTAMP}, \"event\": \"JOB_STATUS_CHANGE\", \"data\": {\"status\": \"created\", \"id\": \"src\"}}\n {\"timestamp\": {\"seconds\":  TIMESTAMP, \"microseconds\":  TIMESTAMP}, \"event\": \"JOB_STATUS_CHANGE\", \"data\": {\"status\": \"running\", \"id\": \"src\"}}\n@@ -119,8 +122,9 @@ Images are identical.\n Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864\n Formatting 'TEST_DIR/t.raw.src', fmt=IMGFMT size=67108864\n {\"return\": {}}\n-WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed raw.\n-         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.\n+warning: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed raw\n+Automatically detecting the format is dangerous for raw images, write\n+operations on block 0 will be restricted.\n          Specify the 'raw' format explicitly to remove the restrictions.\n {\"timestamp\": {\"seconds\":  TIMESTAMP, \"microseconds\":  TIMESTAMP}, \"event\": \"JOB_STATUS_CHANGE\", \"data\": {\"status\": \"created\", \"id\": \"src\"}}\n {\"timestamp\": {\"seconds\":  TIMESTAMP, \"microseconds\":  TIMESTAMP}, \"event\": \"JOB_STATUS_CHANGE\", \"data\": {\"status\": \"running\", \"id\": \"src\"}}\n@@ -157,8 +161,9 @@ Images are identical.\n Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864\n Formatting 'TEST_DIR/t.raw.src', fmt=IMGFMT size=67108864\n {\"return\": {}}\n-WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed raw.\n-         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.\n+warning: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed raw\n+Automatically detecting the format is dangerous for raw images, write\n+operations on block 0 will be restricted.\n          Specify the 'raw' format explicitly to remove the restrictions.\n {\"timestamp\": {\"seconds\":  TIMESTAMP, \"microseconds\":  TIMESTAMP}, \"event\": \"JOB_STATUS_CHANGE\", \"data\": {\"status\": \"created\", \"id\": \"src\"}}\n {\"timestamp\": {\"seconds\":  TIMESTAMP, \"microseconds\":  TIMESTAMP}, \"event\": \"JOB_STATUS_CHANGE\", \"data\": {\"status\": \"running\", \"id\": \"src\"}}\n@@ -195,8 +200,9 @@ Images are identical.\n Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864\n Formatting 'TEST_DIR/t.raw.src', fmt=IMGFMT size=67108864\n {\"return\": {}}\n-WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed raw.\n-         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.\n+warning: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed raw\n+Automatically detecting the format is dangerous for raw images, write\n+operations on block 0 will be restricted.\n          Specify the 'raw' format explicitly to remove the restrictions.\n {\"timestamp\": {\"seconds\":  TIMESTAMP, \"microseconds\":  TIMESTAMP}, \"event\": \"JOB_STATUS_CHANGE\", \"data\": {\"status\": \"created\", \"id\": \"src\"}}\n {\"timestamp\": {\"seconds\":  TIMESTAMP, \"microseconds\":  TIMESTAMP}, \"event\": \"JOB_STATUS_CHANGE\", \"data\": {\"status\": \"running\", \"id\": \"src\"}}\n@@ -232,8 +238,9 @@ Images are identical.\n \n Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864\n {\"return\": {}}\n-WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed raw.\n-         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.\n+warning: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed raw\n+Automatically detecting the format is dangerous for raw images, write\n+operations on block 0 will be restricted.\n          Specify the 'raw' format explicitly to remove the restrictions.\n {\"timestamp\": {\"seconds\":  TIMESTAMP, \"microseconds\":  TIMESTAMP}, \"event\": \"JOB_STATUS_CHANGE\", \"data\": {\"status\": \"created\", \"id\": \"src\"}}\n {\"timestamp\": {\"seconds\":  TIMESTAMP, \"microseconds\":  TIMESTAMP}, \"event\": \"JOB_STATUS_CHANGE\", \"data\": {\"status\": \"running\", \"id\": \"src\"}}\n@@ -269,8 +276,9 @@ Images are identical.\n \n Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864\n {\"return\": {}}\n-WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed raw.\n-         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.\n+warning: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed raw\n+Automatically detecting the format is dangerous for raw images, write\n+operations on block 0 will be restricted.\n          Specify the 'raw' format explicitly to remove the restrictions.\n {\"timestamp\": {\"seconds\":  TIMESTAMP, \"microseconds\":  TIMESTAMP}, \"event\": \"JOB_STATUS_CHANGE\", \"data\": {\"status\": \"created\", \"id\": \"src\"}}\n {\"timestamp\": {\"seconds\":  TIMESTAMP, \"microseconds\":  TIMESTAMP}, \"event\": \"JOB_STATUS_CHANGE\", \"data\": {\"status\": \"running\", \"id\": \"src\"}}\n@@ -306,8 +314,9 @@ Images are identical.\n \n Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864\n {\"return\": {}}\n-WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed raw.\n-         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.\n+warning: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed raw\n+Automatically detecting the format is dangerous for raw images, write\n+operations on block 0 will be restricted.\n          Specify the 'raw' format explicitly to remove the restrictions.\n {\"timestamp\": {\"seconds\":  TIMESTAMP, \"microseconds\":  TIMESTAMP}, \"event\": \"JOB_STATUS_CHANGE\", \"data\": {\"status\": \"created\", \"id\": \"src\"}}\n {\"timestamp\": {\"seconds\":  TIMESTAMP, \"microseconds\":  TIMESTAMP}, \"event\": \"JOB_STATUS_CHANGE\", \"data\": {\"status\": \"running\", \"id\": \"src\"}}\n@@ -343,8 +352,9 @@ Images are identical.\n \n Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864\n {\"return\": {}}\n-WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed raw.\n-         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.\n+warning: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed raw\n+Automatically detecting the format is dangerous for raw images, write\n+operations on block 0 will be restricted.\n          Specify the 'raw' format explicitly to remove the restrictions.\n {\"timestamp\": {\"seconds\":  TIMESTAMP, \"microseconds\":  TIMESTAMP}, \"event\": \"JOB_STATUS_CHANGE\", \"data\": {\"status\": \"created\", \"id\": \"src\"}}\n {\"timestamp\": {\"seconds\":  TIMESTAMP, \"microseconds\":  TIMESTAMP}, \"event\": \"JOB_STATUS_CHANGE\", \"data\": {\"status\": \"running\", \"id\": \"src\"}}\n@@ -380,8 +390,9 @@ Images are identical.\n \n Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864\n {\"return\": {}}\n-WARNING: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed raw.\n-         Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.\n+warning: Image format was not specified for 'TEST_DIR/t.raw' and probing guessed raw\n+Automatically detecting the format is dangerous for raw images, write\n+operations on block 0 will be restricted.\n          Specify the 'raw' format explicitly to remove the restrictions.\n {\"timestamp\": {\"seconds\":  TIMESTAMP, \"microseconds\":  TIMESTAMP}, \"event\": \"JOB_STATUS_CHANGE\", \"data\": {\"status\": \"created\", \"id\": \"src\"}}\n {\"timestamp\": {\"seconds\":  TIMESTAMP, \"microseconds\":  TIMESTAMP}, \"event\": \"JOB_STATUS_CHANGE\", \"data\": {\"status\": \"running\", \"id\": \"src\"}}\n",
    "prefixes": [
        "v4",
        "37/38"
    ]
}