qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] use an unsigned long for the max_sz parameter i


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH] use an unsigned long for the max_sz parameter in load_image_targphys
Date: Mon, 12 Mar 2012 16:09:04 +0000

On 12 March 2012 16:04, Alexander Graf <address@hidden> wrote:
> On 12.03.2012, at 16:53, Markus Armbruster wrote:
>> To be honest, the whole debate feels like bikeshedding to me.  Yes,
>> load_image_targphys()'s argument max_sz is the size of a slice of guest
>> memory.  It's also the size of a host object, allocated with g_malloc0()
>> in rom_add_file().  It's also the size of a disk file.
>>
>> I'd make it size_t and be done with it.  If you absolutely must
>> overengineer things, go ahead and create a new type for target sizes.  I
>> doubt making it wider than size_t will work in practice without a lot of
>> hoop jumping, though.
>
> I agree. Let's end this discussion and use the biggest variable type we
> support for addresses: uint64_t. That way we have host independent
> predictability, but don't use _addr_t types which Andreas seems to dislike.

Works for me, and follows the precedent of the memory region API, which
makes sense.

-- PMM



reply via email to

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