Hello all,

Today I read the BusClass’ definition.

The comment 
/* FIXME first arg should be BusState */
remind me that OOP in qemu is not very OOP.

Maybe we should take the first arg as the Object pointer, just as the cpp’s 
this pointer.

For example, we can define the BusClass function as this

void (*print_dev)(BusState*, Monitor *mon, DeviceState *dev, int indent);
char *(*get_dev_path)(BusState*,  DeviceState *dev);
char *(*get_fw_dev_path)(BusState*, DeviceState *dev);

So we don’t need get the BusState in the callback function, such as 
‘usb_bus_dev_print’.

I want to know do do you think it make senses?
If not I will not spend time to write the patch.

Thanks,
Li Qiang

Reply via email to