Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.2/patches/811637/?format=api
{ "id": 811637, "url": "http://patchwork.ozlabs.org/api/1.2/patches/811637/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/1504880304-12069-18-git-send-email-mst@redhat.com/", "project": { "id": 14, "url": "http://patchwork.ozlabs.org/api/1.2/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": "<1504880304-12069-18-git-send-email-mst@redhat.com>", "list_archive_url": null, "date": "2017-09-08T14:19:44", "name": "[PULL,17/17] fw_cfg: rename read callback", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "78a24b2690ad97b6c08ea5b4d46be29c5b98a49b", "submitter": { "id": 2235, "url": "http://patchwork.ozlabs.org/api/1.2/people/2235/?format=api", "name": "Michael S. Tsirkin", "email": "mst@redhat.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/1504880304-12069-18-git-send-email-mst@redhat.com/mbox/", "series": [ { "id": 2227, "url": "http://patchwork.ozlabs.org/api/1.2/series/2227/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=2227", "date": "2017-09-08T14:18:52", "name": "[PULL,01/17] vhost: Release memory references on cleanup", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/2227/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/811637/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/811637/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-mx10.extmail.prod.ext.phx2.redhat.com;\n\tdmarc=none (p=none dis=none) header.from=redhat.com", "ext-mx10.extmail.prod.ext.phx2.redhat.com;\n\tspf=fail smtp.mailfrom=mst@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 3xpftv3zBNz9s7G\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 9 Sep 2017 00:33:10 +1000 (AEST)", "from localhost ([::1]:45732 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 1dqKLD-0002ef-V4\n\tfor incoming@patchwork.ozlabs.org; Fri, 08 Sep 2017 10:33:07 -0400", "from eggs.gnu.org ([2001:4830:134:3::10]:49350)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <mst@redhat.com>) id 1dqK8V-0007Bq-3m\n\tfor qemu-devel@nongnu.org; Fri, 08 Sep 2017 10:20:00 -0400", "from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <mst@redhat.com>) id 1dqK8Q-0005Wc-O4\n\tfor qemu-devel@nongnu.org; Fri, 08 Sep 2017 10:19:59 -0400", "from mx1.redhat.com ([209.132.183.28]:59862)\n\tby eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <mst@redhat.com>) id 1dqK8Q-0005V6-DQ\n\tfor qemu-devel@nongnu.org; Fri, 08 Sep 2017 10:19:54 -0400", "from smtp.corp.redhat.com\n\t(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])\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 699C25AFED;\n\tFri, 8 Sep 2017 14:19:53 +0000 (UTC)", "from redhat.com (ovpn-120-144.rdu2.redhat.com [10.10.120.144])\n\tby smtp.corp.redhat.com (Postfix) with ESMTP id BF32D619C3;\n\tFri, 8 Sep 2017 14:19:44 +0000 (UTC)" ], "DMARC-Filter": "OpenDMARC Filter v1.3.2 mx1.redhat.com 699C25AFED", "Date": "Fri, 8 Sep 2017 17:19:44 +0300", "From": "\"Michael S. Tsirkin\" <mst@redhat.com>", "To": "qemu-devel@nongnu.org", "Message-ID": "<1504880304-12069-18-git-send-email-mst@redhat.com>", "References": "<1504880304-12069-1-git-send-email-mst@redhat.com>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=utf-8", "Content-Disposition": "inline", "In-Reply-To": "<1504880304-12069-1-git-send-email-mst@redhat.com>", "X-Mutt-Fcc": "=sent", "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.12", "X-Greylist": "Sender IP whitelisted, not delayed by milter-greylist-4.5.16\n\t(mx1.redhat.com [10.5.110.39]);\n\tFri, 08 Sep 2017 14:19:53 +0000 (UTC)", "Content-Transfer-Encoding": "quoted-printable", "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] [PULL 17/17] fw_cfg: rename read callback", "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": "Peter Maydell <peter.maydell@linaro.org>, Eduardo Habkost\n\t<ehabkost@redhat.com>, Gabriel Somlo <somlo@cmu.edu>, Mark Cave-Ayland\n\t<mark.cave-ayland@ilande.co.uk>, Philippe =?utf-8?q?Mathieu-Daud=C3=A9?=\n\t<f4bug@amsat.org>, \tAlistair Francis <alistair.francis@xilinx.com>,\n\tChristian Borntraeger <borntraeger@de.ibm.com>, \n\tMarcel Apfelbaum <marcel@redhat.com>, =?utf-8?q?Marc-Andr=C3=A9?=\n\tLureau <marcandre.lureau@redhat.com>, \tLaszlo Ersek <lersek@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": "From: Marc-André Lureau <marcandre.lureau@redhat.com>\n\nThe callback is called on select.\n\nFurthermore, the next patch introduced a new callback, so rename the\nfunction type with a generic name.\n\nSigned-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>\nReviewed-by: Michael S. Tsirkin <mst@redhat.com>\nSigned-off-by: Michael S. Tsirkin <mst@redhat.com>\n---\n include/hw/loader.h | 2 +-\n include/hw/nvram/fw_cfg.h | 7 ++++---\n hw/core/loader.c | 2 +-\n hw/nvram/fw_cfg.c | 30 ++++++++++++++++--------------\n 4 files changed, 22 insertions(+), 19 deletions(-)", "diff": "diff --git a/include/hw/loader.h b/include/hw/loader.h\nindex 490c9ff..355fe0f 100644\n--- a/include/hw/loader.h\n+++ b/include/hw/loader.h\n@@ -192,7 +192,7 @@ int rom_add_file(const char *file, const char *fw_dir,\n MemoryRegion *rom_add_blob(const char *name, const void *blob, size_t len,\n size_t max_len, hwaddr addr,\n const char *fw_file_name,\n- FWCfgReadCallback fw_callback,\n+ FWCfgCallback fw_callback,\n void *callback_opaque, AddressSpace *as,\n bool read_only);\n int rom_add_elf_program(const char *name, void *data, size_t datasize,\ndiff --git a/include/hw/nvram/fw_cfg.h b/include/hw/nvram/fw_cfg.h\nindex b77ea48..f50d068 100644\n--- a/include/hw/nvram/fw_cfg.h\n+++ b/include/hw/nvram/fw_cfg.h\n@@ -44,7 +44,7 @@ typedef struct FWCfgDmaAccess {\n uint64_t address;\n } QEMU_PACKED FWCfgDmaAccess;\n \n-typedef void (*FWCfgReadCallback)(void *opaque);\n+typedef void (*FWCfgCallback)(void *opaque);\n \n struct FWCfgState {\n /*< private >*/\n@@ -182,7 +182,7 @@ void fw_cfg_add_file(FWCfgState *s, const char *filename, void *data,\n * fw_cfg_add_file_callback:\n * @s: fw_cfg device being modified\n * @filename: name of new fw_cfg file item\n- * @callback: callback function\n+ * @select_cb: callback function when selecting\n * @callback_opaque: argument to be passed into callback function\n * @data: pointer to start of item data\n * @len: size of item data\n@@ -201,7 +201,8 @@ void fw_cfg_add_file(FWCfgState *s, const char *filename, void *data,\n * with FW_CFG_DMA_CTL_SELECT).\n */\n void fw_cfg_add_file_callback(FWCfgState *s, const char *filename,\n- FWCfgReadCallback callback, void *callback_opaque,\n+ FWCfgCallback select_cb,\n+ void *callback_opaque,\n void *data, size_t len, bool read_only);\n \n /**\ndiff --git a/hw/core/loader.c b/hw/core/loader.c\nindex ebe574c..4593061 100644\n--- a/hw/core/loader.c\n+++ b/hw/core/loader.c\n@@ -989,7 +989,7 @@ err:\n \n MemoryRegion *rom_add_blob(const char *name, const void *blob, size_t len,\n size_t max_len, hwaddr addr, const char *fw_file_name,\n- FWCfgReadCallback fw_callback, void *callback_opaque,\n+ FWCfgCallback fw_callback, void *callback_opaque,\n AddressSpace *as, bool read_only)\n {\n MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine());\ndiff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c\nindex 5bd9044..e3bd626 100644\n--- a/hw/nvram/fw_cfg.c\n+++ b/hw/nvram/fw_cfg.c\n@@ -55,7 +55,7 @@ struct FWCfgEntry {\n bool allow_write;\n uint8_t *data;\n void *callback_opaque;\n- FWCfgReadCallback read_callback;\n+ FWCfgCallback select_cb;\n };\n \n #define JPG_FILE 0\n@@ -236,8 +236,8 @@ static int fw_cfg_select(FWCfgState *s, uint16_t key)\n /* entry successfully selected, now run callback if present */\n arch = !!(key & FW_CFG_ARCH_LOCAL);\n e = &s->entries[arch][key & FW_CFG_ENTRY_MASK];\n- if (e->read_callback) {\n- e->read_callback(e->callback_opaque);\n+ if (e->select_cb) {\n+ e->select_cb(e->callback_opaque);\n }\n }\n \n@@ -568,11 +568,11 @@ static const VMStateDescription vmstate_fw_cfg = {\n }\n };\n \n-static void fw_cfg_add_bytes_read_callback(FWCfgState *s, uint16_t key,\n- FWCfgReadCallback callback,\n- void *callback_opaque,\n- void *data, size_t len,\n- bool read_only)\n+static void fw_cfg_add_bytes_callback(FWCfgState *s, uint16_t key,\n+ FWCfgCallback select_cb,\n+ void *callback_opaque,\n+ void *data, size_t len,\n+ bool read_only)\n {\n int arch = !!(key & FW_CFG_ARCH_LOCAL);\n \n@@ -583,7 +583,7 @@ static void fw_cfg_add_bytes_read_callback(FWCfgState *s, uint16_t key,\n \n s->entries[arch][key].data = data;\n s->entries[arch][key].len = (uint32_t)len;\n- s->entries[arch][key].read_callback = callback;\n+ s->entries[arch][key].select_cb = select_cb;\n s->entries[arch][key].callback_opaque = callback_opaque;\n s->entries[arch][key].allow_write = !read_only;\n }\n@@ -610,7 +610,7 @@ static void *fw_cfg_modify_bytes_read(FWCfgState *s, uint16_t key,\n \n void fw_cfg_add_bytes(FWCfgState *s, uint16_t key, void *data, size_t len)\n {\n- fw_cfg_add_bytes_read_callback(s, key, NULL, NULL, data, len, true);\n+ fw_cfg_add_bytes_callback(s, key, NULL, NULL, data, len, true);\n }\n \n void fw_cfg_add_string(FWCfgState *s, uint16_t key, const char *value)\n@@ -736,7 +736,8 @@ static int get_fw_cfg_order(FWCfgState *s, const char *name)\n }\n \n void fw_cfg_add_file_callback(FWCfgState *s, const char *filename,\n- FWCfgReadCallback callback, void *callback_opaque,\n+ FWCfgCallback select_cb,\n+ void *callback_opaque,\n void *data, size_t len, bool read_only)\n {\n int i, index, count;\n@@ -798,9 +799,10 @@ void fw_cfg_add_file_callback(FWCfgState *s, const char *filename,\n }\n }\n \n- fw_cfg_add_bytes_read_callback(s, FW_CFG_FILE_FIRST + index,\n- callback, callback_opaque, data, len,\n- read_only);\n+ fw_cfg_add_bytes_callback(s, FW_CFG_FILE_FIRST + index,\n+ select_cb,\n+ callback_opaque, data, len,\n+ read_only);\n \n s->files->f[index].size = cpu_to_be32(len);\n s->files->f[index].select = cpu_to_be16(FW_CFG_FILE_FIRST + index);\n", "prefixes": [ "PULL", "17/17" ] }