From: Eduardo Habkost <ehabkost@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>,
"Eduardo Habkost" <ehabkost@redhat.com>
Subject: [PATCH 7/8] qom: Make object_property_set_default() public
Date: Mon, 9 Nov 2020 16:25:55 -0500 [thread overview]
Message-ID: <20201109212556.3934583-8-ehabkost@redhat.com> (raw)
In-Reply-To: <20201109212556.3934583-1-ehabkost@redhat.com>
The function will be used outside qom/object.c, to simplify the
field property code that sets the property default value.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
include/qom/object.h | 11 +++++++++++
qom/object.c | 2 +-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/include/qom/object.h b/include/qom/object.h
index 2ab124b8f0..4234cc9b66 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -1090,6 +1090,17 @@ ObjectProperty *object_class_property_add(ObjectClass *klass, const char *name,
ObjectPropertyRelease *release,
void *opaque);
+/**
+ * object_property_set_default:
+ * @prop: the property to set
+ * @value: the value to be written to the property
+ *
+ * Set the property default value.
+ *
+ * Ownership of @value is transferred to the property.
+ */
+void object_property_set_default(ObjectProperty *prop, QObject *value);
+
/**
* object_property_set_default_bool:
* @prop: the property to set
diff --git a/qom/object.c b/qom/object.c
index 7c11bcd3b1..6b0d9d8c79 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -1547,7 +1547,7 @@ static void object_property_init_defval(Object *obj, ObjectProperty *prop)
visit_free(v);
}
-static void object_property_set_default(ObjectProperty *prop, QObject *defval)
+void object_property_set_default(ObjectProperty *prop, QObject *defval)
{
assert(!prop->defval);
assert(!prop->init);
--
2.28.0
next prev parent reply other threads:[~2020-11-09 21:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-09 21:25 [PATCH 0/8] qom: Use qlit to represent property defaults Eduardo Habkost
2020-11-09 21:25 ` [PATCH 1/8] qobject: Include API docs in docs/devel/qobject.html Eduardo Habkost
2020-11-09 21:25 ` [PATCH 2/8] qnum: Make qnum_get_double() get const pointer Eduardo Habkost
2020-11-09 21:25 ` [PATCH 3/8] qnum: QNumValue type for QNum value literals Eduardo Habkost
2020-11-09 21:25 ` [PATCH 4/8] qnum: qnum_value_is_equal() function Eduardo Habkost
2020-11-09 21:25 ` [PATCH 5/8] qlit: Support all types of QNums Eduardo Habkost
2020-11-09 21:25 ` [PATCH 6/8] qlit: qlit_type() function Eduardo Habkost
2020-11-09 21:25 ` Eduardo Habkost [this message]
2020-11-09 21:25 ` [PATCH 8/8] qom: Use qlit to represent property defaults Eduardo Habkost
2020-11-09 21:39 ` [PATCH 0/8] " no-reply
2020-11-10 16:39 ` Paolo Bonzini
2020-11-10 18:16 ` 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=20201109212556.3934583-8-ehabkost@redhat.com \
--to=ehabkost@redhat.com \
--cc=armbru@redhat.com \
--cc=berrange@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 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).