get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 813062,
    "url": "http://patchwork.ozlabs.org/api/patches/813062/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20170912203119.24166-13-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": "<20170912203119.24166-13-eblake@redhat.com>",
    "list_archive_url": null,
    "date": "2017-09-12T20:31:11",
    "name": "[v7,12/20] dirty-bitmap: Change bdrv_get_dirty_count() to report bytes",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "c9a792a8684760f28f02cfd79a7bcfc7fb739706",
    "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/20170912203119.24166-13-eblake@redhat.com/mbox/",
    "series": [
        {
            "id": 2770,
            "url": "http://patchwork.ozlabs.org/api/series/2770/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=2770",
            "date": "2017-09-12T20:31:00",
            "name": "make dirty-bitmap byte-based",
            "version": 7,
            "mbox": "http://patchwork.ozlabs.org/series/2770/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/813062/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/813062/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>)",
            "ext-mx05.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com",
            "ext-mx05.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=eblake@redhat.com"
        ],
        "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(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xsGsz3Zzkz9sPk\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 13 Sep 2017 06:41:27 +1000 (AEST)",
            "from localhost ([::1]:38490 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 1drrzp-0003C7-Ge\n\tfor incoming@patchwork.ozlabs.org; Tue, 12 Sep 2017 16:41:25 -0400",
            "from eggs.gnu.org ([2001:4830:134:3::10]:39636)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1drrqm-0001zC-NV\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 16:32:05 -0400",
            "from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <eblake@redhat.com>) id 1drrql-0006DA-HV\n\tfor qemu-devel@nongnu.org; Tue, 12 Sep 2017 16:32:04 -0400",
            "from mx1.redhat.com ([209.132.183.28]:46924)\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 1drrqg-000669-Ts; Tue, 12 Sep 2017 16:31:59 -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 EF48713AAE;\n\tTue, 12 Sep 2017 20:31:57 +0000 (UTC)",
            "from red.redhat.com (ovpn-120-44.rdu2.redhat.com [10.10.120.44])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id ECDC45C6D7;\n\tTue, 12 Sep 2017 20:31:52 +0000 (UTC)"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.3.2 mx1.redhat.com EF48713AAE",
        "From": "Eric Blake <eblake@redhat.com>",
        "To": "qemu-devel@nongnu.org",
        "Date": "Tue, 12 Sep 2017 15:31:11 -0500",
        "Message-Id": "<20170912203119.24166-13-eblake@redhat.com>",
        "In-Reply-To": "<20170912203119.24166-1-eblake@redhat.com>",
        "References": "<20170912203119.24166-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.29]);\n\tTue, 12 Sep 2017 20:31:58 +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 v7 12/20] dirty-bitmap: Change\n\tbdrv_get_dirty_count() to report bytes",
        "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, vsementsov@virtuozzo.com, Fam Zheng <famz@redhat.com>, \n\tqemu-block@nongnu.org, Juan Quintela <quintela@redhat.com>,\n\tJeff Cody <jcody@redhat.com>,\n\t\"Dr. David Alan Gilbert\" <dgilbert@redhat.com>,\n\tMax Reitz <mreitz@redhat.com>,\n\tStefan Hajnoczi <stefanha@redhat.com>, jsnow@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": "Thanks to recent cleanups, all callers were scaling a return value\nof sectors into bytes; do the scaling internally instead.\n\nSigned-off-by: Eric Blake <eblake@redhat.com>\n\n---\nv7: fix one more trace caller [Kevin]\nv4-v6: no change\nv3: no change, add R-b\nv2: no change\n---\n block/dirty-bitmap.c |  4 ++--\n block/mirror.c       | 16 ++++++----------\n migration/block.c    |  2 +-\n 3 files changed, 9 insertions(+), 13 deletions(-)",
    "diff": "diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c\nindex 49229fd501..ee0afb5e1a 100644\n--- a/block/dirty-bitmap.c\n+++ b/block/dirty-bitmap.c\n@@ -428,7 +428,7 @@ BlockDirtyInfoList *bdrv_query_dirty_bitmaps(BlockDriverState *bs)\n     QLIST_FOREACH(bm, &bs->dirty_bitmaps, list) {\n         BlockDirtyInfo *info = g_new0(BlockDirtyInfo, 1);\n         BlockDirtyInfoList *entry = g_new0(BlockDirtyInfoList, 1);\n-        info->count = bdrv_get_dirty_count(bm) << BDRV_SECTOR_BITS;\n+        info->count = bdrv_get_dirty_count(bm);\n         info->granularity = bdrv_dirty_bitmap_granularity(bm);\n         info->has_name = !!bm->name;\n         info->name = g_strdup(bm->name);\n@@ -657,7 +657,7 @@ void bdrv_set_dirty_iter(BdrvDirtyBitmapIter *iter, int64_t offset)\n\n int64_t bdrv_get_dirty_count(BdrvDirtyBitmap *bitmap)\n {\n-    return hbitmap_count(bitmap->bitmap);\n+    return hbitmap_count(bitmap->bitmap) << BDRV_SECTOR_BITS;\n }\n\n int64_t bdrv_get_meta_dirty_count(BdrvDirtyBitmap *bitmap)\ndiff --git a/block/mirror.c b/block/mirror.c\nindex 77bf5aa3a4..7113d47db4 100644\n--- a/block/mirror.c\n+++ b/block/mirror.c\n@@ -340,8 +340,7 @@ static uint64_t coroutine_fn mirror_iteration(MirrorBlockJob *s)\n     if (offset < 0) {\n         bdrv_set_dirty_iter(s->dbi, 0);\n         offset = bdrv_dirty_iter_next(s->dbi);\n-        trace_mirror_restart_iter(s, bdrv_get_dirty_count(s->dirty_bitmap) *\n-                                  BDRV_SECTOR_SIZE);\n+        trace_mirror_restart_iter(s, bdrv_get_dirty_count(s->dirty_bitmap));\n         assert(offset >= 0);\n     }\n     bdrv_dirty_bitmap_unlock(s->dirty_bitmap);\n@@ -811,11 +810,10 @@ static void coroutine_fn mirror_run(void *opaque)\n\n         cnt = bdrv_get_dirty_count(s->dirty_bitmap);\n         /* s->common.offset contains the number of bytes already processed so\n-         * far, cnt is the number of dirty sectors remaining and\n+         * far, cnt is the number of dirty bytes remaining and\n          * s->bytes_in_flight is the number of bytes currently being\n          * processed; together those are the current total operation length */\n-        s->common.len = s->common.offset + s->bytes_in_flight +\n-            cnt * BDRV_SECTOR_SIZE;\n+        s->common.len = s->common.offset + s->bytes_in_flight + cnt;\n\n         /* Note that even when no rate limit is applied we need to yield\n          * periodically with no pending I/O so that bdrv_drain_all() returns.\n@@ -827,8 +825,7 @@ static void coroutine_fn mirror_run(void *opaque)\n             s->common.iostatus == BLOCK_DEVICE_IO_STATUS_OK) {\n             if (s->in_flight >= MAX_IN_FLIGHT || s->buf_free_count == 0 ||\n                 (cnt == 0 && s->in_flight > 0)) {\n-                trace_mirror_yield(s, cnt * BDRV_SECTOR_SIZE,\n-                                   s->buf_free_count, s->in_flight);\n+                trace_mirror_yield(s, cnt, s->buf_free_count, s->in_flight);\n                 mirror_wait_for_io(s);\n                 continue;\n             } else if (cnt != 0) {\n@@ -869,7 +866,7 @@ static void coroutine_fn mirror_run(void *opaque)\n              * whether to switch to target check one last time if I/O has\n              * come in the meanwhile, and if not flush the data to disk.\n              */\n-            trace_mirror_before_drain(s, cnt * BDRV_SECTOR_SIZE);\n+            trace_mirror_before_drain(s, cnt);\n\n             bdrv_drained_begin(bs);\n             cnt = bdrv_get_dirty_count(s->dirty_bitmap);\n@@ -888,8 +885,7 @@ static void coroutine_fn mirror_run(void *opaque)\n         }\n\n         ret = 0;\n-        trace_mirror_before_sleep(s, cnt * BDRV_SECTOR_SIZE,\n-                                  s->synced, delay_ns);\n+        trace_mirror_before_sleep(s, cnt, s->synced, delay_ns);\n         if (!s->synced) {\n             block_job_sleep_ns(&s->common, QEMU_CLOCK_REALTIME, delay_ns);\n             if (block_job_is_cancelled(&s->common)) {\ndiff --git a/migration/block.c b/migration/block.c\nindex 9171f60028..a3512945da 100644\n--- a/migration/block.c\n+++ b/migration/block.c\n@@ -667,7 +667,7 @@ static int64_t get_remaining_dirty(void)\n         aio_context_release(blk_get_aio_context(bmds->blk));\n     }\n\n-    return dirty << BDRV_SECTOR_BITS;\n+    return dirty;\n }\n\n\n",
    "prefixes": [
        "v7",
        "12/20"
    ]
}