convert windows console chardev to QemuOpts.
[qemu] / net.c
diff --git a/net.c b/net.c
index e2513c2..340177e 100644 (file)
--- a/net.c
+++ b/net.c
@@ -31,6 +31,8 @@
 
 /* Needed early for CONFIG_BSD etc. */
 #include "config-host.h"
+/* Needed early to override system queue definitions on BSD */
+#include "sys-queue.h"
 
 #ifndef _WIN32
 #include <sys/times.h>
@@ -897,8 +899,7 @@ static SlirpState *slirp_lookup(Monitor *mon, const char *vlan,
     }
 }
 
-void net_slirp_hostfwd_remove(Monitor *mon, const char *arg1,
-                              const char *arg2, const char *arg3)
+void net_slirp_hostfwd_remove(Monitor *mon, const QDict *qdict)
 {
     struct in_addr host_addr = { .s_addr = INADDR_ANY };
     int host_port;
@@ -907,6 +908,9 @@ void net_slirp_hostfwd_remove(Monitor *mon, const char *arg1,
     SlirpState *s;
     int is_udp = 0;
     int err;
+    const char *arg1 = qdict_get_str(qdict, "arg1");
+    const char *arg2 = qdict_get_try_str(qdict, "arg2");
+    const char *arg3 = qdict_get_try_str(qdict, "arg3");
 
     if (arg2) {
         s = slirp_lookup(mon, arg1, arg2);
@@ -1016,11 +1020,13 @@ static void slirp_hostfwd(SlirpState *s, Monitor *mon, const char *redir_str,
     config_error(mon, "invalid host forwarding rule '%s'\n", redir_str);
 }
 
-void net_slirp_hostfwd_add(Monitor *mon, const char *arg1,
-                           const char *arg2, const char *arg3)
+void net_slirp_hostfwd_add(Monitor *mon, const QDict *qdict)
 {
     const char *redir_str;
     SlirpState *s;
+    const char *arg1 = qdict_get_str(qdict, "arg1");
+    const char *arg2 = qdict_get_try_str(qdict, "arg2");
+    const char *arg3 = qdict_get_try_str(qdict, "arg3");
 
     if (arg2) {
         s = slirp_lookup(mon, arg1, arg2);