On 11/02/2016 05:38 PM, Paolo Bonzini wrote:
> 
> 
> On 02/11/2016 11:45, Juan Quintela wrote:
>>>> +    while (qemu_get_byte(f)) {
>>>> +        elm = g_malloc(size);
>> I think this is not generic enough.  We really need to allocate a new
>> element, and then fill it with default values.
>>
>> virtio list code use it in this way.
> 
> One thing at a time?  The allocation and "looping" are different
> mechanisms.  We can customize the allocation later.
> 
> Paolo
> 

+1

And while at it how about s/g_malloc/gmalloc0? This would possibly make
something like mismatch in .start between source and target easier to
detect, along with the 'untouched' fields mentioned by Jianjun.
(Although I'm not sure how untouched fields and the virtio list use is
connected. In my understanding the problem pointed out by Juan has
something to do with the address of a element/node having significance
beyond the list.)

Halil


Reply via email to