qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Auditing QEMU to replace NULL with &error_abort


From: John Snow
Subject: Auditing QEMU to replace NULL with &error_abort
Date: Tue, 22 Jun 2021 11:20:44 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1

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.)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]