aboutsummaryrefslogtreecommitdiff
path: root/net.c
diff options
context:
space:
mode:
authorLuiz Capitulino <lcapitulino@redhat.com>2009-08-28 15:27:15 -0300
committerAnthony Liguori <aliguori@us.ibm.com>2009-09-04 09:37:31 -0500
commit1d4daa91ff0b77e86b3944faf8fc7f978cf51c84 (patch)
treeb1331e881597acdb9089ce77e3100a56b4aa4282 /net.c
parentf18c16de4a321f1dda01dc7eae8f0aca86900e32 (diff)
monitor: Port handler_3 to use QDict
This commit ports command handlers that receive three arguments to use the new monitor's dictionary. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'net.c')
-rw-r--r--net.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/net.c b/net.c
index e2513c2223..ea9765a6d5 100644
--- a/net.c
+++ b/net.c
@@ -897,8 +897,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 +906,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 +1018,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);