History log of /kvmtool/guest/init.c (Results 1 – 16 of 16)
Revision Date Author Comments
# 0964955d 04-Apr-2019 Jean-Philippe Brucker <jean-philippe.brucker@arm.com>

guest: sync disk before shutting down

sync() should be called before reboot(RB_AUTOBOOT), otherwise data written
to disks might be lost.

Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@

guest: sync disk before shutting down

sync() should be called before reboot(RB_AUTOBOOT), otherwise data written
to disks might be lost.

Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>

show more ...


# 2f61a442 17-Jan-2019 Dmitry Monakhov <dmtrmonakhov@yandex-team.ru>

init: fix sysfs mount arguments

It is not good idea to pass empty 'source' argument to mount(2) because
libmount complains about incorrect /proc/self/mountinfo structure. This
affects many applicat

init: fix sysfs mount arguments

It is not good idea to pass empty 'source' argument to mount(2) because
libmount complains about incorrect /proc/self/mountinfo structure. This
affects many applications such as findmnt, umount and etc.

Let's add fake source argument to sysfs mount command as we do with all other
filesystems.

Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Dmitry Monakhov <dmtrmonakhov@yandex-team.ru>
Signed-off-by: Will Deacon <will.deacon@arm.com>

show more ...


# 5614f9d9 19-Oct-2015 Oleg Nesterov <oleg@redhat.com>

kvmtool/x86: implement guest_pre_init

Add the tiny x86/init.S which just mounts /host and execs
/virt/init.

NOTE: of course, the usage of CONFIG_GUEST_PRE_INIT is ugly, we
need to cleanup this code

kvmtool/x86: implement guest_pre_init

Add the tiny x86/init.S which just mounts /host and execs
/virt/init.

NOTE: of course, the usage of CONFIG_GUEST_PRE_INIT is ugly, we
need to cleanup this code. But I'd prefer to do this on top of
this minimal/simple change. And I think this needs cleanups in
any case, for example I think lkvm shouldn't abuse the "init="
kernel parameter at all.

Acked-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>

show more ...


# 372f583d 12-Jun-2015 Andre Przywara <andre.przywara@arm.com>

guest/init: update reboot() call

The reboot() call that guest/init used was an older version, the
manpage talks about libc4 and libc5.
Update it to the current version exported by glibc by using the

guest/init: update reboot() call

The reboot() call that guest/init used was an older version, the
manpage talks about libc4 and libc5.
Update it to the current version exported by glibc by using the right
include file and adjusting the parameter.
This also fixed GCC 5.1.0 compile, because linux/reboot.h misses the
actual prototype.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>

show more ...


# 9ed717c3 12-Jun-2015 Andre Przywara <andre.przywara@arm.com>

guest/init: add missing #includes

GCC 5.1.0 complains about missing prototypes for waitpid() and
mkdir(), so add the appropriate #includes to get rid of the warning.

Signed-off-by: Andre Przywara <

guest/init: add missing #includes

GCC 5.1.0 complains about missing prototypes for waitpid() and
mkdir(), so add the appropriate #includes to get rid of the warning.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>

show more ...


# 1ad95468 29-Nov-2012 Marc Zyngier <marc.zyngier@arm.com>

kvm tools: fix zombie reaping in guest/init.c

init.c is not very kind with processes that get reparented when
their own parent die, leaving them hanging around. Looking at the
code, it only seem to

kvm tools: fix zombie reaping in guest/init.c

init.c is not very kind with processes that get reparented when
their own parent die, leaving them hanging around. Looking at the
code, it only seem to care about its own flesh and blood. Bad init.

Teach it some basic zombie reaping skills.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>

show more ...


# 5fab5964 31-Aug-2012 Sasha Levin <levinsasha928@gmail.com>

kvm tools: add HOME env var to hostfs

Add a HOME env var when booting a hostfs guest. This will point out to a home
dir within the given guest name.

This will make several apps happier when being r

kvm tools: add HOME env var to hostfs

Add a HOME env var when booting a hostfs guest. This will point out to a home
dir within the given guest name.

This will make several apps happier when being run under hostfs.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>

show more ...


# 69071bce 24-Aug-2012 Asias He <asias.hejun@gmail.com>

kvm tools: Mount devpts to /dev/pts

I'm seeing this in guest due to lacking of /dev/pts:

sh-4.2# xterm
xterm: Error 32, errno 28: No space left on device
Reason: get_pty: not enough ptys

kvm tools: Mount devpts to /dev/pts

I'm seeing this in guest due to lacking of /dev/pts:

sh-4.2# xterm
xterm: Error 32, errno 28: No space left on device
Reason: get_pty: not enough ptys

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>

show more ...


# b757c2a6 24-Aug-2012 Asias He <asias.hejun@gmail.com>

kvm tools: Export DISPLAY ENV as our default host ip address

It is useful to run a X program in guest and display it on host.

1) Make host's x server listen to localhost:6000
host_shell$ socat -

kvm tools: Export DISPLAY ENV as our default host ip address

It is useful to run a X program in guest and display it on host.

1) Make host's x server listen to localhost:6000
host_shell$ socat -d -d TCP-LISTEN:6000,fork,bind=localhost \
UNIX-CONNECT:/tmp/.X11-unix/X0

2) Start the guest and run X program
host_shell$ lkvm run -k /boot/bzImage
guest_shell$ xlogo

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>

show more ...


# 91d6a8e3 22-Aug-2012 Asias He <asias.hejun@gmail.com>

kvm tools: Merge guest init and init_stage2.c

Two stages init process is introduced in

commit eaf720b285947a6f4e29174d0eba1899de31d8ab
kvm tools: Split custom rootfs init into two stages

to

kvm tools: Merge guest init and init_stage2.c

Two stages init process is introduced in

commit eaf720b285947a6f4e29174d0eba1899de31d8ab
kvm tools: Split custom rootfs init into two stages

to address the outdated init binary issue.

Currenly, init binary is embedded in lkvm binary and generated on the
fly. So there is no need to split the init process.

This makes
1) the size of lkvm binary smaller becasue only one
statically linked init binary.
2) the init process simpler and cleaner.

Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>

show more ...


# 9cec19c8 05-Dec-2011 Sasha Levin <levinsasha928@gmail.com>

kvm tools: Split custom rootfs init into two stages

Currently custom rootfs init is built along with the main KVM tools executable
and is copied into custom rootfs directories when they are created

kvm tools: Split custom rootfs init into two stages

Currently custom rootfs init is built along with the main KVM tools executable
and is copied into custom rootfs directories when they are created with
'kvm setup'. The problem there is that if the init code changes, they have
to be manually copied to custom rootfs directories.

Instead, this patch splits init process into two parts. One part that simply
handles mounts, and passes it to stage 2 of the init.

Stage 2 really sits along in the code tree, and does all the heavy lifting.

This allows us to make init changes in the code tree and have it automatically
be updated in custom rootfs guests without having to copy files over manua

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
[ penberg@kernel.org: fix 'make check' breakage in Makefile ]
Signed-off-by: Pekka Enberg <penberg@kernel.org>

show more ...


# 18194036 29-Sep-2011 Pekka Enberg <penberg@kernel.org>

kvm tools: NULL-terminate init env

This patch fixes 'kvm run' rootfs boot failures:

Starting '/bin/sh'...
Init failed: Bad address

Signed-off-by: Pekka Enberg <penberg@kernel.org>


# c8de9b2a 27-Sep-2011 Sasha Levin <levinsasha928@gmail.com>

kvm tools: Set active console before running /bin/sh

This patch sets active console to the serial console before running the
shell. Doing so fixes two issues:

* Fix job control.

* Set all env vars

kvm tools: Set active console before running /bin/sh

This patch sets active console to the serial console before running the
shell. Doing so fixes two issues:

* Fix job control.

* Set all env vars.

The user visible issues are less warnings (no more of this:
sh: cannot set terminal process group (-1): Inappropriate ioctl for device
sh: no job control in this shell)

A working 'top', and a working ctrl-c.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>

show more ...


# 575a9e3f 14-Sep-2011 Sasha Levin <levinsasha928@gmail.com>

kvm tools: Use kernel dhcp for network autoconfiguration

This patch removes the manual/usermode dhcp client configuration and instead
uses the DHCP client built within the kernel.

Since this client

kvm tools: Use kernel dhcp for network autoconfiguration

This patch removes the manual/usermode dhcp client configuration and instead
uses the DHCP client built within the kernel.

Since this client is tightly integrated with NFS (if NFS config is set), we
will add a specific NFS root addr in our DHCP offer to point it to a non
existent address so that we won't hang trying to poke it for our root.

Acked-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>

show more ...


# 90ef0dc6 05-Sep-2011 Sasha Levin <levinsasha928@gmail.com>

kvm tools: Add guestfs network autoconfiguration

Add a script to automatically configure networking in the guest.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <p

kvm tools: Add guestfs network autoconfiguration

Add a script to automatically configure networking in the guest.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>

show more ...


# 282113fd 24-Aug-2011 Pekka Enberg <penberg@kernel.org>

kvm tools: Introduce 'kvm setup' command

This patch implements 'kvm setup' command that can be used to setup a guest
filesystem that shares system libraries and binaries from host filesystem in
read

kvm tools: Introduce 'kvm setup' command

This patch implements 'kvm setup' command that can be used to setup a guest
filesystem that shares system libraries and binaries from host filesystem in
read-only mode.

You can setup a new shared rootfs guest with:

./kvm setup -n default

and launch it with:

./kvm run --9p /,hostfs -p "init=virt/init" -d ~/.kvm-tools/default/

We want to teach 'kvm run' to be able to launch guest filesystems by name in
the future. Furthermore, 'kvm run' should setup a 'default' filesystem and use
it by default unless the user specifies otherwise.

Cc: Asias He <asias.hejun@gmail.com>
Cc: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>

show more ...