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

Re: [Libguestfs] virt-v2v should add kernel console= to Xen->KVM converted guest's grub.conf



On Thu, Jan 05, 2012 at 07:10:38PM -0500, Chuck Anderson wrote:
> I'd like to propose that the converter add such kernel console=
> arguments if it doesn't find any to replace.

I figured out something that works.  This change will continue to
update any existing console arguments that mention xvc0 or hvc0 and
modify those references to ttyS0.  Additionally, this change will add
a new console=ttyS0,115200 to any kernel lines that don't have any
existing console argument.

--- RedHat.pm.orig	2011-12-08 18:09:16.000000000 -0500
+++ RedHat.pm	2012-01-06 18:38:33.224309303 -0500
@@ -383,6 +383,15 @@
         }
     }
 
+    # Add console to any kernel line that doesn't have one
+    foreach my $augpath
+        ($g->aug_match("/files$grub_conf/title[count(kernel/console) = 0]"))
+    {
+	my $console_augpath = "$augpath/kernel/console";
+	my $console = "ttyS0,115200";
+	$g->aug_set($console_augpath, $console);
+    }
+
     eval {
         $g->aug_save();
     };

Would you consider taking such a patch?

Thanks,
Chuck


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