>>> I don't like having virtio-specific code on memory-device.c.
>>> What about making it generic?  Let device 2 register a read-only
>>> property for the user-visible ID, and make memory_device_id() use
>>> that property if it's present.
>>
>> Valid point. Or avoid properties and add a function to the memory-device
>> class?
> 
> That works too, and it was my first thought.  But if you want a
> method whose only purpose is to return a single value without
> affecting object state, a QOM property seems like a perfect fit.
> 
> Either of those options would be good enough for me, though.
> 

The function would only have to be defined for those overwriting it.
Will have a look. Thanks!

-- 

Thanks,

David / dhildenb

Reply via email to