From: Sasha Levin Subject: [PATCH] kvm tools: don't die if sdl wasn't compiled in and we don't try using it Date: Mon, 17 Sep 2012 13:16:01 +0200 Message-ID: <1347880561-1472-1-git-send-email-levinsasha928@gmail.com> Cc: asias.hejun@gmail.com, mingo@elte.hu, gorcunov@openvz.org, kvm@vger.kernel.org, kashyap.cv@gmail.com, Sasha Levin To: penberg@kernel.org Return-path: Received: from mail-we0-f174.google.com ([74.125.82.174]:61838 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755853Ab2IQLPp (ORCPT ); Mon, 17 Sep 2012 07:15:45 -0400 Received: by weyx8 with SMTP id x8so3793713wey.19 for ; Mon, 17 Sep 2012 04:15:44 -0700 (PDT) Sender: kvm-owner@vger.kernel.org List-ID: If SDL isn't compiled in we shouldn't die unless we actually try using it. Signed-off-by: Sasha Levin --- 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