Skip to contentSkip to conversation

print meaningful error message in case of --disable-vhost-net

PATCH In review Michael Tokarev 2 participants 2 messages Jun 9, 2011 – Jun 10, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 print meaningful error message in case of --disable-vhost-net

When qemu gets compiled without support of vhost-net, any attempt to use it fails with a very clear error message:

qemu-system-x86_64: -netdev ...,vhost=on: vhost-net requested but could not be initialized

there's absolutely no reason given _why_ it coult not be initialized, and even strace'ing the process in question does not reveal any errors. So print a message telling what's going on.

---
 hw/vhost_net.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
hw/vhost_net.c +2 -0
index 420e05f..33ba402 100644
@@ -15,6 +15,7 @@
 
 #include "virtio-net.h"
 #include "vhost_net.h"
+#include "qemu-error.h"
 
 #include "config.h"
 
@@ -197,6 +198,7 @@ void vhost_net_cleanup(struct vhost_net *net)
 struct vhost_net *vhost_net_init(VLANClientState *backend, int devfd,
                                  bool force)
 {
+    error_report("vhost-net support is not compiled in");
     return NULL;
 }
 
Signature · 1 line
1.7.2.5
#1 lore raw
Quoted 10 lines · Michael Tokarev

When qemu gets compiled without support of vhost-net, any attempt to use it fails with a very clear error message:

 qemu-system-x86_64: -netdev ...,vhost=on: vhost-net requested but could not be initialized

there's absolutely no reason given _why_ it coult not be initialized, and even strace'ing the process in question does not reveal any errors.  So print a message telling what's going on.

Quoted 4 lines

---
 hw/vhost_net.c |    2 ++

 1 files changed, 2 insertions(+), 0 deletions(-)

This is useful. CCed Michael Tsirkin.

Stefan