On 01/06/2014 03:23 PM, Luiz Capitulino wrote: > On Fri, 3 Jan 2014 07:10:31 +0800 > Wenchao Xia <xiaw...@linux.vnet.ibm.com> wrote: > >> This file hold some functions that do not need to be generated. >> >> Signed-off-by: Wenchao Xia <xiaw...@linux.vnet.ibm.com> >> ---
>> +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