[Qemu-devel] [PATCH 2/8] qapi: protect against NULL QObject in qmp_input_get_object

2011-12-16 Thread Paolo Bonzini
A NULL qobj can occur when a parameter is fetched via qdict_get, but the parameter is not in the command. By returning NULL, the caller can choose whether to raise a missing parameter error, an invalid parameter type error, or use a default value. For example, qom-set could can use this to reset

Re: [Qemu-devel] [PATCH 2/8] qapi: protect against NULL QObject in qmp_input_get_object

2011-12-16 Thread Anthony Liguori
On 12/16/2011 06:01 AM, Paolo Bonzini wrote: A NULL qobj can occur when a parameter is fetched via qdict_get, but the parameter is not in the command. By returning NULL, the caller can choose whether to raise a missing parameter error, an invalid parameter type error, or use a default value.