[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH V2 2/5] qapi: add event helper functions
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [RFC PATCH V2 2/5] qapi: add event helper functions |
Date: |
Thu, 06 Mar 2014 11:26:16 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 |
On 01/06/2014 03:23 PM, Luiz Capitulino wrote:
> On Fri, 3 Jan 2014 07:10:31 +0800
> Wenchao Xia <address@hidden> wrote:
>
>> This file hold some functions that do not need to be generated.
>>
>> Signed-off-by: Wenchao Xia <address@hidden>
>> ---
>> +static void timestamp_put(QDict *qdict)
>> +{
>> + int err;
>> + QObject *obj;
>> + qemu_timeval tv;
>> +
>> + err = qemu_gettimeofday(&tv);
>> + if (err < 0) {
>> + return;
>> + }
>
> Hmm, I see this has always existed (and I guess I did it myself), but it's
> not quite right. Sending an event w/o time info wouldn't be complaint to
> the protocol spec. It's a good idea to fix this now. We have three options:
>
> 1. abort()
>
> 2. Skip sending the event altogether
>
> 3. Add a bogus time value (say seconds=0 and microseconds=0)
>
> I don't know what's best, but I guess I'd do item 3. Although I wonder
> if zero is any better then no info at all (it's certainly complaint, but
> not a valid info). Maybe skip the event then?
I have a patch pending[1] for libvirt (missed libvirt 1.2.2, but will be
in 1.2.3) that exposes raw qemu events through libvirt-qemu.so
(basically, as a debugging aid, similar to libvirt's 'virsh
qemu-monitor-command', it will add 'virsh qemu-monitor-event'). In my
implementation, I documented that seconds=-1 implies a missing timestamp
(at which point microseconds is ignored, but can be set to 0). So I'm
in favor of option 3, but with -1 rather than 0 for seconds.
[1]https://www.redhat.com/archives/libvir-list/2014-February/msg00000.html
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Qemu-devel] [RFC PATCH V2 2/5] qapi: add event helper functions,
Eric Blake <=