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: Eric Blake
Subject: Re: [Qemu-devel] [QEMU PATCH] create struct for machine initialization arguments (v2)
Date: Fri, 05 Oct 2012 14:54:24 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120911 Thunderbird/15.0.1

On 10/05/2012 02:40 PM, Eduardo Habkost wrote:

>>> -    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?
> 
> Funny, GCC didn't complain. Thanks for spotting it!

Eww, insidious :P.  This assigned local variable initrd_filename to
itself, then put the lvalue result of that assignment as the initializer
to the next available struct member residing after .kernel_cmdline
(which happened to be .initrd_filename).  That is, gcc didn't complain
because it worked by sheer dumb luck.

-- 
Eric Blake   address@hidden    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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