]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
kvm tools: don't die if sdl wasn't compiled in and we don't try using it
authorSasha Levin <levinsasha928@gmail.com>
Mon, 17 Sep 2012 11:16:01 +0000 (13:16 +0200)
committerPekka Enberg <penberg@kernel.org>
Tue, 18 Sep 2012 07:56:52 +0000 (10:56 +0300)
If SDL isn't compiled in we shouldn't die unless we actually try using it.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
tools/kvm/include/kvm/sdl.h

index 19e1d743932c8cfab403809bac403d1a76a1a6cb..2f0c213e3dbace58dcf477762ad40653864d1f2d 100644 (file)
@@ -11,11 +11,17 @@ int sdl__exit(struct kvm *kvm);
 #else
 static inline int sdl__init(struct kvm *kvm)
 {
-       die("SDL support not compiled in. (install the SDL-dev[el] package)");
+       if (kvm->cfg.sdl)
+               die("SDL support not compiled in. (install the SDL-dev[el] package)");
+
+       return 0;
 }
 static inline int sdl__exit(struct kvm *kvm)
 {
-       die("SDL support not compiled in. (install the SDL-dev[el] package)");
+       if (kvm->cfg.sdl)
+               die("SDL support not compiled in. (install the SDL-dev[el] package)");
+
+       return 0;
 }
 #endif