* [Qemu-devel] [PATCH] kvm: fix kvm_check_extension() error handling
@ 2009-05-11 7:36 Avi Kivity
0 siblings, 0 replies; only message in thread
From: Avi Kivity @ 2009-05-11 7:36 UTC (permalink / raw)
To: Anthony Liguori; +Cc: qemu-devel, kvm
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-05-11 7:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-11 7:36 [Qemu-devel] [PATCH] kvm: fix kvm_check_extension() error handling Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).