mrc0mmand / rpms / libguestfs

Forked from rpms/libguestfs 3 years ago
Clone

Blame SOURCES/0181-p2v-Chomp-kernel-command-line-RHBZ-1229340.patch

ffd6ed
From 82ef64343231734b0ea08e083b4c2a8dc77d2877 Mon Sep 17 00:00:00 2001
ffd6ed
From: "Richard W.M. Jones" <rjones@redhat.com>
ffd6ed
Date: Mon, 8 Jun 2015 14:40:20 +0100
ffd6ed
Subject: [PATCH] p2v: Chomp kernel command line (RHBZ#1229340).
ffd6ed
ffd6ed
When using the kernel command line to configure virt-p2v, if any p2v.*
ffd6ed
parameter appeared right at the end of the kernel command line, then a
ffd6ed
bogus \n would be appended.  Remove this.
ffd6ed
ffd6ed
This is essentially the same fix as:
ffd6ed
https://github.com/libguestfs/supermin/commit/4819655b3c96e836e46d0d679f84b10f8e9abcf5
ffd6ed
ffd6ed
(cherry picked from commit 6114c10df05cdb1662ac22930010fd45714f9c40)
ffd6ed
---
ffd6ed
 p2v/main.c | 3 +++
ffd6ed
 1 file changed, 3 insertions(+)
ffd6ed
ffd6ed
diff --git a/p2v/main.c b/p2v/main.c
ffd6ed
index 6d71dd4..fd9c156 100644
ffd6ed
--- a/p2v/main.c
ffd6ed
+++ b/p2v/main.c
ffd6ed
@@ -517,6 +517,9 @@ read_cmdline (void)
ffd6ed
     return NULL;
ffd6ed
   }
ffd6ed
 
ffd6ed
+  if (len >= 1 && ret[len-1] == '\n')
ffd6ed
+    ret[len-1] = '\0';
ffd6ed
+
ffd6ed
   return ret;
ffd6ed
 }
ffd6ed
 
ffd6ed
-- 
ffd6ed
1.8.3.1
ffd6ed