Skip to contentSkip to conversation

verbose error when /dev/kqemu can't be open

PATCH New Robert Millan 1 participant 1 message Feb 6, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 verbose error when /dev/kqemu can't be open

Please can you apply this tiny patch to make /dev/kqemu open failures more verbose?

It'll help the user distinguish between ENOENT, EPERM and ENXIO, since they are all common causes of open failure.

Signature · 4 lines
Robert Millan

My spam trap is [email protected].  Note: this address is only intended
for spam harvesters.  Writing to it will get you added to my black list.
kqemu.c renamed from kqemu.c~ +1 -1
@@ -174,7 +174,7 @@
     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\n", KQEMU_DEVICE);
+        fprintf(stderr, "Could not open '%s' - QEMU acceleration layer not activated: %s\n", KQEMU_DEVICE, strerror(errno));
         return -1;
     }
     version = 0;