qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] qobject/qjson.c:69: failed assertion `obj != NULL'


From: Eric Blake
Subject: Re: [Qemu-devel] qobject/qjson.c:69: failed assertion `obj != NULL'
Date: Tue, 22 Nov 2016 16:41:11 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0

On 11/22/2016 04:22 PM, G 3 wrote:

>> On the other hand, timestamp_put() (which now lives in qapi/qmp-event.c,
>> rather than monitor.c) is still using qobject_from_jsonf() with PRId64
>> in current git master.  If you don't want to hack the JSON parser (and I
>> recommend that you don't), the alternative is to get rid of that
>> function call and replace it with an open-coded construction of a QDict
>> with manual population of its two members.  It's hard to argue that the
>> complexity of maintaining our pseudo-printf JSON parser for constructing
>> a QObject with one line is worth the effort compared to the three or
>> four lines to construct the same QObject by hand.
> 
> I would just like to note for anyone else who might face this problem in
> the
> future that replacing %PRId64 with %lld fixed the problem. I made the
> replacement in timestamp_put().

It works for you, but not for platforms where uint64_t is 'long int',
such that the compiler would complain if you don't use '%ld'.  I'm still
working on my patches, but will soon post three minimal patches for 2.8
plus a longer series of patches for 2.9 that cleans up the mess for all
platforms.

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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]