c1c534
From 5071540b203f4e368506d4596b16484a8726d534 Mon Sep 17 00:00:00 2001
c1c534
Message-Id: <5071540b203f4e368506d4596b16484a8726d534@dist-git>
c1c534
From: Jiri Denemark <jdenemar@redhat.com>
c1c534
Date: Wed, 22 Nov 2017 10:19:12 +0100
c1c534
Subject: [PATCH] qemu: Properly skip "char device redirected to" in QEMU log
c1c534
c1c534
When reading QEMU log for reporting it as an error message, we want to
c1c534
skip "char device redirected to" line. However, this string is not
c1c534
printed at the beginning of a line, which means STRPREFIX will never
c1c534
find it.
c1c534
c1c534
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
c1c534
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
c1c534
(cherry picked from commit 7e0cd26db475ed72257bd99be606ac8f2095231a)
c1c534
c1c534
https://bugzilla.redhat.com/show_bug.cgi?id=1335534
c1c534
c1c534
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
c1c534
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
c1c534
---
c1c534
 src/qemu/qemu_process.c | 2 +-
c1c534
 1 file changed, 1 insertion(+), 1 deletion(-)
c1c534
c1c534
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
c1c534
index 86a4dee88e..c5fa8cb4b2 100644
c1c534
--- a/src/qemu/qemu_process.c
c1c534
+++ b/src/qemu/qemu_process.c
c1c534
@@ -1847,7 +1847,7 @@ qemuProcessReadLog(qemuDomainLogContextPtr logCtxt, char **msg)
c1c534
     while ((eol = strchr(filter_next, '\n'))) {
c1c534
         *eol = '\0';
c1c534
         if (virLogProbablyLogMessage(filter_next) ||
c1c534
-            STRPREFIX(filter_next, "char device redirected to")) {
c1c534
+            strstr(filter_next, "char device redirected to")) {
c1c534
             size_t skip = (eol + 1) - filter_next;
c1c534
             memmove(filter_next, eol + 1, buf + got - eol);
c1c534
             got -= skip;
c1c534
-- 
c1c534
2.15.0
c1c534