Re: [PATCH 3/3] hw/i2c/pmbus_device: Fix modifying QOM class internals from instance

2023-05-23 Thread Richard Henderson
On 5/22/23 23:44, Philippe Mathieu-Daudé wrote: QOM object instance should not modify its class state (because all other objects instanciated from this class get affected). Instead of modifying the PMBusDeviceClass 'device_num_pages' field the first time a instance is initialized (in pmbus_pages

[PATCH 3/3] hw/i2c/pmbus_device: Fix modifying QOM class internals from instance

2023-05-22 Thread Philippe Mathieu-Daudé
QOM object instance should not modify its class state (because all other objects instanciated from this class get affected). Instead of modifying the PMBusDeviceClass 'device_num_pages' field the first time a instance is initialized (in pmbus_pages_alloc), introduce a new pmbus_pages_num() helper