Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/810769/?format=api
{ "id": 810769, "url": "http://patchwork.ozlabs.org/api/patches/810769/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20170906184305.2612-1-danielhb@linux.vnet.ibm.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": "<20170906184305.2612-1-danielhb@linux.vnet.ibm.com>", "list_archive_url": null, "date": "2017-09-06T18:43:05", "name": "hw/ppc/spapr.c: cleaning up qdev_get_machine() calls", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "f873e97aadca554dc12a742d69d2b73a1d53d6eb", "submitter": { "id": 64623, "url": "http://patchwork.ozlabs.org/api/people/64623/?format=api", "name": "Daniel Henrique Barboza", "email": "danielhb@linux.vnet.ibm.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/qemu-devel/patch/20170906184305.2612-1-danielhb@linux.vnet.ibm.com/mbox/", "series": [ { "id": 1866, "url": "http://patchwork.ozlabs.org/api/series/1866/?format=api", "web_url": "http://patchwork.ozlabs.org/project/qemu-devel/list/?series=1866", "date": "2017-09-06T18:43:05", "name": "hw/ppc/spapr.c: cleaning up qdev_get_machine() calls", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/1866/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/810769/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/810769/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>)", "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 3xnXgP1MDdz9sRV\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 7 Sep 2017 04:49:21 +1000 (AEST)", "from localhost ([::1]:37491 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 1dpfO3-0000mP-8t\n\tfor incoming@patchwork.ozlabs.org; Wed, 06 Sep 2017 14:49:19 -0400", "from eggs.gnu.org ([2001:4830:134:3::10]:58318)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <danielhb@linux.vnet.ibm.com>) id 1dpfIU-0004oO-3u\n\tfor qemu-devel@nongnu.org; Wed, 06 Sep 2017 14:43:39 -0400", "from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <danielhb@linux.vnet.ibm.com>) id 1dpfIP-0002gw-9g\n\tfor qemu-devel@nongnu.org; Wed, 06 Sep 2017 14:43:34 -0400", "from mx0a-001b2d01.pphosted.com ([148.163.156.1]:54724)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <danielhb@linux.vnet.ibm.com>)\n\tid 1dpfIP-0002gK-1B\n\tfor qemu-devel@nongnu.org; Wed, 06 Sep 2017 14:43:29 -0400", "from pps.filterd (m0098394.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv86Ied8J050673\n\tfor <qemu-devel@nongnu.org>; Wed, 6 Sep 2017 14:43:27 -0400", "from e11.ny.us.ibm.com (e11.ny.us.ibm.com [129.33.205.201])\n\tby mx0a-001b2d01.pphosted.com with ESMTP id 2ctpfjgbqk-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <qemu-devel@nongnu.org>; Wed, 06 Sep 2017 14:43:27 -0400", "from localhost\n\tby e11.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <qemu-devel@nongnu.org> from <danielhb@linux.vnet.ibm.com>;\n\tWed, 6 Sep 2017 14:43:21 -0400", "from b01cxnp22036.gho.pok.ibm.com (9.57.198.26)\n\tby e11.ny.us.ibm.com (146.89.104.198) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tWed, 6 Sep 2017 14:43:19 -0400", "from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com\n\t[9.57.199.111])\n\tby b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP\n\tid v86IhIZO31064292; Wed, 6 Sep 2017 18:43:18 GMT", "from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 168E4AC046;\n\tWed, 6 Sep 2017 14:43:46 -0400 (EDT)", "from localhost.localdomain (unknown [9.85.142.241])\n\tby b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP id 6F451AC03F;\n\tWed, 6 Sep 2017 14:43:44 -0400 (EDT)" ], "From": "Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>", "To": "qemu-devel@nongnu.org", "Date": "Wed, 6 Sep 2017 15:43:05 -0300", "X-Mailer": "git-send-email 2.9.4", "X-TM-AS-GCONF": "00", "x-cbid": "17090618-2213-0000-0000-000002161A75", "X-IBM-SpamModules-Scores": "", "X-IBM-SpamModules-Versions": "BY=3.00007678; HX=3.00000241; KW=3.00000007;\n\tPH=3.00000004; SC=3.00000226; SDB=6.00913192; UDB=6.00458304;\n\tIPR=6.00693454; \n\tBA=6.00005574; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009;\n\tZB=6.00000000; \n\tZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017036;\n\tXFM=3.00000015; UTC=2017-09-06 18:43:21", "X-IBM-AV-DETECTION": "SAVI=unused REMOTE=unused XFE=unused", "x-cbparentid": "17090618-2214-0000-0000-000057747FA0", "Message-Id": "<20170906184305.2612-1-danielhb@linux.vnet.ibm.com>", "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-09-06_06:, , signatures=0", "X-Proofpoint-Spam-Details": "rule=outbound_notspam policy=outbound score=0\n\tspamscore=0 suspectscore=1\n\tmalwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam\n\tadjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000\n\tdefinitions=main-1709060265", "X-detected-operating-system": "by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy]", "X-Received-From": "148.163.156.1", "Subject": "[Qemu-devel] [PATCH] hw/ppc/spapr.c: cleaning up qdev_get_machine()\n\tcalls", "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": "qemu-ppc@nongnu.org, mdroth@linux.vnet.ibm.com,\n\tdavid@gibson.dropbear.id.au", "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": "This patch removes the qdev_get_machine() calls that are made in\nspapr.c in situations where we can get an existing pointer for\nthe MachineState by either passing it as an argument to the function\nor by using other already available pointers.\n\nThe following changes were made:\n\n- spapr_node0_size: static function that is called two times:\nat spapr_setup_hpt_and_vrma and ppc_spapr_init. In both cases we can\npass an existing MachineState pointer to it.\n\n- spapr_build_fdt: MachineState pointer can be retrieved from\nthe existing sPAPRMachineState pointer.\n\n- spapr_boot_set: the opaque in the first arg is a sPAPRMachineState\npointer as we can see inside ppc_spapr_init:\n\n qemu_register_boot_set(spapr_boot_set, spapr);\n\nWe can get a MachineState pointer from it.\n\n- spapr_machine_device_plug and spapr_machine_device_unplug_request: the\nMachineState, sPAPRMachineState, MachineClass and sPAPRMachineClass pointers\ncan all be retrieved from the HotplugHandler pointer.\n\nSigned-off-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>\n---\n hw/ppc/spapr.c | 19 +++++++++----------\n 1 file changed, 9 insertions(+), 10 deletions(-)", "diff": "diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c\nindex cec441c..6ac3390 100644\n--- a/hw/ppc/spapr.c\n+++ b/hw/ppc/spapr.c\n@@ -390,10 +390,8 @@ static int spapr_fixup_cpu_dt(void *fdt, sPAPRMachineState *spapr)\n return ret;\n }\n \n-static hwaddr spapr_node0_size(void)\n+static hwaddr spapr_node0_size(MachineState *machine)\n {\n- MachineState *machine = MACHINE(qdev_get_machine());\n-\n if (nb_numa_nodes) {\n int i;\n for (i = 0; i < nb_numa_nodes; ++i) {\n@@ -1027,7 +1025,7 @@ static void *spapr_build_fdt(sPAPRMachineState *spapr,\n hwaddr rtas_addr,\n hwaddr rtas_size)\n {\n- MachineState *machine = MACHINE(qdev_get_machine());\n+ MachineState *machine = MACHINE(spapr);\n MachineClass *mc = MACHINE_GET_CLASS(machine);\n sPAPRMachineClass *smc = SPAPR_MACHINE_GET_CLASS(machine);\n int ret;\n@@ -1347,7 +1345,7 @@ void spapr_setup_hpt_and_vrma(sPAPRMachineState *spapr)\n spapr_reallocate_hpt(spapr, hpt_shift, &error_fatal);\n \n if (spapr->vrma_adjust) {\n- spapr->rma_size = kvmppc_rma_size(spapr_node0_size(),\n+ spapr->rma_size = kvmppc_rma_size(spapr_node0_size(MACHINE(spapr)),\n spapr->htab_shift);\n }\n /* We're setting up a hash table, so that means we're not radix */\n@@ -2007,7 +2005,7 @@ static SaveVMHandlers savevm_htab_handlers = {\n static void spapr_boot_set(void *opaque, const char *boot_device,\n Error **errp)\n {\n- MachineState *machine = MACHINE(qdev_get_machine());\n+ MachineState *machine = MACHINE(opaque);\n machine->boot_order = g_strdup(boot_device);\n }\n \n@@ -2154,7 +2152,7 @@ static void ppc_spapr_init(MachineState *machine)\n MemoryRegion *rma_region;\n void *rma = NULL;\n hwaddr rma_alloc_size;\n- hwaddr node0_size = spapr_node0_size();\n+ hwaddr node0_size = spapr_node0_size(machine);\n long load_limit, fw_size;\n char *filename;\n Error *resize_hpt_err = NULL;\n@@ -3198,7 +3196,8 @@ out:\n static void spapr_machine_device_plug(HotplugHandler *hotplug_dev,\n DeviceState *dev, Error **errp)\n {\n- sPAPRMachineClass *smc = SPAPR_MACHINE_GET_CLASS(qdev_get_machine());\n+ MachineState *ms = MACHINE(hotplug_dev);\n+ sPAPRMachineClass *smc = SPAPR_MACHINE_GET_CLASS(ms);\n \n if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) {\n int node;\n@@ -3247,8 +3246,8 @@ static void spapr_machine_device_plug(HotplugHandler *hotplug_dev,\n static void spapr_machine_device_unplug_request(HotplugHandler *hotplug_dev,\n DeviceState *dev, Error **errp)\n {\n- sPAPRMachineState *sms = SPAPR_MACHINE(qdev_get_machine());\n- MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine());\n+ sPAPRMachineState *sms = SPAPR_MACHINE(OBJECT(hotplug_dev));\n+ MachineClass *mc = MACHINE_GET_CLASS(sms);\n \n if (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM)) {\n if (spapr_ovec_test(sms->ov5_cas, OV5_HP_EVT)) {\n", "prefixes": [] }