]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
kvm tools: Fix kvm__set_dir() to include trailing slash
authorPekka Enberg <penberg@kernel.org>
Wed, 26 Oct 2011 14:12:51 +0000 (17:12 +0300)
committerPekka Enberg <penberg@kernel.org>
Wed, 26 Oct 2011 14:12:51 +0000 (17:12 +0300)
All of our code expects kvm__get_dir() to return a path with a trailing slash.
This fixes "kvm run" and "kvm setup" making directories such as
"$HOME/.kvmtoolsdefault" for guest rootfs.

Signed-off-by: Pekka Enberg <penberg@kernel.org>
tools/kvm/kvm.c

index c9297577569ef05b10968cdd1f743cb0e59b381f..d953b945e0a2d9b22bbb88d395a5cc14f29a1516 100644 (file)
@@ -94,6 +94,8 @@ static void set_dir(const char *fmt, va_list args)
 
        if (!realpath(tmp, kvm_dir))
                die("Unable to set KVM tool directory");
+
+       strcat(kvm_dir, "/");
 }
 
 void kvm__set_dir(const char *fmt, ...)