If SDL isn't compiled in we shouldn't die unless we actually try using it.

Signed-off-by: Sasha Levin <[email protected]>
---
 tools/kvm/include/kvm/sdl.h | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/tools/kvm/include/kvm/sdl.h b/tools/kvm/include/kvm/sdl.h
index 19e1d74..2f0c213 100644
--- a/tools/kvm/include/kvm/sdl.h
+++ b/tools/kvm/include/kvm/sdl.h
@@ -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
 
-- 
1.7.12

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to