]> git.ipfire.org Git - thirdparty/qemu.git/blobdiff - qom/object.c
Revert "Revert "globals: Allow global properties to be optional""
[thirdparty/qemu.git] / qom / object.c
index 3966a3d461c40179f560f3f7d49851a9f9726e3b..1555547727c4aa77b8a837343dee2fa7c3df3859 100644 (file)
@@ -386,6 +386,9 @@ void object_apply_global_props(Object *obj, const GPtrArray *props, Error **errp
         if (object_dynamic_cast(obj, p->driver) == NULL) {
             continue;
         }
+        if (p->optional && !object_property_find(obj, p->property, NULL)) {
+            continue;
+        }
         p->used = true;
         object_property_parse(obj, p->value, p->property, &err);
         if (err != NULL) {