From patchwork Mon Oct 17 17:55:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 683254 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3syR4G6zFYz9sR9 for ; Tue, 18 Oct 2016 05:07:10 +1100 (AEDT) Received: from localhost ([::1]:34859 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwCJX-0005Oy-I6 for incoming@patchwork.ozlabs.org; Mon, 17 Oct 2016 14:07:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55503) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwC8G-0003vq-KH for qemu-devel@nongnu.org; Mon, 17 Oct 2016 13:55:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bwC8F-0003bR-35 for qemu-devel@nongnu.org; Mon, 17 Oct 2016 13:55:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27005) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1bwC8E-0003ao-Rs for qemu-devel@nongnu.org; Mon, 17 Oct 2016 13:55:27 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (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 0FB2E624AD; Mon, 17 Oct 2016 17:55:26 +0000 (UTC) Received: from localhost (ovpn-116-159.phx2.redhat.com [10.3.116.159]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9HHtOt8024135; Mon, 17 Oct 2016 13:55:25 -0400 From: Eduardo Habkost To: qemu-devel@nongnu.org, Peter Maydell Date: Mon, 17 Oct 2016 15:55:15 -0200 Message-Id: <1476726918-16039-3-git-send-email-ehabkost@redhat.com> In-Reply-To: <1476726918-16039-1-git-send-email-ehabkost@redhat.com> References: <1476726918-16039-1-git-send-email-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 17 Oct 2016 17:55:26 +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] [PULL 2/5] machine: Register TYPE_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 , Igor Mammedov Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" When doing the conversion, the NULL errp arguments on the property registration calls were changed to &error_abort. Reviewed-by: Igor Mammedov Signed-off-by: Eduardo Habkost --- hw/core/machine.c | 206 ++++++++++++++++++++++++++---------------------------- 1 file changed, 98 insertions(+), 108 deletions(-) diff --git a/hw/core/machine.c b/hw/core/machine.c index afd84ac..b0fd91f 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -364,6 +364,104 @@ static void machine_class_init(ObjectClass *oc, void *data) /* Default 128 MB as guest ram size */ mc->default_ram_size = 128 * M_BYTE; mc->rom_file_has_mr = true; + + object_class_property_add_str(oc, "accel", + machine_get_accel, machine_set_accel, &error_abort); + object_class_property_set_description(oc, "accel", + "Accelerator list", &error_abort); + + object_class_property_add(oc, "kernel-irqchip", "OnOffSplit", + NULL, machine_set_kernel_irqchip, + NULL, NULL, &error_abort); + object_class_property_set_description(oc, "kernel-irqchip", + "Configure KVM in-kernel irqchip", &error_abort); + + object_class_property_add(oc, "kvm-shadow-mem", "int", + machine_get_kvm_shadow_mem, machine_set_kvm_shadow_mem, + NULL, NULL, &error_abort); + object_class_property_set_description(oc, "kvm-shadow-mem", + "KVM shadow MMU size", &error_abort); + + object_class_property_add_str(oc, "kernel", + machine_get_kernel, machine_set_kernel, &error_abort); + object_class_property_set_description(oc, "kernel", + "Linux kernel image file", &error_abort); + + object_class_property_add_str(oc, "initrd", + machine_get_initrd, machine_set_initrd, &error_abort); + object_class_property_set_description(oc, "initrd", + "Linux initial ramdisk file", &error_abort); + + object_class_property_add_str(oc, "append", + machine_get_append, machine_set_append, &error_abort); + object_class_property_set_description(oc, "append", + "Linux kernel command line", &error_abort); + + object_class_property_add_str(oc, "dtb", + machine_get_dtb, machine_set_dtb, &error_abort); + object_class_property_set_description(oc, "dtb", + "Linux kernel device tree file", &error_abort); + + object_class_property_add_str(oc, "dumpdtb", + machine_get_dumpdtb, machine_set_dumpdtb, &error_abort); + object_class_property_set_description(oc, "dumpdtb", + "Dump current dtb to a file and quit", &error_abort); + + object_class_property_add(oc, "phandle-start", "int", + machine_get_phandle_start, machine_set_phandle_start, + NULL, NULL, &error_abort); + object_class_property_set_description(oc, "phandle-start", + "The first phandle ID we may generate dynamically", &error_abort); + + object_class_property_add_str(oc, "dt-compatible", + machine_get_dt_compatible, machine_set_dt_compatible, &error_abort); + object_class_property_set_description(oc, "dt-compatible", + "Overrides the \"compatible\" property of the dt root node", + &error_abort); + + object_class_property_add_bool(oc, "dump-guest-core", + machine_get_dump_guest_core, machine_set_dump_guest_core, &error_abort); + object_class_property_set_description(oc, "dump-guest-core", + "Include guest memory in a core dump", &error_abort); + + object_class_property_add_bool(oc, "mem-merge", + machine_get_mem_merge, machine_set_mem_merge, &error_abort); + object_class_property_set_description(oc, "mem-merge", + "Enable/disable memory merge support", &error_abort); + + object_class_property_add_bool(oc, "usb", + machine_get_usb, machine_set_usb, &error_abort); + object_class_property_set_description(oc, "usb", + "Set on/off to enable/disable usb", &error_abort); + + object_class_property_add_bool(oc, "graphics", + machine_get_graphics, machine_set_graphics, &error_abort); + object_class_property_set_description(oc, "graphics", + "Set on/off to enable/disable graphics emulation", &error_abort); + + object_class_property_add_bool(oc, "igd-passthru", + machine_get_igd_gfx_passthru, machine_set_igd_gfx_passthru, + &error_abort); + object_class_property_set_description(oc, "igd-passthru", + "Set on/off to enable/disable igd passthrou", &error_abort); + + object_class_property_add_str(oc, "firmware", + machine_get_firmware, machine_set_firmware, + &error_abort); + object_class_property_set_description(oc, "firmware", + "Firmware image", &error_abort); + + object_class_property_add_bool(oc, "suppress-vmdesc", + machine_get_suppress_vmdesc, machine_set_suppress_vmdesc, + &error_abort); + object_class_property_set_description(oc, "suppress-vmdesc", + "Set on to disable self-describing migration", &error_abort); + + object_class_property_add_bool(oc, "enforce-config-section", + machine_get_enforce_config_section, machine_set_enforce_config_section, + &error_abort); + object_class_property_set_description(oc, "enforce-config-section", + "Set on to enforce configuration section migration", &error_abort); } static void machine_class_base_init(ObjectClass *oc, void *data) @@ -387,114 +485,6 @@ static void machine_initfn(Object *obj) ms->mem_merge = true; ms->enable_graphics = true; - object_property_add_str(obj, "accel", - machine_get_accel, machine_set_accel, NULL); - object_property_set_description(obj, "accel", - "Accelerator list", - NULL); - object_property_add(obj, "kernel-irqchip", "OnOffSplit", - NULL, - machine_set_kernel_irqchip, - NULL, NULL, NULL); - object_property_set_description(obj, "kernel-irqchip", - "Configure KVM in-kernel irqchip", - NULL); - object_property_add(obj, "kvm-shadow-mem", "int", - machine_get_kvm_shadow_mem, - machine_set_kvm_shadow_mem, - NULL, NULL, NULL); - object_property_set_description(obj, "kvm-shadow-mem", - "KVM shadow MMU size", - NULL); - object_property_add_str(obj, "kernel", - machine_get_kernel, machine_set_kernel, NULL); - object_property_set_description(obj, "kernel", - "Linux kernel image file", - NULL); - object_property_add_str(obj, "initrd", - machine_get_initrd, machine_set_initrd, NULL); - object_property_set_description(obj, "initrd", - "Linux initial ramdisk file", - NULL); - object_property_add_str(obj, "append", - machine_get_append, machine_set_append, NULL); - object_property_set_description(obj, "append", - "Linux kernel command line", - NULL); - object_property_add_str(obj, "dtb", - machine_get_dtb, machine_set_dtb, NULL); - object_property_set_description(obj, "dtb", - "Linux kernel device tree file", - NULL); - object_property_add_str(obj, "dumpdtb", - machine_get_dumpdtb, machine_set_dumpdtb, NULL); - object_property_set_description(obj, "dumpdtb", - "Dump current dtb to a file and quit", - NULL); - object_property_add(obj, "phandle-start", "int", - machine_get_phandle_start, - machine_set_phandle_start, - NULL, NULL, NULL); - object_property_set_description(obj, "phandle-start", - "The first phandle ID we may generate dynamically", - NULL); - object_property_add_str(obj, "dt-compatible", - machine_get_dt_compatible, - machine_set_dt_compatible, - NULL); - object_property_set_description(obj, "dt-compatible", - "Overrides the \"compatible\" property of the dt root node", - NULL); - object_property_add_bool(obj, "dump-guest-core", - machine_get_dump_guest_core, - machine_set_dump_guest_core, - NULL); - object_property_set_description(obj, "dump-guest-core", - "Include guest memory in a core dump", - NULL); - object_property_add_bool(obj, "mem-merge", - machine_get_mem_merge, - machine_set_mem_merge, NULL); - object_property_set_description(obj, "mem-merge", - "Enable/disable memory merge support", - NULL); - object_property_add_bool(obj, "usb", - machine_get_usb, - machine_set_usb, NULL); - object_property_set_description(obj, "usb", - "Set on/off to enable/disable usb", - NULL); - object_property_add_bool(obj, "graphics", - machine_get_graphics, - machine_set_graphics, NULL); - object_property_set_description(obj, "graphics", - "Set on/off to enable/disable graphics emulation", - NULL); - object_property_add_bool(obj, "igd-passthru", - machine_get_igd_gfx_passthru, - machine_set_igd_gfx_passthru, NULL); - object_property_set_description(obj, "igd-passthru", - "Set on/off to enable/disable igd passthrou", - NULL); - object_property_add_str(obj, "firmware", - machine_get_firmware, - machine_set_firmware, NULL); - object_property_set_description(obj, "firmware", - "Firmware image", - NULL); - object_property_add_bool(obj, "suppress-vmdesc", - machine_get_suppress_vmdesc, - machine_set_suppress_vmdesc, NULL); - object_property_set_description(obj, "suppress-vmdesc", - "Set on to disable self-describing migration", - NULL); - object_property_add_bool(obj, "enforce-config-section", - machine_get_enforce_config_section, - machine_set_enforce_config_section, NULL); - object_property_set_description(obj, "enforce-config-section", - "Set on to enforce configuration section migration", - NULL); - /* Register notifier when init is done for sysbus sanity checks */ ms->sysbus_notifier.notify = machine_init_notify; qemu_add_machine_init_done_notifier(&ms->sysbus_notifier);