[PATCH] Use virErrorMsg in qemudReportError

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

 



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,

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]