#
72e13944 |
| 07-Jul-2023 |
Alexandru Elisei <alexandru.elisei@arm.com> |
Replace printf/fprintf with pr_* macros
To prepare for allowing finer control over the messages that kvmtool displays, replace printf() and fprintf() with the pr_* macros.
Minor changes were made t
Replace printf/fprintf with pr_* macros
To prepare for allowing finer control over the messages that kvmtool displays, replace printf() and fprintf() with the pr_* macros.
Minor changes were made to fix coding style issues that were pet peeves for the author. And use pr_err() in kvm_cpu__init() instead of pr_warning() for fatal errors.
Also, fix the message when printing the exit code for KVM_EXIT_UNKNOWN by removing the '0x' part, because it's printing a decimal number, not a hexadecimal one (the format specifier is %llu, not %llx).
Signed-off-by: Alexandru Elisei <alexandru.elisei@arm.com> Reviewed-by: Jean-Philippe Brucker <jean-philippe@linaro.org> Reviewed-by: Anup Patel <anup@brainfault.org> Link: https://lore.kernel.org/r/20230707151119.81208-3-alexandru.elisei@arm.com Signed-off-by: Will Deacon <will@kernel.org>
show more ...
|
#
93dd1288 |
| 29-Aug-2017 |
Marc Zyngier <marc.zyngier@arm.com> |
Makefile: avoid using linker for embedding guest_init binaries
At the moment we use the linker to convert the compiled guest_init binary into an ELF object file, so it can be embedded into the kvmto
Makefile: avoid using linker for embedding guest_init binaries
At the moment we use the linker to convert the compiled guest_init binary into an ELF object file, so it can be embedded into the kvmtool binary and accessed later easily at runtime. Now this has two problems: 1) This approach does not work for MIPS, because the linker defaults to a different ABI than the compiler, so the GCC generated object files are not compatible with this converted binary. 2) The size symbol as it's used at the moment in the object file is subject to relocation, which leads to wrong results when using PIE builds, which is now the default for some distributions.
Fix those two problems at once by using some shell tools to create a C source file containing the guest_init binary, which then gets compiled into a proper object file with the normal compiler and its flags. The size of the guest init binaries is now simply a variable, which does not get mangled at all.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Andre Przywara <andre.przywara@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
show more ...
|
#
30867c55 |
| 22-Oct-2015 |
Oleg Nesterov <oleg@redhat.com> |
kvmtool/run: do not overwrite /virt/init
To me kvm_setup_guest_init() behaviour looks "obviously wrong" and unfriendly because it always overwrites /virt/init.
kvm_setup_guest_init() is also called
kvmtool/run: do not overwrite /virt/init
To me kvm_setup_guest_init() behaviour looks "obviously wrong" and unfriendly because it always overwrites /virt/init.
kvm_setup_guest_init() is also called when we are going to use this tree as a rootfs, and without another patch ("kvmtool/run: append cfg.kernel_cmdline at the end of real_cmdline") the user can't use "lkvm run -p init=my_init_path". This simply means that you can not use a customized init unless you patch kvmtool.
Change extract_file() to do nothing if the file already exists. This should not affect do_setup() which calls kvm_setup_guest_init() only if make_dir(guestfs_name) creates the new/empty dir.
Signed-off-by: Oleg Nesterov <oleg@redhat.com> 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 ...
|
#
26e94dc4 |
| 19-Oct-2015 |
Oleg Nesterov <oleg@redhat.com> |
kvmtool/setup: Introduce extract_file() helper
Turn kvm_setup_guest_init(guestfs_name) into a more generic helper, extract_file(guestfs_name, filename, data, size) and reimplement kvm_setup_guest_in
kvmtool/setup: Introduce extract_file() helper
Turn kvm_setup_guest_init(guestfs_name) into a more generic helper, extract_file(guestfs_name, filename, data, size) and reimplement kvm_setup_guest_init() as a trivial wrapper.
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 ...
|
#
cdce942c |
| 11-Sep-2015 |
Dimitri John Ledkov <dimitri.j.ledkov@intel.com> |
Make static libc and guest-init functionality optional.
If one typically only boots full disk-images, one wouldn't necessaraly want to statically link glibc, for the guest-init feature of the kvmtoo
Make static libc and guest-init functionality optional.
If one typically only boots full disk-images, one wouldn't necessaraly want to statically link glibc, for the guest-init feature of the kvmtool. As statically linked glibc triggers haevy security maintainance.
Signed-off-by: Dimitri John Ledkov <dimitri.j.ledkov@intel.com> [will: moved all the guest_init handling into builtin_setup.c] Signed-off-by: Will Deacon <will.deacon@arm.com>
show more ...
|
#
63fd57b9 |
| 16-Jan-2013 |
Cong Ding <dinggnu@gmail.com> |
kvm tools: close opened file
The file should be closed before return.
Signed-off-by: Cong Ding <dinggnu@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
#
d6bee03f |
| 26-Oct-2012 |
Wei Yongjun <yongjun_wei@trendmicro.com.cn> |
kvm tools: remove duplicated include from builtin-setup.c
Remove duplicated include.
dpatch engine is used to auto generate this patch. (https://github.com/weiyj/dpatch)
Signed-off-by: Wei Yongjun
kvm tools: remove duplicated include from builtin-setup.c
Remove duplicated include.
dpatch engine is used to auto generate this patch. (https://github.com/weiyj/dpatch)
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> 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 ...
|
#
f20814b8 |
| 22-Aug-2012 |
Asias He <asias.hejun@gmail.com> |
kvm tools: Make 'lkvm setup' work outside kernel/tools/kvm dir
Generate
~/.lkvm/$guest/virt/etc/passwd ~/.lkvm/$guest/virt/init
on the fly.
Signed-off-by: Asias He <asias.hejun@gmail.com> S
kvm tools: Make 'lkvm setup' work outside kernel/tools/kvm dir
Generate
~/.lkvm/$guest/virt/etc/passwd ~/.lkvm/$guest/virt/init
on the fly.
Signed-off-by: Asias He <asias.hejun@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
d15572a9 |
| 20-Feb-2012 |
Pekka Enberg <penberg@kernel.org> |
kvm tools: Fix "vm setup" help text
Program name and directory name were swapped in the help text.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
|
#
ee8b1456 |
| 17-Dec-2011 |
Wanlong Gao <wanlong.gao@gmail.com> |
kvm tools: change the binary name from kvm to lkvm in print message
Introduce a new macro KVM_BINARY_NAME for the binary name of kvm tools, also for future using in printing command messages like th
kvm tools: change the binary name from kvm to lkvm in print message
Introduce a new macro KVM_BINARY_NAME for the binary name of kvm tools, also for future using in printing command messages like these.
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
8d2ff5da |
| 17-Dec-2011 |
Wanlong Gao <wanlong.gao@gmail.com> |
kvm tools: change the binary name from kvm to lkvm for commands' usage
Commands' usage : Change the binary name from *kvm* to *lkvm*, since commit ad3efb18 has done it.
Signed-off-by: Wanlong Gao <
kvm tools: change the binary name from kvm to lkvm for commands' usage
Commands' usage : Change the binary name from *kvm* to *lkvm*, since commit ad3efb18 has done it.
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
f5e319c8 |
| 16-Dec-2011 |
Lai Jiangshan <laijs@cn.fujitsu.com> |
kvm-tools: remove make_root_dir()
The root dir was already created by kvm__set_dir() which is in main().
Acked-by: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Lai Jiangshan <laijs@cn.fujit
kvm-tools: remove make_root_dir()
The root dir was already created by kvm__set_dir() which is in main().
Acked-by: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
d6080290 |
| 06-Dec-2011 |
Sasha Levin <levinsasha928@gmail.com> |
kvm tools: Link ld.so.conf to the file on the host
This enables the custom rootfs to run executables which have dylibs located in non standard paths by taking these settings from the host.
Signed-o
kvm tools: Link ld.so.conf to the file on the host
This enables the custom rootfs to run executables which have dylibs located in non standard paths by taking these settings from the host.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
ce6927e8 |
| 07-Nov-2011 |
Sasha Levin <levinsasha928@gmail.com> |
kvm tools: Create /etc/passwd in shared rootfs
This patch creates a dummy /etc/passwd on guest creation.
This is done because some applications (read: git) get angry when they can't find current us
kvm tools: Create /etc/passwd in shared rootfs
This patch creates a dummy /etc/passwd on guest creation.
This is done because some applications (read: git) get angry when they can't find current user in /etc/passwd.
Reported-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
f9ea40ea |
| 25-Oct-2011 |
Pekka Enberg <penberg@kernel.org> |
kvm tools: Improve "kvm setup" info and error messages
This patch improves the output of 'kvm setup' as follows:
[penberg@tux kvm]$ ./kvm setup
kvm setup creates a new rootfs under /home/penbe
kvm tools: Improve "kvm setup" info and error messages
This patch improves the output of 'kvm setup' as follows:
[penberg@tux kvm]$ ./kvm setup
kvm setup creates a new rootfs under /home/penberg//.kvm-tools/. This can be used later by the '-d' parameter of 'kvm run'.
usage: kvm setup [name]
[penberg@tux kvm]$ ./kvm setup test-box A new rootfs 'test-box' has been created in '/home/penberg//.kvm-tools/test-box'.
You can now start it by running the following command:
kvm run -d test-box
[penberg@tux kvm]$ ./kvm setup test-box Unable to create rootfs in /home/penberg//.kvm-tools/test-box: File exists
Acked-by: Cyrill Gorcunov <gorcunov@gmail.com> Acked-by: Sasha Levin <levinsasha928@gmail.com> Cc: Asias He <asias.hejun@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
9667701c |
| 16-Oct-2011 |
Pekka Enberg <penberg@kernel.org> |
kvm tools: Use kvm__get_dir() helper function
This patch adds a kvm__get_dir() helper function that replaces open-coded uses of HOME_DIR and KVM_PID_FILE_PATH.
Cc: Asias He <asias.hejun@gmail.com>
kvm tools: Use kvm__get_dir() helper function
This patch adds a kvm__get_dir() helper function that replaces open-coded uses of HOME_DIR and KVM_PID_FILE_PATH.
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 ...
|
#
127b84f7 |
| 16-Oct-2011 |
Pekka Enberg <penberg@kernel.org> |
kvm tools: Use HOME_DIR and KVM_PID_FILE_PATH from <kvm/kvm.h>
This patch removes duplicate defines from builtin-setup.c.
Cc: Asias He <asias.hejun@gmail.com> Cc: Cyrill Gorcunov <gorcunov@gmail.co
kvm tools: Use HOME_DIR and KVM_PID_FILE_PATH from <kvm/kvm.h>
This patch removes duplicate defines from builtin-setup.c.
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 ...
|
#
7b6d50d6 |
| 13-Oct-2011 |
Sasha Levin <levinsasha928@gmail.com> |
kvm tools: Modify 'kvm setup' parameters
This patch makes the name as the default parameter, this makes usability easier since this is the only parameter available at the moment anyway.
Suggested-b
kvm tools: Modify 'kvm setup' parameters
This patch makes the name as the default parameter, this makes usability easier since this is the only parameter available at the moment anyway.
Suggested-by: Ingo Molnar <mingo@elte.hu> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
f9613d9f |
| 13-Oct-2011 |
Sasha Levin <levinsasha928@gmail.com> |
kvm tools: Add help and info messages to 'kvm setup'
Suggested-by: Ingo Molnar <mingo@elte.hu> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Sasha Levin <levinsasha928@gmail.com> Signed-off-b
kvm tools: Add help and info messages to 'kvm setup'
Suggested-by: Ingo Molnar <mingo@elte.hu> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Sasha Levin <levinsasha928@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
show more ...
|
#
69c88b95 |
| 14-Sep-2011 |
Sasha Levin <levinsasha928@gmail.com> |
kvm tools: Use host's resolv.conf within the guest
Since kernel IP autoconfiguration doesn't set up /etc/resolv.conf, we'll use the one located within the host, since this was anyway what we simulat
kvm tools: Use host's resolv.conf within the guest
Since kernel IP autoconfiguration doesn't set up /etc/resolv.conf, we'll use the one located within the host, since this was anyway what we simulated within the DHCP offer packets.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
show more ...
|
#
4f62ec93 |
| 14-Sep-2011 |
Sasha Levin <levinsasha928@gmail.com> |
kvm tools: Don't copy network autoconfiguration script
Network autoconfiguration was moved to the kernel, but the setup code still tried to copy the script over to the rootfs. This prevented from /v
kvm tools: Don't copy network autoconfiguration script
Network autoconfiguration was moved to the kernel, but the setup code still tried to copy the script over to the rootfs. This prevented from /virt/ to be properly created.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
show more ...
|
#
c8675741 |
| 12-Sep-2011 |
Sasha Levin <levinsasha928@gmail.com> |
kvm tools: Modify 'kvm run' to use virt fs
'kvm run' will now create a 'default' profile and boot into it.
Currently we boot into rw rootfs of the host, which is risky. Instead, we can boot in a 's
kvm tools: Modify 'kvm run' to use virt fs
'kvm run' will now create a 'default' profile and boot into it.
Currently we boot into rw rootfs of the host, which is risky. Instead, we can boot in a 'safe' enviroment with networking.
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 ...
|