aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/qom/object.h8
-rw-r--r--qom/object.c6
2 files changed, 14 insertions, 0 deletions
diff --git a/include/qom/object.h b/include/qom/object.h
index ef7258a..afccd24 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -1094,6 +1094,14 @@ void object_property_set_default_bool(ObjectProperty *prop, bool value);
void object_property_set_default_str(ObjectProperty *prop, const char *value);
/**
+ * object_property_set_default_list:
+ * @prop: the property to set
+ *
+ * Set the property default value to be an empty list.
+ */
+void object_property_set_default_list(ObjectProperty *prop);
+
+/**
* object_property_set_default_int:
* @prop: the property to set
* @value: the value to be written to the property
diff --git a/qom/object.c b/qom/object.c
index 8557fe8..95c0dc8 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -31,6 +31,7 @@
* of the QOM core on QObject? */
#include "qom/qom-qobject.h"
#include "qapi/qmp/qbool.h"
+#include "qapi/qmp/qlist.h"
#include "qapi/qmp/qnum.h"
#include "qapi/qmp/qstring.h"
#include "qemu/error-report.h"
@@ -1588,6 +1589,11 @@ void object_property_set_default_str(ObjectProperty *prop, const char *value)
object_property_set_default(prop, QOBJECT(qstring_from_str(value)));
}
+void object_property_set_default_list(ObjectProperty *prop)
+{
+ object_property_set_default(prop, QOBJECT(qlist_new()));
+}
+
void object_property_set_default_int(ObjectProperty *prop, int64_t value)
{
object_property_set_default(prop, QOBJECT(qnum_from_int(value)));