« Previous | Next » 

Revision 47c6d3ec

ID47c6d3ecdfc3fc354cf996f873a9f854c2325160

Added by Paolo Bonzini over 12 years ago

qapi: protect against NULL QObject in qmp_input_get_object

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 a property to its default value, though at this time
it will fail with "Invalid parameter type". In any case, anything is
better than crashing!

Reviewed-by: Anthony Liguori <>
Signed-off-by: Paolo Bonzini <>
Signed-off-by: Anthony Liguori <>

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences