From patchwork Mon Sep 17 11:16:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 1466601 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id ADF05DF2D8 for ; Mon, 17 Sep 2012 11:15:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755856Ab2IQLPq (ORCPT ); Mon, 17 Sep 2012 07:15:46 -0400 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=+Zmqf1PS/cNrhLatb+Xpm6vazxdO8jMrUy7qugcI8yA=; b=ehwGMB1sWB+866s8dOR03rL1RGu/H/NsUnpL35jesXEbscatPyY9ZMxMznANXHa7ZD e9NBpfPYr/5flj/XzckmAVUfHS4t49F+WqZoEeaOAycQhuVDVOFSNzCpNdBDNglMLSxi h1wfhcySlniXZvTCeKhTKHX3FmL/dr4KPXBXnA+Yur1arBAhPxoKZRIwL/2s99cxbUYv aK3BHTyat2IYT8RaV0IhBK2V2qzA1qDfQ+pcDWy4pHCZ40liZX/TqV9d0vtQWti455h+ He5SPtH0fuswrl3CsBkvizWAAXZU041aZlLDQaq7GLC/2dhcGF5NXfWuXkvEec5+ORJN KqiQ== Received: by 10.216.241.198 with SMTP id g48mr5262417wer.161.1347880544401; Mon, 17 Sep 2012 04:15:44 -0700 (PDT) Received: from localhost.localdomain ([37.46.33.122]) by mx.google.com with ESMTPS id k2sm25217268wiz.7.2012.09.17.04.15.41 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 17 Sep 2012 04:15:42 -0700 (PDT) From: Sasha Levin To: penberg@kernel.org Cc: asias.hejun@gmail.com, mingo@elte.hu, gorcunov@openvz.org, kvm@vger.kernel.org, kashyap.cv@gmail.com, 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> X-Mailer: git-send-email 1.7.12 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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