All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Anthony Liguori <anthony@codemonkey.ws>
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	[thread overview]
Message-ID: <1242027387-5504-1-git-send-email-avi@redhat.com> (raw)

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 <avi@redhat.com>
---
 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


WARNING: multiple messages have this Message-ID (diff)
From: Avi Kivity <avi@redhat.com>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org
Subject: [Qemu-devel] [PATCH] kvm: fix kvm_check_extension() error handling
Date: Mon, 11 May 2009 10:36:27 +0300	[thread overview]
Message-ID: <1242027387-5504-1-git-send-email-avi@redhat.com> (raw)

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 <avi@redhat.com>
---
 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

             reply	other threads:[~2009-05-11  7:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-11  7:36 Avi Kivity [this message]
2009-05-11  7:36 ` [Qemu-devel] [PATCH] kvm: fix kvm_check_extension() error handling Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1242027387-5504-1-git-send-email-avi@redhat.com \
    --to=avi@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.