summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorGreg Kurz2020-08-14 09:24:50 +0200
committerDavid Gibson2021-02-08 06:57:37 +0100
commita8dc82ce828579b92cf602cdc307a6c5b144069c (patch)
treecddc03e80de4a48c17c9b87419e55628265fcd6f /include
parentMerge remote-tracking branch 'remotes/rth-gitlab/tags/pull-tcg-20210205' into... (diff)
downloadqemu-a8dc82ce828579b92cf602cdc307a6c5b144069c.tar.gz
qemu-a8dc82ce828579b92cf602cdc307a6c5b144069c.tar.xz
qemu-a8dc82ce828579b92cf602cdc307a6c5b144069c.zip
qom: Allow optional sugar props
Global properties have an @optional field, which allows to apply a given property to a given type even if one of its subclasses doesn't support it. This is especially used in the compat code when dealing with the "disable-modern" and "disable-legacy" properties and the "virtio-pci" type. Allow object_register_sugar_prop() to set this field as well. Signed-off-by: Greg Kurz <groug@kaod.org> Message-Id: <159738953558.377274.16617742952571083440.stgit@bahia.lan> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/qom/object.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/qom/object.h b/include/qom/object.h
index d378f13a11..6721cd312e 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -638,7 +638,8 @@ bool object_apply_global_props(Object *obj, const GPtrArray *props,
Error **errp);
void object_set_machine_compat_props(GPtrArray *compat_props);
void object_set_accelerator_compat_props(GPtrArray *compat_props);
-void object_register_sugar_prop(const char *driver, const char *prop, const char *value);
+void object_register_sugar_prop(const char *driver, const char *prop,
+ const char *value, bool optional);
void object_apply_compat_props(Object *obj);
/**