Blame SOURCES/0036-s390x-launch-libvirt-Use-console-device-sclp-for-app.patch

a30de4
From c73e6d1e2dcbcf2c7b17096953e48bc5a84ee7d2 Mon Sep 17 00:00:00 2001
a30de4
From: "Richard W.M. Jones" <rjones@redhat.com>
a30de4
Date: Tue, 16 May 2017 20:12:54 +0200
a30de4
Subject: [PATCH] s390x: launch: libvirt: Use <console> device sclp for
a30de4
 appliance debug messages (RHBZ#1376547).
a30de4
a30de4
Thanks: Cole Robinson, Dan Horak, Thomas Huth.
a30de4
(cherry picked from commit 6328f332361675abb0233db890d2bfe0d9a5092a)
a30de4
---
a30de4
 lib/launch-libvirt.c | 17 +++++++++++++++++
a30de4
 1 file changed, 17 insertions(+)
a30de4
a30de4
diff --git a/lib/launch-libvirt.c b/lib/launch-libvirt.c
a30de4
index 681281b9b..49bd40583 100644
a30de4
--- a/lib/launch-libvirt.c
a30de4
+++ b/lib/launch-libvirt.c
a30de4
@@ -1347,6 +1347,7 @@ construct_libvirt_xml_devices (guestfs_h *g,
a30de4
         return -1;
a30de4
     }
a30de4
 
a30de4
+#ifndef __s390x__
a30de4
     /* Console. */
a30de4
     start_element ("serial") {
a30de4
       attribute ("type", "unix");
a30de4
@@ -1358,6 +1359,22 @@ construct_libvirt_xml_devices (guestfs_h *g,
a30de4
         attribute ("port", "0");
a30de4
       } end_element ();
a30de4
     } end_element ();
a30de4
+#else
a30de4
+    /* https://bugzilla.redhat.com/show_bug.cgi?id=1376547#c14
a30de4
+     * and https://libvirt.org/formatdomain.html#elementCharConsole
a30de4
+     */
a30de4
+    start_element ("console") {
a30de4
+      attribute ("type", "unix");
a30de4
+      start_element ("source") {
a30de4
+        attribute ("mode", "connect");
a30de4
+        attribute ("path", params->data->console_path);
a30de4
+      } end_element ();
a30de4
+      start_element ("target") {
a30de4
+	attribute ("type", "sclp");
a30de4
+        attribute ("port", "0");
a30de4
+      } end_element ();
a30de4
+    } end_element ();
a30de4
+#endif
a30de4
 
a30de4
     /* Virtio-serial for guestfsd communication. */
a30de4
     start_element ("channel") {
a30de4
-- 
a30de4
2.14.3
a30de4