aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kqemu.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/kqemu.c b/kqemu.c
index 540aa3cc56..4783aa2a08 100644
--- a/kqemu.c
+++ b/kqemu.c
@@ -166,14 +166,19 @@ int kqemu_init(CPUState *env)
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,
NULL);
+ if (kqemu_fd == KQEMU_INVALID_FD) {
+ fprintf(stderr, "Could not open '%s' - QEMU acceleration layer not activated: %lu\n",
+ KQEMU_DEVICE, GetLastError());
+ return -1;
+ }
#else
kqemu_fd = open(KQEMU_DEVICE, O_RDWR);
-#endif
if (kqemu_fd == KQEMU_INVALID_FD) {
fprintf(stderr, "Could not open '%s' - QEMU acceleration layer not activated: %s\n",
KQEMU_DEVICE, strerror(errno));
return -1;
}
+#endif
version = 0;
#ifdef _WIN32
DeviceIoControl(kqemu_fd, KQEMU_GET_VERSION, NULL, 0,