qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] machine: set default kernel_cmdline in machine_


From: Marcel Apfelbaum
Subject: Re: [Qemu-devel] [PATCH] machine: set default kernel_cmdline in machine_initfn()
Date: Thu, 29 May 2014 15:21:36 +0300

On Thu, 2014-05-29 at 12:47 +0200, Andreas Färber wrote:
> Am 29.05.2014 11:47, schrieb Igor Mammedov:
> > ... fixes freeing constant from vl.c by machine_finalize()
> > 
> > Signed-off-by: Igor Mammedov <address@hidden>
> 
> Did you check whether there are any others in need of changes? I could
> imagine kernel_irqchip does, and I see that we forgot to fix the
> underscore in the property name, damn. Marcel, can you please look into
> fixing that? I had outlined how to.
Hi Andreas,

I didn't forget to do that, I responded on the mail thread why I think we 
shouldn't,
even if is against QOM best practices.
I'll copy-paste:

Anyway, the real problem here is that what is elegant in this solution is:
    machine_opts = qemu_get_machine_opts();
    if (qemu_opt_foreach(machine_opts, object_set_property, current_machine, 1) 
< 0) {
        object_unref(OBJECT(current_machine));
        exit(1);
    }
It automatically fills in the machine state properties with the options from 
the command line.
It will work with machine sub-types that have specific properties without the 
need
to manually add it to vl.c. The error flow is also elegant (if a sub-type does 
not have the
user supplied property).

If we use machine-specific wrappers to convert "_" -> "-" we loose the above.
As an alternative we could rename the machine option to use "-"...

Thanks,
Marcel
 
> 
> Andreas
> 






reply via email to

[Prev in Thread] Current Thread [Next in Thread]