Re: [PATCH] qemu: optimize JSON event handler lookup

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

 



On 04/10/2012 06:53 PM, Wen Congyang wrote:
> At 04/11/2012 06:47 AM, Eric Blake Wrote:
>> Probably in the noise, but this will let us scale more efficiently
>> as we recognize ever more qemu events.
>>
>> * src/qemu/qemu_monitor_json.c (eventHandlers): Sort.
>> (eventSearch): New helper function.
>> (qemuMonitorJSONIOProcessEvent): Optimize event lookup.
>> ---
>>
>> In reply to:
>> https://www.redhat.com/archives/libvir-list/2012-April/msg00416.html
>>

>> +static qemuEventHandler eventHandlers[] = {
>> +    { "BLOCK_IO_ERROR", qemuMonitorJSONHandleIOError, },
>> +    { "BLOCK_JOB_CANCELLED", qemuMonitorJSONHandleBlockJobCanceled, },
> 
> I donot find this event...
> 

>> -    { "BLOCK_JOB_COMPLETED", qemuMonitorJSONHandleBlockJobCompleted, },
>> -    { "BLOCK_JOB_CANCELLED", qemuMonitorJSONHandleBlockJobCanceled, },

It is not in libvirt.git, but is there if you apply this patch after my
live storage migration series.  At any rate, I can certainly rebase
things correctly if we like the approach of this patch, and want it
applied now.

>> +static int
>> +eventSearch(const void *key, const void *elt) {
> 
> Hmm, I think eventCompare is better than eventSearch.

For that matter, I think I'll name things qemuMonitorEventCompare, so
that the function is in the file namespace (being static, a shorter name
doesn't matter on the technical front; but our style as of late has been
to use consistent naming even for static functions).

v2 coming up, rebased to apply without waiting on my storage migration
series.

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]