aboutsummaryrefslogtreecommitdiff
path: root/net/net.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/net.c')
-rw-r--r--net/net.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/net.c b/net/net.c
index 16a87cc1b5..77b35eafc5 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1134,6 +1134,11 @@ void netdev_add(QemuOpts *opts, Error **errp)
void qmp_netdev_add(Netdev *netdev, Error **errp)
{
+ if (!id_wellformed(netdev->id)) {
+ error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "id", "an identifier");
+ return;
+ }
+
net_client_init1(netdev, true, errp);
}