On 29.10.2012, at 09:48, Alexander Graf wrote:

> 
> On 29.10.2012, at 06:21, Olivia Yin wrote:
> 
>> Signed-off-by: Olivia Yin <hong-hua....@freescale.com>
>> ---
>> hw/cirrus_vga.c |    6 +++++-
>> hw/pc.c         |    6 +++++-
>> hw/pc_sysfw.c   |   14 +++++++-------
>> hw/pci.c        |   10 ++++++++--
>> hw/sga.c        |    6 +++++-
>> hw/vga-isa.c    |    6 +++++-
>> 6 files changed, 35 insertions(+), 13 deletions(-)
>> 
>> diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
>> index e4af2e9..8b2c974 100644
>> --- a/hw/cirrus_vga.c
>> +++ b/hw/cirrus_vga.c
>> @@ -2906,7 +2906,11 @@ static int vga_initfn(ISADevice *dev)
>>    s->ds = graphic_console_init(s->update, s->invalidate,
>>                                 s->screen_dump, s->text_update,
>>                                 s);
>> -    rom_add_vga(VGABIOS_CIRRUS_FILENAME);
>> +    ImageFile *image;
>> +    image = g_malloc(sizeof(*image));
>> +    image->name = g_strdup(VGABIOS_CIRRUS_FILENAME);
>> +    image->addr = 0;
>> +    qemu_register_reset(image_file_reset, image);
> 
> This looks like a perfect candidate for a helper function, no? ;)
> 
> In fact, maybe you should just leave the old rom_ function names and simply 
> replace them by the snippet above.

And make sure to reuse the rom structs too, so things like rom_copy() remain 
functional. Of course you'll have to add a check for the new rom type so that 
you don't access the "data" field in there. But if you reuse that 
infrastructure, everything will just happily plug in.


Alex


Reply via email to