From patchwork Thu Oct 13 21:26:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 9375833 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 140A0607FD for ; Thu, 13 Oct 2016 21:31:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 03FC52A139 for ; Thu, 13 Oct 2016 21:31:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ECCEB2A1F5; Thu, 13 Oct 2016 21:31:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 946532A1F4 for ; Thu, 13 Oct 2016 21:31:07 +0000 (UTC) Received: from localhost ([::1]:43100 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bunak-0004TT-Nc for patchwork-qemu-devel@patchwork.kernel.org; Thu, 13 Oct 2016 17:31:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35878) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bunWm-0001Rz-BS for qemu-devel@nongnu.org; Thu, 13 Oct 2016 17:27:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bunWg-0003q6-A4 for qemu-devel@nongnu.org; Thu, 13 Oct 2016 17:26:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44776) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bunWg-0003pv-0k for qemu-devel@nongnu.org; Thu, 13 Oct 2016 17:26:54 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9195B4E4CB for ; Thu, 13 Oct 2016 21:26:53 +0000 (UTC) Received: from localhost (ovpn-116-77.phx2.redhat.com [10.3.116.77]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9DLQqcD019172; Thu, 13 Oct 2016 17:26:53 -0400 From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Thu, 13 Oct 2016 18:26:40 -0300 Message-Id: <1476394002-8392-3-git-send-email-ehabkost@redhat.com> In-Reply-To: <1476394002-8392-1-git-send-email-ehabkost@redhat.com> References: <1476394002-8392-1-git-send-email-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 13 Oct 2016 21:26:53 +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 2/4] pc: Register TYPE_PC_MACHINE properties as class properties X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marcel Apfelbaum , Paolo Bonzini , Igor Mammedov , Markus Armbruster , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Eduardo Habkost Reviewed-by: Igor Mammedov --- hw/i386/pc.c | 56 ++++++++++++++++++++++++++------------------------------ 1 file changed, 26 insertions(+), 30 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 93ff49c..f4b0cda 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -2134,41 +2134,11 @@ static void pc_machine_initfn(Object *obj) { PCMachineState *pcms = PC_MACHINE(obj); - object_property_add(obj, PC_MACHINE_MEMHP_REGION_SIZE, "int", - pc_machine_get_hotplug_memory_region_size, - NULL, NULL, NULL, &error_abort); - pcms->max_ram_below_4g = 0; /* use default */ - object_property_add(obj, PC_MACHINE_MAX_RAM_BELOW_4G, "size", - pc_machine_get_max_ram_below_4g, - pc_machine_set_max_ram_below_4g, - NULL, NULL, &error_abort); - object_property_set_description(obj, PC_MACHINE_MAX_RAM_BELOW_4G, - "Maximum ram below the 4G boundary (32bit boundary)", - &error_abort); - pcms->smm = ON_OFF_AUTO_AUTO; - object_property_add(obj, PC_MACHINE_SMM, "OnOffAuto", - pc_machine_get_smm, - pc_machine_set_smm, - NULL, NULL, &error_abort); - object_property_set_description(obj, PC_MACHINE_SMM, - "Enable SMM (pc & q35)", - &error_abort); - pcms->vmport = ON_OFF_AUTO_AUTO; - object_property_add(obj, PC_MACHINE_VMPORT, "OnOffAuto", - pc_machine_get_vmport, - pc_machine_set_vmport, - NULL, NULL, &error_abort); - object_property_set_description(obj, PC_MACHINE_VMPORT, - "Enable vmport (pc & q35)", - &error_abort); - /* nvdimm is disabled on default. */ pcms->acpi_nvdimm_state.is_enabled = false; - object_property_add_bool(obj, PC_MACHINE_NVDIMM, pc_machine_get_nvdimm, - pc_machine_set_nvdimm, &error_abort); } static void pc_machine_reset(void) @@ -2303,6 +2273,32 @@ static void pc_machine_class_init(ObjectClass *oc, void *data) hc->unplug_request = pc_machine_device_unplug_request_cb; hc->unplug = pc_machine_device_unplug_cb; nc->nmi_monitor_handler = x86_nmi; + + object_class_property_add(oc, PC_MACHINE_MEMHP_REGION_SIZE, "int", + pc_machine_get_hotplug_memory_region_size, NULL, + NULL, NULL, &error_abort); + + object_class_property_add(oc, PC_MACHINE_MAX_RAM_BELOW_4G, "size", + pc_machine_get_max_ram_below_4g, pc_machine_set_max_ram_below_4g, + NULL, NULL, &error_abort); + + object_class_property_set_description(oc, PC_MACHINE_MAX_RAM_BELOW_4G, + "Maximum ram below the 4G boundary (32bit boundary)", &error_abort); + + object_class_property_add(oc, PC_MACHINE_SMM, "OnOffAuto", + pc_machine_get_smm, pc_machine_set_smm, + NULL, NULL, &error_abort); + object_class_property_set_description(oc, PC_MACHINE_SMM, + "Enable SMM (pc & q35)", &error_abort); + + object_class_property_add(oc, PC_MACHINE_VMPORT, "OnOffAuto", + pc_machine_get_vmport, pc_machine_set_vmport, + NULL, NULL, &error_abort); + object_class_property_set_description(oc, PC_MACHINE_VMPORT, + "Enable vmport (pc & q35)", &error_abort); + + object_class_property_add_bool(oc, PC_MACHINE_NVDIMM, + pc_machine_get_nvdimm, pc_machine_set_nvdimm, &error_abort); } static const TypeInfo pc_machine_info = {