On 01.11.2010, at 14:41, Paolo Bonzini wrote:

> On 11/01/2010 04:01 PM, Alexander Graf wrote:
>> diff --git a/hw/loader.c b/hw/loader.c
>> index 50b43a0..cb430e0 100644
>> --- a/hw/loader.c
>> +++ b/hw/loader.c
>> @@ -229,6 +229,11 @@ int load_aout(const char *filename, target_phys_addr_t 
>> addr, int max_sz,
>> 
>>  /* ELF loader */
>> 
>> +static void elf_default_note(void *opaque, uint8_t *name, uint32_t name_len,
>> +                             uint8_t *desc, uint32_t desc_len, uint32_t 
>> type)
>> +{
>> +}
>> +
>>  static uint64_t elf_default_translate(void *opaque, uint64_t addr)
>>  {
>>      return addr;
>> @@ -237,6 +242,8 @@ static uint64_t elf_default_translate(void *opaque, 
>> uint64_t addr)
>>  ElfHandlers elf_default_handlers = {
>>      .translate_fn = elf_default_translate,
>>      .translate_opaque = NULL,
>> +    .note_fn = elf_default_note,
>> +    .note_opaque = NULL,
> 
> Don't you have to add the definition to every user of translate_fn?
> 
> Maybe it's better to guard calls through the pointers with an if.

All users either pass NULL as translate (which means they default to 
elf_default_translate) or initialize their structure with the values in 
elf_default_translate :)


Alex


Reply via email to