All of lore.kernel.org
 help / color / mirror / Atom feed
* Auditing QEMU to replace NULL with &error_abort
@ 2021-06-22 15:20 John Snow
  2021-06-23 12:16 ` Markus Armbruster
  0 siblings, 1 reply; 7+ messages in thread
From: John Snow @ 2021-06-22 15:20 UTC (permalink / raw)
  To: Markus Armbruster
  Cc: Thomas Huth, Philippe Mathieu-Daudé, QEMU Developers, Max Reitz

One of our Bite-Sized tasks on the wiki was to audit QEMU and, where 
applicable, replace NULL with &error_abort.

Everywhere else where it is intentional, we ought to add a comment or 
some other indication explaining why it's the right thing to do in that 
case.

That task was ported to GitLab here:
https://gitlab.com/qemu-project/qemu/-/issues/414

mreitz and thuth have chimed in with excellent clarifications. Phil 
suggests that we should replace the intentional cases of NULL with 
&error_ignore, to possibly log squelched errors in debugging mode. This 
sounds like a great idea to me:

- It allows us to remove NULL entirely, which as mreitz states "is 
fishy", but sometimes valid.
- It annotates callsites where we have decided the ignore is intentional 
and correct.
- It gives us a review opportunity to require good comments at those 
callsites.
- It gives us a good way to measure progress of the audit by making the 
removal of NULL a concrete goal. (Can we use coccinelle to find all 
instances of the literal NULL being passed to a variable named errp?)

 From a brief chat on IRC, Markus is "reluctant to deviate from GError 
even more". It sounds like there isn't consensus here. We should 
probably reach consensus on this point before trying to pass the task 
off to a neophyte, though -- so I'm raising this discussion on the list 
and CC'ing Markus to see if we can define the task better or not.

--js


(Personally, I've got no horse in the race beyond moving these tasks off 
the wiki and onto the tracker. Since I moved the issue, though, I might 
as well make sure the filing is accurate.)



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-06-23 17:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-22 15:20 Auditing QEMU to replace NULL with &error_abort John Snow
2021-06-23 12:16 ` Markus Armbruster
2021-06-23 15:01   ` John Snow
2021-06-23 15:08   ` Daniel P. Berrangé
2021-06-23 15:31     ` Marc-André Lureau
2021-06-23 15:39       ` Daniel P. Berrangé
2021-06-23 17:24         ` Daniel P. Berrangé

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.