[libvirt] [PATCH] Unify *ReportError logic

Cole Robinson crobinso at redhat.com
Thu Oct 2 19:41:21 UTC 2008

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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: libvirt-unify-report-error.patch
Type: text/x-patch
Size: 4078 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20081002/3f8fff2c/attachment-0001.bin>

More information about the libvir-list mailing list