summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/net.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/net/net.c b/net/net.c
index 2db160e063..8ddafacf13 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1036,19 +1036,23 @@ static int net_client_init1(const Netdev *netdev, bool is_netdev, Error **errp)
if (is_netdev) {
if (netdev->type == NET_CLIENT_DRIVER_NIC ||
!net_client_init_fun[netdev->type]) {
- error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "type",
- "a netdev backend type");
+ error_setg(errp, "network backend '%s' is not compiled into this binary",
+ NetClientDriver_str(netdev->type));
return -1;
}
} else {
if (netdev->type == NET_CLIENT_DRIVER_NONE) {
return 0; /* nothing to do */
}
- if (netdev->type == NET_CLIENT_DRIVER_HUBPORT ||
- !net_client_init_fun[netdev->type]) {
- error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "type",
- "a net backend type (maybe it is not compiled "
- "into this binary)");
+ if (netdev->type == NET_CLIENT_DRIVER_HUBPORT) {
+ error_setg(errp, "network backend '%s' is only supported with -netdev/-nic",
+ NetClientDriver_str(netdev->type));
+ return -1;
+ }
+
+ if (!net_client_init_fun[netdev->type]) {
+ error_setg(errp, "network backend '%s' is not compiled into this binary",
+ NetClientDriver_str(netdev->type));
return -1;
}