[libvirt] [PATCH v2 0/2] improve error reporting if qemu doesn't print any error

Pavel Hrdina (2): qemu_monitor: rephrase error message if qemu closes monitor qemu_process: don't print empty line if qemu exits without any error src/qemu/qemu_monitor.c | 3 +-- src/qemu/qemu_process.c | 7 +++++-- 2 files changed, 6 insertions(+), 4 deletions(-) -- 2.8.3

Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/qemu/qemu_monitor.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 597307f..3524d22 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -719,8 +719,7 @@ qemuMonitorIO(int watch, int fd, int events, void *opaque) * "connection reset by peer" message. */ mon->logFunc(mon, - _("early end of file from monitor, " - "possible problem"), + _("qemu unexpectedly closed monitor"), mon->logOpaque); virCopyLastError(&mon->lastError); virResetLastError(); -- 2.8.3

On Wed, Jun 08, 2016 at 12:37:35 +0200, Pavel Hrdina wrote:
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/qemu/qemu_monitor.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 597307f..3524d22 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -719,8 +719,7 @@ qemuMonitorIO(int watch, int fd, int events, void *opaque) * "connection reset by peer" message. */ mon->logFunc(mon, - _("early end of file from monitor, " - "possible problem"), + _("qemu unexpectedly closed monitor"),
s/closed monitor/closed the monitor/ ACK

Resolves: Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1335617 Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/qemu/qemu_process.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 87c1fe8..397dac7 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -1809,8 +1809,11 @@ qemuProcessReportLogError(qemuDomainLogContextPtr logCtxt, return -1; virResetLastError(); - virReportError(VIR_ERR_INTERNAL_ERROR, - _("%s: %s"), msgprefix, logmsg); + if (virStringIsEmpty(logmsg)) + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", msgprefix); + else + virReportError(VIR_ERR_INTERNAL_ERROR, _("%s: %s"), msgprefix, logmsg); + VIR_FREE(logmsg); return 0; } -- 2.8.3

On Wed, Jun 08, 2016 at 12:37:36 +0200, Pavel Hrdina wrote:
Resolves: Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1335617
s/^Resolves: //
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> --- src/qemu/qemu_process.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 87c1fe8..397dac7 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -1809,8 +1809,11 @@ qemuProcessReportLogError(qemuDomainLogContextPtr logCtxt, return -1;
virResetLastError(); - virReportError(VIR_ERR_INTERNAL_ERROR, - _("%s: %s"), msgprefix, logmsg); + if (virStringIsEmpty(logmsg)) + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", msgprefix); + else + virReportError(VIR_ERR_INTERNAL_ERROR, _("%s: %s"), msgprefix, logmsg);
Stupid syntax check. I think the translators really like this string. ACK
participants (2)
-
Pavel Hrdina
-
Peter Krempa