qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [QEMU PATCH] create struct for machine initialization a


From: Max Filippov
Subject: Re: [Qemu-devel] [QEMU PATCH] create struct for machine initialization arguments (v2)
Date: Sat, 6 Oct 2012 00:33:09 +0400

On Sat, Oct 6, 2012 at 12:22 AM, Eduardo Habkost <address@hidden> wrote:
> This should help us to:
> - More easily add or remove machine initialization arguments without
>   having to change every single machine init function;
> - More easily make mechanical changes involving the machine init
>   functions in the future;
> - Let machine initialization forward the init arguments to other
>   functions more easily.
>
> This change was half-mechanical process: first the struct was added with
> the local ram_size, boot_device, kernel_*, initrd_*, and cpu_model local
> variable initialization to all functions. Then the compiler helped me
> locate the local variables that are unused, so they could be removed.
>
> Changes v1 -> v2:
>  - Fix mistake on the conversion of pc_xen_hvm_init() and xen_init_pv()
>
> Signed-off-by: Eduardo Habkost <address@hidden>

[...]

> diff --git a/vl.c b/vl.c
> index 8d305ca..f663e7c 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -3624,8 +3624,13 @@ int main(int argc, char **argv, char **envp)
>
>      qdev_machine_init();
>
> -    machine->init(ram_size, boot_devices,
> -                  kernel_filename, kernel_cmdline, initrd_filename, 
> cpu_model);
> +    QEMUMachineInitArgs args = { .ram_size = ram_size,
> +                                 .boot_device = boot_devices,
> +                                 .kernel_filename = kernel_filename,
> +                                 .kernel_cmdline = kernel_cmdline,
> +                                 initrd_filename = initrd_filename,

Missing dot?

> +                                 .cpu_model = cpu_model };
> +    machine->init(&args);
>
>      cpu_synchronize_all_post_init();

-- 
Thanks.
-- Max



reply via email to

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