On 02/24/2017 11:11 AM, Thomas Huth wrote: >>> ... and then you do another error_report here again ... so one error >>> gets reported with two error message. Wouldn't it be nicer to rather do >>> error_setg(...) in load_netboot_image() and then report only one error >>> at this level here? >>> >> >> What would be the advantage of doing that? > > It's just good coding style to report an error only once, at the > outermost calling function. Otherwise the same error gets reported > multiple times to the user, with different error messages, and that can > easily get confusing. It's likely not a big problem here yet, since the > call depths is only 2 functions, but imagine a situation where you've > got a call depth or 5 or more and an error is reported at every > depths... that's ugly. So this is why we've got error_setg() and friends > in QEMU. > > Thomas
Farhan was already convinced. Can you check v2 of this patch set? Thanks for doing the review :-)