« Previous | Next » 

Revision 91ca60e0


Added by Michael Tokarev over 11 years ago

give some useful error messages when tap open

In net/tap-linux.c, when manipulation of /dev/net/tun fails, it prints
(with fprintf) something like this:

warning: could not open /dev/net/tun: no virtual network emulation

this has 2 issues:
1) it is not a warning really, it's a fatal error (kvm exits after
2) there's no indication as of what's actually wrong: printing errno there
is helpful.

The patch below removes the "warning" prefix, uses %m (since it's linux,
%m is available as format modifier), and changes fprintf() to %qemu_error().
Now it prints something like this instead:

could not configure /dev/net/tun: Device or resource busy

(there are 2 messages like that in the same function)

This fixes Debian bug #578154, see

Signed-off-by: Michael Tokarev <>
Signed-off-by: Luiz Capitulino <>
Signed-off-by: Anthony Liguori <>


  • added
  • modified
  • copied
  • renamed
  • deleted

View differences