From: Igor Mammedov <imammedo@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
Marcel Apfelbaum <marcel@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 4/4] hostmem-file: Register TYPE_MEMORY_BACKEND_FILE properties as class properties
Date: Fri, 14 Oct 2016 14:16:07 +0200 [thread overview]
Message-ID: <20161014141607.53316d4e@nial.brq.redhat.com> (raw)
In-Reply-To: <1476394002-8392-5-git-send-email-ehabkost@redhat.com>
On Thu, 13 Oct 2016 18:26:42 -0300
Eduardo Habkost <ehabkost@redhat.com> wrote:
> To do the conversion, the file_backend_class_init() was moved
> after the getter/setter functions. The old
> file_backend_instance_init() function was removed because it is
> not needed anymore.
>
> The NULL errp arguments on the property registration calls were
> changed to &error_abort.
>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
> ---
> backends/hostmem-file.c | 26 +++++++++++---------------
> 1 file changed, 11 insertions(+), 15 deletions(-)
>
> diff --git a/backends/hostmem-file.c b/backends/hostmem-file.c
> index 5c4b808..42efb2f 100644
> --- a/backends/hostmem-file.c
> +++ b/backends/hostmem-file.c
> @@ -64,14 +64,6 @@ file_backend_memory_alloc(HostMemoryBackend *backend, Error **errp)
> #endif
> }
>
> -static void
> -file_backend_class_init(ObjectClass *oc, void *data)
> -{
> - HostMemoryBackendClass *bc = MEMORY_BACKEND_CLASS(oc);
> -
> - bc->alloc = file_backend_memory_alloc;
> -}
> -
> static char *get_mem_path(Object *o, Error **errp)
> {
> HostMemoryBackendFile *fb = MEMORY_BACKEND_FILE(o);
> @@ -112,13 +104,18 @@ static void file_memory_backend_set_share(Object *o, bool value, Error **errp)
> }
>
> static void
> -file_backend_instance_init(Object *o)
> +file_backend_class_init(ObjectClass *oc, void *data)
> {
> - object_property_add_bool(o, "share",
> - file_memory_backend_get_share,
> - file_memory_backend_set_share, NULL);
> - object_property_add_str(o, "mem-path", get_mem_path,
> - set_mem_path, NULL);
> + HostMemoryBackendClass *bc = MEMORY_BACKEND_CLASS(oc);
> +
> + bc->alloc = file_backend_memory_alloc;
> +
> + object_class_property_add_bool(oc, "share",
> + file_memory_backend_get_share, file_memory_backend_set_share,
> + &error_abort);
> + object_class_property_add_str(oc, "mem-path",
> + get_mem_path, set_mem_path,
> + &error_abort);
> }
>
> static void file_backend_instance_finalize(Object *o)
> @@ -132,7 +129,6 @@ static const TypeInfo file_backend_info = {
> .name = TYPE_MEMORY_BACKEND_FILE,
> .parent = TYPE_MEMORY_BACKEND,
> .class_init = file_backend_class_init,
> - .instance_init = file_backend_instance_init,
> .instance_finalize = file_backend_instance_finalize,
> .instance_size = sizeof(HostMemoryBackendFile),
> };
next prev parent reply other threads:[~2016-10-14 12:16 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-13 21:26 [Qemu-devel] [PATCH 0/4] machine, hostmem, pc: Register properties as class properties Eduardo Habkost
2016-10-13 21:26 ` [Qemu-devel] [PATCH 1/4] machine: Register TYPE_MACHINE " Eduardo Habkost
2016-10-14 13:08 ` Igor Mammedov
2016-10-14 13:24 ` Eduardo Habkost
2016-10-13 21:26 ` [Qemu-devel] [PATCH 2/4] pc: Register TYPE_PC_MACHINE " Eduardo Habkost
2016-10-14 12:27 ` Igor Mammedov
2016-10-13 21:26 ` [Qemu-devel] [PATCH 3/4] hostmem: Register TYPE_MEMORY_BACKEND " Eduardo Habkost
2016-10-14 12:09 ` Igor Mammedov
2016-10-13 21:26 ` [Qemu-devel] [PATCH 4/4] hostmem-file: Register TYPE_MEMORY_BACKEND_FILE " Eduardo Habkost
2016-10-14 12:16 ` Igor Mammedov [this message]
2016-10-14 1:01 ` [Qemu-devel] [PATCH 0/4] machine, hostmem, pc: Register " no-reply
2016-10-14 15:13 ` Eduardo Habkost
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161014141607.53316d4e@nial.brq.redhat.com \
--to=imammedo@redhat.com \
--cc=armbru@redhat.com \
--cc=ehabkost@redhat.com \
--cc=marcel@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.