summaryrefslogtreecommitdiff
path: root/net.c
diff options
context:
space:
mode:
authorRobert Mustacchi <rm@joyent.com>2011-06-24 13:56:32 -0700
committerRobert Mustacchi <rm@joyent.com>2011-06-24 13:56:32 -0700
commitfa9a236458e9c22e1f64ab7150b1e38cd93330db (patch)
tree2c9ac47f02b5ff1fa30fb6f36b0d953aa038e65e /net.c
parent68396ea9c0fe4f75ce30b1eba2c44c43c13344bb (diff)
downloadillumos-kvm-cmd-fa9a236458e9c22e1f64ab7150b1e38cd93330db.tar.gz
HVM-388 Run native kvm with qemu-v0.14.x
Diffstat (limited to 'net.c')
-rw-r--r--net.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/net.c b/net.c
index 21d4443..73ee212 100644
--- a/net.c
+++ b/net.c
@@ -37,6 +37,10 @@
#include "qemu_socket.h"
#include "hw/qdev.h"
+#ifdef CONFIG_SUNOS_VNIC
+#include "net/vnic.h"
+#endif
+
static QTAILQ_HEAD(, VLANState) vlans;
static QTAILQ_HEAD(, VLANClientState) non_vlan_clients;
@@ -1087,6 +1091,25 @@ static const struct {
{ /* end of list */ }
},
#endif
+#ifdef CONFIG_SUNOS_VNIC
+ }, {
+ .type = "vnic",
+ .init = net_init_vnic,
+ .desc = {
+ NET_COMMON_PARAMS_DESC,
+ {
+ .name = "ifname",
+ .type = QEMU_OPT_STRING,
+ .help = "vnic interface name",
+ },
+ {
+ .name = "macaddr",
+ .type = QEMU_OPT_STRING,
+ .help = "MAC address",
+ },
+ { /* end of list */ }
+ },
+#endif
}, {
.type = "dump",
.init = net_init_dump,
@@ -1127,6 +1150,9 @@ int net_client_init(Monitor *mon, QemuOpts *opts, int is_netdev)
#ifdef CONFIG_VDE
strcmp(type, "vde") != 0 &&
#endif
+#ifdef CONFIG_SUNOS_VNIC
+ strcmp(type, "vnic") != 0 &&
+#endif
strcmp(type, "socket") != 0) {
qerror_report(QERR_INVALID_PARAMETER_VALUE, "type",
"a netdev backend type");
@@ -1196,6 +1222,9 @@ static int net_host_check_device(const char *device)
#ifdef CONFIG_VDE
,"vde"
#endif
+#ifdef CONFIG_SUNOS_VNIC
+ ,"vnic"
+#endif
};
for (i = 0; i < sizeof(valid_param_list) / sizeof(char *); i++) {
if (!strncmp(valid_param_list[i], device,
@@ -1363,6 +1392,7 @@ void net_check_clients(void)
case NET_CLIENT_TYPE_TAP:
case NET_CLIENT_TYPE_SOCKET:
case NET_CLIENT_TYPE_VDE:
+ case NET_CLIENT_TYPE_VNIC:
has_host_dev = 1;
break;
default: ;