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

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

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

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

Attachment: signature.asc
Description: OpenPGP digital signature

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