From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44363) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLFfb-0000Br-MJ for qemu-devel@nongnu.org; Wed, 05 Mar 2014 12:31:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WLFfV-00015p-NC for qemu-devel@nongnu.org; Wed, 05 Mar 2014 12:31:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43873) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLFfV-00015X-Ed for qemu-devel@nongnu.org; Wed, 05 Mar 2014 12:31:45 -0500 From: Marcel Apfelbaum Date: Wed, 5 Mar 2014 19:30:44 +0200 Message-Id: <1394040647-20083-1-git-send-email-marcel.a@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v3 0/3] qemu-machine as a QOM object List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: ehabkost@redhat.com, mst@redhat.com, armbru@redhat.com, lcapitulino@redhat.com, blauwirbel@gmail.com, aliguori@amazon.com, imammedo@redhat.com, pbonzini@redhat.com, afaerber@suse.de 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=C3=A4rber'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 QemuMachine= State) I am not sure about this one, it does mess with the "const" usage. Maybe delay this duplication removal until after QEMUMachineInitArg= s disappears completely? - Added "machine-" prefix to QOM machine type. - An instance of QEMUMachineInitArgs os is used by QemuMachineState a= nd 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 --=20 1.8.3.1