From: Avi Kivity Subject: [PATCH] kvm: fix kvm_check_extension() error handling Date: Mon, 11 May 2009 10:36:27 +0300 Message-ID: <1242027387-5504-1-git-send-email-avi@redhat.com> Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org To: Anthony Liguori Return-path: Received: from mx2.redhat.com ([66.187.237.31]:47743 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752867AbZEKHhb (ORCPT ); Mon, 11 May 2009 03:37:31 -0400 Sender: kvm-owner@vger.kernel.org List-ID: 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