From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M3Q4x-0007TQ-Df for qemu-devel@nongnu.org; Mon, 11 May 2009 03:37:39 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M3Q4s-0007Pd-LI for qemu-devel@nongnu.org; Mon, 11 May 2009 03:37:38 -0400 Received: from [199.232.76.173] (port=52421 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M3Q4s-0007PP-5h for qemu-devel@nongnu.org; Mon, 11 May 2009 03:37:34 -0400 Received: from mx20.gnu.org ([199.232.41.8]:26937) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M3Q4r-0002LE-N7 for qemu-devel@nongnu.org; Mon, 11 May 2009 03:37:33 -0400 Received: from mx2.redhat.com ([66.187.237.31]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M3Q4q-0002gy-QL for qemu-devel@nongnu.org; Mon, 11 May 2009 03:37:33 -0400 From: Avi Kivity Date: Mon, 11 May 2009 10:36:27 +0300 Message-Id: <1242027387-5504-1-git-send-email-avi@redhat.com> Subject: [Qemu-devel] [PATCH] kvm: fix kvm_check_extension() error handling List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org If the KVM_CHECK_EXTENSION ioctl returns an error, it indicates a serious error, not that the extension is not supported. Fix kvm_check_extension() to report the error in this case. Signed-off-by: Avi Kivity --- kvm-all.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 0ac4b1e..241aaa2 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -326,7 +326,8 @@ int kvm_check_extension(KVMState *s, unsigned int extension) ret = kvm_ioctl(s, KVM_CHECK_EXTENSION, extension); if (ret < 0) { - ret = 0; + fprintf(stderr, "KVM_CHECK_EXTENSION failed: %s\n", strerror(-ret)); + exit(1); } return ret; -- 1.6.0.6