RFC V2 -> V3 Split the series into two parts, because the first part can be submitted as was already accepted (after this review). - The second part involves the replacement of machine opts queries with QOM queries and I will resend it separately. Addressed Andreas Färber's comments: - Dropped the Qemu prefix everywhere - Coding style issues (I really hope I got them all!) - machine class:' -machine' sufix instead of 'machine-' prefix - Regarding replacement of the init order machine_init/type_init: - I answered on the mail thread that I saw no issues. - I also stated there that I think that type_init should be before machine_init because the later is using the QOM subsystem. Addressed Paolo Bonzini's comments: - Added the current_machine to the QOM tree as '/machine'. - Passed current_machine->init_args to machine->init. - I will continue the series following his suggestions (Thanks!).
RFC v1 -> RFC v2 Replaced QemuOpts access by QOM queries. (The main addition) Addressed Paolo Bonzini's comments: - Eliminated duplicate fields (of QEMUMachineInitArgs and QemuMachineState) I am not sure about this one, it does mess with the "const" usage. Maybe delay this duplication removal until after QEMUMachineInitArgs disappears completely? - Added "machine-" prefix to QOM machine type. - An instance of QEMUMachineInitArgs os is used by QemuMachineState and not a pointer. The main benefit of QOMifying the qemu machine would be the possibility to have options per machine type and not global. However, there are other benefits as: - accessing qemu object properties instead of a global QemuOpts list from different code subsystems. - improving the machine "initialization" code (compat and stuff) - getting more close to QOM's vision of single interface for device creation and so on. Basically the series aims (in the long run) to convert: QEMUMachine -> MachineClass QEMUMachineInitArgs -> MachineState. As a first step, in order to make possible an incremental development, both QEMUMachine and QEMUMachineInitArgs are being embedded into the new types. Marcel Apfelbaum (3): hw/core: introduced qemu machine as QOM object vl: use qemu machine QOM class instead of global machines list hw/boards: converted current_machine to be an instance of MachineCLass device-hotplug.c | 4 +- hw/core/Makefile.objs | 2 +- hw/core/machine.c | 28 ++++++++++++ include/hw/boards.h | 58 +++++++++++++++++++++++- qmp.c | 7 ++- vl.c | 121 ++++++++++++++++++++++++++++++++++---------------- 6 files changed, 176 insertions(+), 44 deletions(-) create mode 100644 hw/core/machine.c -- 1.8.3.1