Merge pull request #57 from soleen/pasha-cleanup

remove duplicated check from virtme-prep-kdir-mods
diff --git a/virtme-configkernel b/virtme-configkernel
index cdeb06b..7e84d4b 100755
--- a/virtme-configkernel
+++ b/virtme-configkernel
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/env python3
 # -*- mode: python -*-
 # virtme-configkernel: Configure a kernel for virtme
 # Copyright © 2014 Andy Lutomirski
diff --git a/virtme-mkinitramfs b/virtme-mkinitramfs
index ed62d14..3e06732 100755
--- a/virtme-mkinitramfs
+++ b/virtme-mkinitramfs
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/env python3
 # -*- mode: python -*-
 # virtme-mkinitramfs: Generate an initramfs image for virtme
 # Copyright © 2019 Marcos Paulo de Souza
diff --git a/virtme-run b/virtme-run
index d472f81..ac6231a 100755
--- a/virtme-run
+++ b/virtme-run
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/env python3
 # -*- mode: python -*-
 # virtme-run: The main command-line virtme frontend
 # Copyright © 2014 Andy Lutomirski
diff --git a/virtme/commands/configkernel.py b/virtme/commands/configkernel.py
index 8199294..043e720 100644
--- a/virtme/commands/configkernel.py
+++ b/virtme/commands/configkernel.py
@@ -72,6 +72,7 @@
     'CONFIG_VT=y',
     'CONFIG_UNIX98_PTYS=y',
     'CONFIG_EARLY_PRINTK=y',
+    'CONFIG_INOTIFY_USER=y',
     '',
     '# virtio-scsi support',
     'CONFIG_BLOCK=y',
diff --git a/virtme/commands/run.py b/virtme/commands/run.py
index 722d18a..5d9b96b 100644
--- a/virtme/commands/run.py
+++ b/virtme/commands/run.py
@@ -279,6 +279,7 @@
 
     qemuargs: List[str] = [qemu.qemubin]
     kernelargs = []
+    xenargs = []
 
     # Put the '-name' flag first so it's easily visible in ps, top, etc.
     if args.name:
@@ -362,9 +363,15 @@
         qemuargs.extend(['-mon', 'chardev=console'])
 
         kernelargs.extend(arch.earlyconsole_args())
-        kernelargs.extend(arch.serial_console_args())
         qemuargs.extend(arch.qemu_nodisplay_args())
 
+        if not args.xen:
+            kernelargs.extend(arch.serial_console_args())
+        else:
+            # Horrible special case
+            xenargs.extend(['console=com1'])
+            kernelargs.extend(['xencons=hvc', 'console=hvc0'])
+
         # PS/2 probing is slow; give the kernel a hint to speed it up.
         kernelargs.extend(['psmouse.proto=exps'])
 
@@ -574,9 +581,15 @@
             qemuargs.extend(['-initrd', initrdpath])
         if kernel.dtb is not None:
             qemuargs.extend(['-dtb', kernel.dtb])
+
+        if xenargs:
+            raise ValueError("Can't pass Xen any arguments if we're not using Xen")
     else:
         # Use multiboot syntax to load Xen
         qemuargs.extend(['-kernel', args.xen])
+        if xenargs:
+            qemuargs.extend(['-append',
+                             ' '.join(quote_karg(a) for a in xenargs)])
         qemuargs.extend(['-initrd', '%s %s%s' % (
             kernel.kimg,
             ' '.join(quote_karg(a).replace(',', ',,') for a in kernelargs),