]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
kvm tools: use custom rootfs_name for guest name
authorLai Jiangshan <laijs@cn.fujitsu.com>
Tue, 27 Dec 2011 07:36:35 +0000 (15:36 +0800)
committerPekka Enberg <penberg@kernel.org>
Tue, 3 Jan 2012 17:07:01 +0000 (19:07 +0200)
It is better than a anonymous "guest-xxx".

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
tools/kvm/builtin-run.c

index 4691e1b9648ca699a393c42abdfba846b76fe3a9..6bd9638e16f7a2d2575b5de8021c8021a84ed56c 100644 (file)
@@ -981,8 +981,12 @@ int kvm_cmd_run(int argc, const char **argv, const char *prefix)
        term_init();
 
        if (!guest_name) {
-               sprintf(default_name, "guest-%u", getpid());
-               guest_name = default_name;
+               if (custom_rootfs) {
+                       guest_name = custom_rootfs_name;
+               } else {
+                       sprintf(default_name, "guest-%u", getpid());
+                       guest_name = default_name;
+               }
        }
 
        kvm = kvm__init(dev, hugetlbfs_path, ram_size, guest_name);