Re: [PATCH v2 11/18] qom: add object_new_with_class

2019-12-09 Thread Paolo Bonzini
On 09/12/19 16:31, Philippe Mathieu-Daudé wrote: > On 12/9/19 4:01 PM, Paolo Bonzini wrote: >>     /** >> + * object_new_with_class: >> + * @klass: The class to instantiate. >> + * >> + * This function will initialize a new object using heap allocated >> memory. >> + * The returned object has a ref

Re: [PATCH v2 11/18] qom: add object_new_with_class

2019-12-09 Thread Philippe Mathieu-Daudé
On 12/9/19 4:01 PM, Paolo Bonzini wrote: Similar to CPU and machine classes, "-accel" class names are mangled, so we have to first get a class via accel_find and then instantiate it. Provide a new function to instantiate a class without going through object_class_get_name, and use it for CPUs and

[PATCH v2 11/18] qom: add object_new_with_class

2019-12-09 Thread Paolo Bonzini
Similar to CPU and machine classes, "-accel" class names are mangled, so we have to first get a class via accel_find and then instantiate it. Provide a new function to instantiate a class without going through object_class_get_name, and use it for CPUs and machines already. Reviewed-by: Marc-André