From patchwork Thu Oct 13 21:26:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Habkost X-Patchwork-Id: 9375831 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 0DE90607FD for ; Thu, 13 Oct 2016 21:31:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F216F2A1F4 for ; Thu, 13 Oct 2016 21:30:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E6E192A1F6; Thu, 13 Oct 2016 21:30:59 +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 86C332A1F4 for ; Thu, 13 Oct 2016 21:30:59 +0000 (UTC) Received: from localhost ([::1]:43098 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bunac-0004PW-LQ for patchwork-qemu-devel@patchwork.kernel.org; Thu, 13 Oct 2016 17:30:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35879) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bunWm-0001S0-BU 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 1bunWi-0003r3-Kg for qemu-devel@nongnu.org; Thu, 13 Oct 2016 17:26:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52704) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bunWi-0003qr-BU for qemu-devel@nongnu.org; Thu, 13 Oct 2016 17:26:56 -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 C5636804E3 for ; Thu, 13 Oct 2016 21:26:55 +0000 (UTC) Received: from localhost (ovpn-116-77.phx2.redhat.com [10.3.116.77]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9DLQsmF003639; Thu, 13 Oct 2016 17:26:55 -0400 From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Thu, 13 Oct 2016 18:26:41 -0300 Message-Id: <1476394002-8392-4-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.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 13 Oct 2016 21:26:55 +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 3/4] hostmem: Register TYPE_MEMORY_BACKEND 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 The NULL errp arguments on the property registration calls were changed to &error_abort. Signed-off-by: Eduardo Habkost Reviewed-by: Igor Mammedov --- backends/hostmem.c | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/backends/hostmem.c b/backends/hostmem.c index b7a208d..4256d24 100644 --- a/backends/hostmem.c +++ b/backends/hostmem.c @@ -241,26 +241,6 @@ static void host_memory_backend_init(Object *obj) backend->merge = machine_mem_merge(machine); backend->dump = machine_dump_guest_core(machine); backend->prealloc = mem_prealloc; - - object_property_add_bool(obj, "merge", - host_memory_backend_get_merge, - host_memory_backend_set_merge, NULL); - object_property_add_bool(obj, "dump", - host_memory_backend_get_dump, - host_memory_backend_set_dump, NULL); - object_property_add_bool(obj, "prealloc", - host_memory_backend_get_prealloc, - host_memory_backend_set_prealloc, NULL); - object_property_add(obj, "size", "int", - host_memory_backend_get_size, - host_memory_backend_set_size, NULL, NULL, NULL); - object_property_add(obj, "host-nodes", "int", - host_memory_backend_get_host_nodes, - host_memory_backend_set_host_nodes, NULL, NULL, NULL); - object_property_add_enum(obj, "policy", "HostMemPolicy", - HostMemPolicy_lookup, - host_memory_backend_get_policy, - host_memory_backend_set_policy, NULL); } MemoryRegion * @@ -375,6 +355,28 @@ host_memory_backend_class_init(ObjectClass *oc, void *data) ucc->complete = host_memory_backend_memory_complete; ucc->can_be_deleted = host_memory_backend_can_be_deleted; + + object_class_property_add_bool(oc, "merge", + host_memory_backend_get_merge, + host_memory_backend_set_merge, &error_abort); + object_class_property_add_bool(oc, "dump", + host_memory_backend_get_dump, + host_memory_backend_set_dump, &error_abort); + object_class_property_add_bool(oc, "prealloc", + host_memory_backend_get_prealloc, + host_memory_backend_set_prealloc, &error_abort); + object_class_property_add(oc, "size", "int", + host_memory_backend_get_size, + host_memory_backend_set_size, + NULL, NULL, &error_abort); + object_class_property_add(oc, "host-nodes", "int", + host_memory_backend_get_host_nodes, + host_memory_backend_set_host_nodes, + NULL, NULL, &error_abort); + object_class_property_add_enum(oc, "policy", "HostMemPolicy", + HostMemPolicy_lookup, + host_memory_backend_get_policy, + host_memory_backend_set_policy, &error_abort); } static const TypeInfo host_memory_backend_info = {