diff options
author | Luiz Capitulino <lcapitulino@redhat.com> | 2009-08-28 15:27:14 -0300 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-09-04 09:37:31 -0500 |
commit | f18c16de4a321f1dda01dc7eae8f0aca86900e32 (patch) | |
tree | 8cc320c4b06a81cfe04b91a4ce5f1eb9c6589adc /net.c | |
parent | d54908a55b9123b11c6d525f022f92bb016a6468 (diff) |
monitor: Port handler_2 to use QDict
This commit ports command handlers that receive two 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.c | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -2822,8 +2822,11 @@ static int net_host_check_device(const char *device) return 0; } -void net_host_device_add(Monitor *mon, const char *device, const char *opts) +void net_host_device_add(Monitor *mon, const QDict *qdict) { + const char *device = qdict_get_str(qdict, "device"); + const char *opts = qdict_get_try_str(qdict, "opts"); + if (!net_host_check_device(device)) { monitor_printf(mon, "invalid host network device %s\n", device); return; @@ -2833,9 +2836,11 @@ void net_host_device_add(Monitor *mon, const char *device, const char *opts) } } -void net_host_device_remove(Monitor *mon, int vlan_id, const char *device) +void net_host_device_remove(Monitor *mon, const QDict *qdict) { VLANClientState *vc; + int vlan_id = qdict_get_int(qdict, "vlan_id"); + const char *device = qdict_get_str(qdict, "device"); vc = qemu_find_vlan_client_by_name(mon, vlan_id, device); if (!vc) { @@ -2900,10 +2905,12 @@ void do_info_network(Monitor *mon) } } -void do_set_link(Monitor *mon, const char *name, const char *up_or_down) +void do_set_link(Monitor *mon, const QDict *qdict) { VLANState *vlan; VLANClientState *vc = NULL; + const char *name = qdict_get_str(qdict, "name"); + const char *up_or_down = qdict_get_str(qdict, "up_or_down"); for (vlan = first_vlan; vlan != NULL; vlan = vlan->next) for (vc = vlan->first_client; vc != NULL; vc = vc->next) |