mirror of
https://github.com/clearlinux/kvmtool.git
synced 2026-06-15 18:05:49 +00:00
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>
This commit is contained in:
+4
-3
@@ -7,6 +7,7 @@
|
||||
#include <kvm/util.h>
|
||||
#include <kvm/kvm-cmd.h>
|
||||
#include <kvm/builtin-help.h>
|
||||
#include <kvm/kvm.h>
|
||||
|
||||
|
||||
const char kvm_usage_string[] =
|
||||
@@ -25,7 +26,7 @@ static void list_common_cmds_help(void)
|
||||
longest = strlen(common_cmds[i].name);
|
||||
}
|
||||
|
||||
puts(" The most commonly used kvm commands are:");
|
||||
puts(" The most commonly used lkvm commands are:");
|
||||
for (i = 0; i < ARRAY_SIZE(common_cmds); i++) {
|
||||
printf(" %-*s ", longest, common_cmds[i].name);
|
||||
puts(common_cmds[i].help);
|
||||
@@ -34,8 +35,8 @@ static void list_common_cmds_help(void)
|
||||
|
||||
static void kvm_help(void)
|
||||
{
|
||||
printf("\n To start a simple non-privileged shell run 'kvm run'\n\n"
|
||||
"usage: %s\n\n", kvm_usage_string);
|
||||
printf("\n To start a simple non-privileged shell run '%s run'\n\n"
|
||||
"usage: %s\n\n", KVM_BINARY_NAME, kvm_usage_string);
|
||||
list_common_cmds_help();
|
||||
printf("\n %s\n\n", kvm_more_info_string);
|
||||
}
|
||||
|
||||
+4
-2
@@ -641,7 +641,8 @@ static void kernel_usage_with_options(void)
|
||||
fprintf(stderr, "\t%s\n", kernel);
|
||||
k++;
|
||||
}
|
||||
fprintf(stderr, "\nPlease see 'kvm run --help' for more options.\n\n");
|
||||
fprintf(stderr, "\nPlease see '%s run --help' for more options.\n\n",
|
||||
KVM_BINARY_NAME);
|
||||
}
|
||||
|
||||
static u64 host_ram_size(void)
|
||||
@@ -1043,7 +1044,8 @@ int kvm_cmd_run(int argc, const char **argv, const char *prefix)
|
||||
virtio_blk__init_all(kvm);
|
||||
}
|
||||
|
||||
printf(" # kvm run -k %s -m %Lu -c %d --name %s\n", kernel_filename, ram_size / 1024 / 1024, nrcpus, guest_name);
|
||||
printf(" # %s run -k %s -m %Lu -c %d --name %s\n", KVM_BINARY_NAME,
|
||||
kernel_filename, ram_size / 1024 / 1024, nrcpus, guest_name);
|
||||
|
||||
if (!kvm__load_kernel(kvm, kernel_filename, initrd_filename,
|
||||
real_cmdline, vidmode))
|
||||
|
||||
+6
-5
@@ -46,9 +46,9 @@ static void parse_setup_options(int argc, const char **argv)
|
||||
|
||||
void kvm_setup_help(void)
|
||||
{
|
||||
printf("\nkvm setup creates a new rootfs under %s.\n"
|
||||
"This can be used later by the '-d' parameter of 'kvm run'.\n",
|
||||
kvm__get_dir());
|
||||
printf("\n%s setup creates a new rootfs under %s.\n"
|
||||
"This can be used later by the '-d' parameter of '%s run'.\n",
|
||||
kvm__get_dir(), KVM_BINARY_NAME, KVM_BINARY_NAME);
|
||||
usage_with_options(setup_usage, setup_options);
|
||||
}
|
||||
|
||||
@@ -221,8 +221,9 @@ int kvm_cmd_setup(int argc, const char **argv, const char *prefix)
|
||||
if (r == 0)
|
||||
printf("A new rootfs '%s' has been created in '%s%s'.\n\n"
|
||||
"You can now start it by running the following command:\n\n"
|
||||
" kvm run -d %s\n",
|
||||
instance_name, kvm__get_dir(), instance_name, instance_name);
|
||||
" %s run -d %s\n",
|
||||
instance_name, kvm__get_dir(), instance_name,
|
||||
KVM_BINARY_NAME,instance_name);
|
||||
else
|
||||
printf("Unable to create rootfs in %s%s: %s\n",
|
||||
kvm__get_dir(), instance_name, strerror(errno));
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
#define KVM_PID_FILE_PATH "/.kvm-tools/"
|
||||
#define HOME_DIR getenv("HOME")
|
||||
#define KVM_BINARY_NAME "lkvm"
|
||||
|
||||
#define PAGE_SIZE (sysconf(_SC_PAGE_SIZE))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user