Re: [patch] remove vcpu_info array v5

Jes Sorensen
2008-11-10T13:30:25Z

Avi Kivity wrote:
>> Yes, but I believe the whole point of jes patches is to remove those
>> limits.
>>
>
> So we could linear search huge lists? Or code hashes where arrays would
> do? No, sir.
>
> An array of pointers statically sized at MAX_CPUS is fine. If you
> insist, you can realloc() it on demand.

Sorry, but this is riciculous. Please try and take a look at where the
search is performed. It's *solely* in the ACPI hot plug code.

realloc() is not an option, unless of course you are in favor of putting
a big lock around all access to such an array.

My patch gets rid of the pointless MAX_CPUS sized array, which doesn't
buy us anything. In fact, most of the changes in my patch makes the
code simpler, because it removes a stack of silly cases where qemu uses
env->cpu_index to get into the array, just to hide CPUState from libkvm,
just to have the callback in QEMU go from int vcpu back to CPUState.

Lets just do it right and get rid of this silliness.

Jes