All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Marcel Apfelbaum <marcel.a@redhat.com>, qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, blauwirbel@gmail.com,
	mdroth@linux.vnet.ibm.com, mst@redhat.com, armbru@redhat.com,
	mtosatti@redhat.com, agraf@suse.de, ehabkost@redhat.com,
	lcapitulino@redhat.com, peter.crosthwaite@petalogix.com,
	quintela@redhat.com, aliguori@amazon.com, imammedo@redhat.com,
	scottwood@freescale.com, edgar.iglesias@gmail.com,
	afaerber@suse.de, rth@twiddle.net
Subject: Re: [Qemu-devel] [PATCH RFC V2 0/9] qemu-machine as a QOM object
Date: Mon, 03 Mar 2014 11:50:05 +0100	[thread overview]
Message-ID: <53145E5D.30704@redhat.com> (raw)
In-Reply-To: <1393765632-2753-1-git-send-email-marcel.a@redhat.com>

Il 02/03/2014 14:07, Marcel Apfelbaum ha scritto:
> Most of the "Cc" list is due to patch 8: (Should I send each patch to a different list?)
>     machine-opts: replace qemu_opt_get by QOM QemuMachine queries.
>
> Status:
>     - machine_opts are mapped into QemuMachineState's properties,
>       which can be queried as regular QOM properties.
>     - Subclassing QemuMachineClass allows to add a command line
>       option specific to a machine type, error mechanism should
>       work if this option is used on another machine. (Not tested, on the todo list.)
>     - Next big step would be to completely remove the qemu machines initialization
>       and replace it by regular QOM type registration.
Having seen all the series, I think we can plan the actual code as follows.

Patches 1-3 are fine (except for the missing object_property_add_child 
in patch 3).  Patch 4 is also fine, but it should refer to the embedded 
QEMUMachineInitArgs.

The .machine field from QEMUMachineArgs can be removed very early.  It 
can be replaced with the class of current_machine.

Another early refactoring should be to pass &current_machine->init_args 
to machine->init, not the "args".

Now here's a possible plan to get rid of QEMUMachineInitArgs:

1) Add three wrappers to QemuMachine for reading kernel_filename, 
kernel_cmdline, initrd_filename.  Unlike object_property_get_str, they 
can skip the strdup of the value.  This way you don't have to add the 
matching free to all uses of the fields.

2) Similarly, add get/set functions (not properties, since these are not 
accessible via -machine) for ram_size, boot_order, cpu_model.

3) Now you can have something like patch 8 in this series.

4) Thanks to the previous change, there should be no usage of 
QEMUMachineInitArgs anymore.  Change the machine init function to take a 
"QemuMachineState *current_machine".

5) Remove the current_machine global.  There will be few users of 
current_machine, and they can look at /machine instead, as mentioned in 
the review of patch 3.

Does it look feasible?  The bulk changes should all be fairly mechanical.

Paolo

  parent reply	other threads:[~2014-03-03 10:50 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-02 13:07 [Qemu-devel] [PATCH RFC V2 0/9] qemu-machine as a QOM object Marcel Apfelbaum
2014-03-02 13:07 ` [Qemu-devel] [PATCH RFC V2 1/9] hw/core: introduced qemu machine as " Marcel Apfelbaum
2014-03-03 12:56   ` Michael S. Tsirkin
2014-03-03 17:49   ` Andreas Färber
2014-03-03 19:06     ` Marcel Apfelbaum
2014-03-02 13:07 ` [Qemu-devel] [PATCH RFC V2 2/9] vl: use qemu machine QOM class instead of global machines list Marcel Apfelbaum
2014-03-03 12:58   ` Michael S. Tsirkin
2014-03-03 12:57     ` Paolo Bonzini
2014-03-03 13:03       ` Marcel Apfelbaum
2014-03-03 14:52         ` Andreas Färber
2014-03-03 15:05           ` Marcel Apfelbaum
2014-03-03 18:12   ` Andreas Färber
2014-03-03 19:54     ` Marcel Apfelbaum
2014-03-02 13:07 ` [Qemu-devel] [PATCH RFC V2 3/9] hw/boards: converted current_machine to be an instance of QemuMachineCLass Marcel Apfelbaum
2014-03-03 10:49   ` Paolo Bonzini
2014-03-03 12:07     ` Marcel Apfelbaum
2014-03-03 12:46       ` Paolo Bonzini
2014-03-03 12:11     ` Marcel Apfelbaum
2014-03-02 13:07 ` [Qemu-devel] [PATCH RFC V2 4/9] hw/machine: add qemu machine opts as properties to QemuMachineState Marcel Apfelbaum
2014-03-02 13:07 ` [Qemu-devel] [PATCH RFC V2 5/9] qapi: output visitor crashes qemu if it encounters a NULL value Marcel Apfelbaum
2014-03-02 13:07 ` [Qemu-devel] [PATCH RFC V2 6/9] vl.c: do not set 'type' property in obj_set_property Marcel Apfelbaum
2014-03-03 10:11   ` Paolo Bonzini
2014-03-03 12:09     ` Marcel Apfelbaum
2014-03-03 12:47       ` Paolo Bonzini
2014-03-02 13:07 ` [Qemu-devel] [PATCH RFC V2 7/9] qom: add object_property_is_set Marcel Apfelbaum
2014-03-03 10:13   ` Paolo Bonzini
2014-03-03 12:09     ` Marcel Apfelbaum
2014-03-02 13:07 ` [Qemu-devel] [PATCH RFC V2 8/9] machine-opts: replace qemu_opt_get by QOM QemuMachine queries Marcel Apfelbaum
2014-03-03 10:11   ` Paolo Bonzini
2014-03-03 12:10     ` Marcel Apfelbaum
2014-03-02 13:07 ` [Qemu-devel] [PATCH RFC V2 9/9] hw/core: mapped QemuOpts into QEMUMachineInitArgs fields to remove duplication Marcel Apfelbaum
2014-03-03 10:13   ` Paolo Bonzini
2014-03-03 12:10     ` Marcel Apfelbaum
2014-03-03 10:50 ` Paolo Bonzini [this message]
2014-03-03 12:07   ` [Qemu-devel] [PATCH RFC V2 0/9] qemu-machine as a QOM object Marcel Apfelbaum
2014-03-03 12:56     ` Paolo Bonzini
2014-03-03 13:17       ` Marcel Apfelbaum
2014-03-03 14:10         ` Andreas Färber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53145E5D.30704@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=aliguori@amazon.com \
    --cc=armbru@redhat.com \
    --cc=blauwirbel@gmail.com \
    --cc=edgar.iglesias@gmail.com \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=marcel.a@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=mst@redhat.com \
    --cc=mtosatti@redhat.com \
    --cc=peter.crosthwaite@petalogix.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=rth@twiddle.net \
    --cc=scottwood@freescale.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.