summaryrefslogtreecommitdiff
path: root/net.c
diff options
context:
space:
mode:
Diffstat (limited to 'net.c')
-rw-r--r--net.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/net.c b/net.c
index 355eb874a6..7195827cc4 100644
--- a/net.c
+++ b/net.c
@@ -293,6 +293,27 @@ VLANClientState *qemu_new_net_client(NetClientInfo *info,
return vc;
}
+NICState *qemu_new_nic(NetClientInfo *info,
+ NICConf *conf,
+ const char *model,
+ const char *name,
+ void *opaque)
+{
+ VLANClientState *nc;
+ NICState *nic;
+
+ assert(info->type == NET_CLIENT_TYPE_NIC);
+ assert(info->size >= sizeof(NICState));
+
+ nc = qemu_new_net_client(info, conf->vlan, conf->peer, model, name);
+
+ nic = DO_UPCAST(NICState, nc, nc);
+ nic->conf = conf;
+ nic->opaque = opaque;
+
+ return nic;
+}
+
VLANClientState *qemu_new_vlan_client(net_client_type type,
VLANState *vlan,
VLANClientState *peer,