[Libvir] [PATCH] Use virErrorMsg in qemudReportError

Currently the qemu driver doesn't use virErrorMsg when raising error messages. This causes some errors to appear as "libvir: QEMU error: " if a custom string wasn't raised, which isn't all that useful. The patch below fixes this. Thanks, Cole diff --git a/src/qemu_conf.c b/src/qemu_conf.c index e39c7bc..6aed88b 100644 --- a/src/qemu_conf.c +++ b/src/qemu_conf.c @@ -58,6 +58,7 @@ void qemudReportError(virConnectPtr conn, int code, const char *fmt, ...) { va_list args; char errorMessage[QEMUD_MAX_ERROR_LEN]; + const char *virerr; if (fmt) { va_start(args, fmt); @@ -66,8 +67,10 @@ void qemudReportError(virConnectPtr conn, } else { errorMessage[0] = '\0'; } + + virerr = __virErrorMsg(code, (errorMessage[0] ? errorMessage[0] : NULL)); __virRaiseError(conn, dom, net, VIR_FROM_QEMU, code, VIR_ERR_ERROR, - NULL, NULL, NULL, -1, -1, "%s", errorMessage); + virerr, errorMessage, NULL, -1, -1, virerr, errorMessage); } int qemudLoadDriverConfig(struct qemud_driver *driver,

On Wed, Feb 20, 2008 at 12:28:23PM -0500, Cole Robinson wrote:
Currently the qemu driver doesn't use virErrorMsg when raising error messages. This causes some errors to appear as "libvir: QEMU error: " if a custom string wasn't raised, which isn't all that useful. The patch below fixes this.
Ah, cnice catch - surprised no one has noticed this before. Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|

Daniel P. Berrange wrote:
On Wed, Feb 20, 2008 at 12:28:23PM -0500, Cole Robinson wrote:
Currently the qemu driver doesn't use virErrorMsg when raising error messages. This causes some errors to appear as "libvir: QEMU error: " if a custom string wasn't raised, which isn't all that useful. The patch below fixes this.
Ah, cnice catch - surprised no one has noticed this before.
Dan.
Hmm, I haven't seen this committed yet, I assume it was just forgotten. Could this be applied if the patch is okay? Thanks, Cole

On Wed, Feb 27, 2008 at 04:31:50PM -0500, Cole Robinson wrote:
Daniel P. Berrange wrote:
On Wed, Feb 20, 2008 at 12:28:23PM -0500, Cole Robinson wrote:
Currently the qemu driver doesn't use virErrorMsg when raising error messages. This causes some errors to appear as "libvir: QEMU error: " if a custom string wasn't raised, which isn't all that useful. The patch below fixes this.
Ah, cnice catch - surprised no one has noticed this before.
Dan.
Hmm, I haven't seen this committed yet, I assume it was just forgotten. Could this be applied if the patch is okay?
Okay, I have commited this, thanks ! Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
participants (3)
-
Cole Robinson
-
Daniel P. Berrange
-
Daniel Veillard