From patchwork Mon May 11 07:36:27 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 22855 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n4B7bb80007019 for ; Mon, 11 May 2009 07:37:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753111AbZEKHhd (ORCPT ); Mon, 11 May 2009 03:37:33 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752960AbZEKHhc (ORCPT ); Mon, 11 May 2009 03:37:32 -0400 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 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n4B7aUxL031966; Mon, 11 May 2009 03:36:30 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n4B7aT27017821; Mon, 11 May 2009 03:36:29 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n4B7aSoc008135; Mon, 11 May 2009 03:36:28 -0400 Received: from localhost.localdomain (cleopatra.tlv.redhat.com [10.35.255.11]) by cleopatra.tlv.redhat.com (Postfix) with ESMTP id 99053250ABF; Mon, 11 May 2009 10:36:27 +0300 (IDT) From: Avi Kivity To: Anthony Liguori Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org 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> X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: 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;