From 07eaa970f12ee19d6649cd50d78fcdeed3a7c26b Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Mon, 17 Sep 2012 13:16:01 +0200 Subject: [PATCH] kvm tools: don't die if sdl wasn't compiled in and we don't try using it If SDL isn't compiled in we shouldn't die unless we actually try using it. Signed-off-by: Sasha Levin Signed-off-by: Pekka Enberg --- 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 19e1d743932c..2f0c213e3dba 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 -- 2.39.5