]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
kvm tools: change the binary name from kvm to lkvm in print message
authorWanlong Gao <wanlong.gao@gmail.com>
Sat, 17 Dec 2011 14:43:08 +0000 (22:43 +0800)
committerPekka Enberg <penberg@kernel.org>
Mon, 19 Dec 2011 17:49:31 +0000 (19:49 +0200)
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>
tools/kvm/builtin-help.c
tools/kvm/builtin-run.c
tools/kvm/builtin-setup.c
tools/kvm/include/kvm/kvm.h

index d02e8394fdaf49474799c63ffb1983d61f6b48a4..5970fb7484f629646bdcef69772dd10c876fd020 100644 (file)
@@ -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);
 }
index 3881a7da2dd36d498b58be461a518d0cc5d98356..fac274c233cca0633f4441b00f65bee7b674d6d0 100644 (file)
@@ -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))
index f90a4d58f0f9e630d192c5737a78931ea0529a20..dd43fed94274be9f1d657341ff44bbb7b42ec383 100644 (file)
@@ -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));
index 8a0c01d2d18ad47cad4d5491e146d69e378cdb73..75adb25e66c2211976f8e24f1f732e0053647591 100644 (file)
@@ -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))