qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 11/17] block: Convert bdrv_info() to QObject


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH 11/17] block: Convert bdrv_info() to QObject
Date: Mon, 23 Nov 2009 16:34:31 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Luiz Capitulino <address@hidden> writes:

> On Fri, 20 Nov 2009 15:06:26 +0100
> Markus Armbruster <address@hidden> wrote:
>
>> Luiz Capitulino <address@hidden> 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

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