
On Thu, Oct 02, 2008 at 08:53:12PM +0100, Daniel P. Berrange wrote:
On Thu, Oct 02, 2008 at 03:41:21PM -0400, Cole Robinson wrote:
Currently, most src/* files have their own ReportError function. Some support printf style arguments, others only allow reporting a single string message. The code for all of them does virtually the same thing, possibly passing a different constant off to another function.
The attached patch adds a function to virterror.c which encapsulates the common ReportError logic. I used this to replace qemudReportError with a macro, which also allows passing off filename and line number info if we wanted to do something with it later.
I did just the one function conversion to see what people think: if I'm missing something, or ideas for anything else to add. Seems to work as expected in my testing.
Basically a good idea - we've discussed doing exactly this in the past. You can do further though, and kill off the 'dom' and 'net' parameters here too. Those are deprecated and should always be left NULL these days.
i'm still a bit sad about this though, I'm still left with the feeling that being unable to refcount, result in a loss of useful informations. Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/