On Wed, Sep 29, 2021 at 10:58:16AM +0800, Yanan Wang wrote: > Quoting one of the Rules described in include/qapi/error.h: > " > Whenever practical, also return a value that indicates success / > failure. This can make the error checking more concise, and can > avoid useless error object creation and destruction. Note that > we still have many functions returning void. We recommend > • bool-valued functions return true on success / false on failure, > • pointer-valued functions return non-null / null pointer, and > • integer-valued functions return non-negative / negative. > " > > So make smp_parse() return true on success and false on failure, > so that we can more laconically check whether the parsing has > succeeded without touching the errp. > > Suggested-by: Philippe Mathieu-Daudé <phi...@redhat.com> > Signed-off-by: Yanan Wang <wangyana...@huawei.com> > --- > hw/core/machine.c | 17 +++++++++-------- > 1 file changed, 9 insertions(+), 8 deletions(-)
Reviewed-by: Daniel P. Berrangé <berra...@redhat.com> Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|