Luiz Capitulino <lcapitul...@redhat.com> writes:

> On Fri, 20 Nov 2009 15:06:26 +0100
> Markus Armbruster <arm...@redhat.com> wrote:
>
>> Luiz Capitulino <lcapitul...@redhat.com> writes:
[...]
>> > diff --git a/block.c b/block.c
>> > index 6fdabff..fc4e2f2 100644
>> > --- a/block.c
>> > +++ b/block.c
[...]
>> > -        monitor_printf(mon, " removable=%d", bs->removable);
>> > -        if (bs->removable) {
>> > -            monitor_printf(mon, " locked=%d", bs->locked);
>> > -        }
>> > +
>> > +        bs_obj = qobject_from_jsonf("{ 'device': %s, 'type': %s, "
>> > +                                    "'removable': %i, 'locked': %i }",
>> > +                                    bs->device_name, type, bs->removable,
>> > +                                    bs->locked);
>> > +        assert(bs_obj != NULL);
>> 
>> Failure modes of qobject_from_jsonf()?  I'm asking because depending on
>> the answer assert() may not be appropriate here.
>
>  As far as I know it will fail on wrong syntax.

In that case, assert() catches a programming error.  That's fine.


Reply via email to