qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Igor Mammedov <imammedo@redhat.com>
To: qemu-devel@nongnu.org
Cc: sw@weilnetz.de, mjt@tls.msk.ru, lcapitulino@redhat.com,
	blauwirbel@gmail.com, aliguori@amazon.com, stefanha@gmail.com,
	pbonzini@redhat.com, rth@twiddle.net
Subject: [Qemu-devel] [PATCH v1 0/4] -object/object-add add 2nd stage initialization
Date: Thu, 16 Jan 2014 17:34:35 +0100	[thread overview]
Message-ID: <1389890079-21853-1-git-send-email-imammedo@redhat.com> (raw)

Adds UserCreatable interface that objects must inherit from
If they need to be created with help of -object/object-add
commands.

Interface also provides an optional complete() callback,
that is called after object properties are set. Which allows
 * replace custom backend APIs to initialize them with generic
   object_new(); set object properties; object.complete();
   sequence.
 * bail out/report error early (at backend creation time)
   instead of failing later when adding device that uses
   that backend.

Reference to RFC:
https://lists.gnu.org/archive/html/qemu-devel/2014-01/msg00877.html

Changes since RFC:
* rename object_realize interface to UserCreatable
* make UserCreatable interface mandatory for -object/object-add
* drop custom location patch

Git tree for testing:
https://github.com/imammedo/qemu/commits/extend-object-add-v1

Igor Mammedov (4):
  object_add: consolidate error handling
  vl.c: -object: don't ingnore duplicate 'id'
  add optional 2nd stage initialization to -object/object-add commands
  virtio_rng: replace custom backend API with UserCreatable.complete()
    callback

 backends/rng.c                  |   17 +++++++++-
 hw/virtio/virtio-rng.c          |   15 +++++----
 include/qom/object_interfaces.h |   62 +++++++++++++++++++++++++++++++++++++++
 include/sysemu/rng.h            |   11 -------
 qmp.c                           |   22 +++++++++++--
 qom/Makefile.objs               |    1 +
 qom/object_interfaces.c         |   32 ++++++++++++++++++++
 vl.c                            |   22 +++++++++++++-
 8 files changed, 158 insertions(+), 24 deletions(-)
 create mode 100644 include/qom/object_interfaces.h
 create mode 100644 qom/object_interfaces.c

             reply	other threads:[~2014-01-16 16:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-16 16:34 Igor Mammedov [this message]
2014-01-16 16:34 ` [Qemu-devel] [PATCH v1 1/4] object_add: consolidate error handling Igor Mammedov
2014-01-16 16:34 ` [Qemu-devel] [PATCH v1 2/4] vl.c: -object: don't ingnore duplicate 'id' Igor Mammedov
2014-01-16 16:50   ` Eric Blake
2014-01-16 16:34 ` [Qemu-devel] [PATCH v1 3/4] add optional 2nd stage initialization to -object/object-add commands Igor Mammedov
2014-01-16 16:34 ` [Qemu-devel] [PATCH v1 4/4] virtio_rng: replace custom backend API with UserCreatable.complete() callback Igor Mammedov
2014-08-09  4:32   ` Amos Kong
2014-01-17  7:10 ` [Qemu-devel] [PATCH v1 0/4] -object/object-add add 2nd stage initialization Stefan Hajnoczi
2014-01-22 18:33 ` Luiz Capitulino

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=1389890079-21853-1-git-send-email-imammedo@redhat.com \
    --to=imammedo@redhat.com \
    --cc=aliguori@amazon.com \
    --cc=blauwirbel@gmail.com \
    --cc=lcapitulino@redhat.com \
    --cc=mjt@tls.msk.ru \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=stefanha@gmail.com \
    --cc=sw@weilnetz.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).