qdev: print error message before aborting

qdev_prop_set_* functions are always called by machine init functions
that should know what they're doing, so they abort on error.  Still,
an assert(!errp) does not aid debugging.  Print an error before aborting.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
Paolo Bonzini 2012-02-14 10:19:53 +01:00 committed by Blue Swirl
parent 0a54a0ce3e
commit 59f971d451
3 changed files with 22 additions and 13 deletions

View file

@ -572,6 +572,14 @@ void qerror_report_err(Error *err)
}
}
void assert_no_error(Error *err)
{
if (err) {
qerror_report_err(err);
abort();
}
}
/**
* qobject_to_qerror(): Convert a QObject into a QError
*/