13.02.2024 10:16, Philippe Mathieu-Daudé :
Prefer the QDev API over the low level QOM one.
No logical change intended.
...
          /* set the numa node property for sgx epc object */
-        object_property_set_uint(obj, SGX_EPC_NUMA_NODE_PROP, 
list->value->node,
-                             &error_fatal);
-        object_property_set_bool(obj, "realized", true, &error_fatal);
-        object_unref(obj);
+        object_property_set_uint(OBJECT(dev), SGX_EPC_NUMA_NODE_PROP,
+                                 list->value->node, &error_fatal);
+        qdev_realize_and_unref(dev, &error_fatal);

This does not work.  Here's the function prototype:

 bool qdev_realize_and_unref(DeviceState *dev, BusState *bus, Error **errp);

I'd say a v2 is in order.

/mjt


Reply via email to