All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kvm tools: Improve init within a custom filesystem
@ 2011-08-24 16:19 Sasha Levin
  2011-08-24 17:30 ` Avi Kivity
  0 siblings, 1 reply; 6+ messages in thread
From: Sasha Levin @ 2011-08-24 16:19 UTC (permalink / raw)
  To: penberg; +Cc: kvm, mingo, asias.hejun, gorcunov, Sasha Levin

This patch adds the following improvements:

 * Automatically start dhcpcd. Since we provide usermode netowrking
we should make it fully transparent to the user.

 * Mount more kernel filesystems such as debugfs and shm.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
---
 tools/kvm/builtin-setup.c |    4 ++++
 tools/kvm/guest/init.c    |    7 +++++++
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/tools/kvm/builtin-setup.c b/tools/kvm/builtin-setup.c
index 3c6ad48..347398d 100644
--- a/tools/kvm/builtin-setup.c
+++ b/tools/kvm/builtin-setup.c
@@ -100,12 +100,16 @@ error_close_in:
 
 static const char *guestfs_dirs[] = {
 	"/dev",
+	"/dev/pts",
+	"/dev/shm",
 	"/etc",
 	"/home",
 	"/host",
 	"/proc",
 	"/root",
 	"/sys",
+	"/sys/kernel",
+	"/sys/kernel/debug",
 	"/var",
 	"/var/lib",
 	"/virt",
diff --git a/tools/kvm/guest/init.c b/tools/kvm/guest/init.c
index 837acfb..caa671d 100644
--- a/tools/kvm/guest/init.c
+++ b/tools/kvm/guest/init.c
@@ -22,6 +22,9 @@ static void do_mounts(void)
 	mount("", "/sys", "sysfs", 0, NULL);
 	mount("proc", "/proc", "proc", 0, NULL);
 	mount("devtmpfs", "/dev", "devtmpfs", 0, NULL);
+	mount("debugfs", "/sys/kernel/debug", "debugfs", 0, NULL);
+	mount("shm", "/dev/shm", "tmpfs", 0, NULL);
+	mount("devpts", "/dev/pts", "devpts", 0, NULL);
 }
 
 int main(int argc, char *argv[])
@@ -30,6 +33,10 @@ int main(int argc, char *argv[])
 
 	do_mounts();
 
+	puts("Running dhcpcd...");
+
+	system("dhcpcd -z eth* -A");
+
 	puts("Starting '/bin/sh'...");
 
 	run_process("/bin/sh");
-- 
1.7.6


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-08-24 18:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-24 16:19 [PATCH] kvm tools: Improve init within a custom filesystem Sasha Levin
2011-08-24 17:30 ` Avi Kivity
2011-08-24 17:41   ` Sasha Levin
2011-08-24 18:17     ` Pekka Enberg
2011-08-24 18:51     ` Avi Kivity
2011-08-24 18:59       ` Pekka Enberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.