diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2010-08-20 13:52:01 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2010-08-22 17:11:06 -0500 |
commit | 3329f07b7a8b919d4a5641611beb0671a2c381a2 (patch) | |
tree | ded5ec633b46ede61c76e65b8e2c28e633388edd /net.c | |
parent | dfe795e71fcbf4f766353f2e76fe227b342fc605 (diff) |
QemuOpts: make most qemu_*_opts static
Switch tree to lookup-by-name using qemu_find_opts().
Also hook up virtfs options so qemu_find_opts works for them too.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'net.c')
-rw-r--r-- | net.c | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -1168,7 +1168,7 @@ void net_host_device_add(Monitor *mon, const QDict *qdict) return; } - opts = qemu_opts_parse(&qemu_net_opts, opts_str ? opts_str : "", 0); + opts = qemu_opts_parse(qemu_find_opts("net"), opts_str ? opts_str : "", 0); if (!opts) { return; } @@ -1202,7 +1202,7 @@ int do_netdev_add(Monitor *mon, const QDict *qdict, QObject **ret_data) QemuOpts *opts; int res; - opts = qemu_opts_from_qdict(&qemu_netdev_opts, qdict); + opts = qemu_opts_from_qdict(qemu_find_opts("netdev"), qdict); if (!opts) { return -1; } @@ -1226,7 +1226,7 @@ int do_netdev_del(Monitor *mon, const QDict *qdict, QObject **ret_data) return -1; } qemu_del_vlan_client(vc); - qemu_opts_del(qemu_opts_find(&qemu_netdev_opts, id)); + qemu_opts_del(qemu_opts_find(qemu_find_opts("netdev"), id)); return 0; } @@ -1349,21 +1349,23 @@ static int net_init_netdev(QemuOpts *opts, void *dummy) int net_init_clients(void) { + QemuOptsList *net = qemu_find_opts("net"); + if (default_net) { /* if no clients, we use a default config */ - qemu_opts_set(&qemu_net_opts, NULL, "type", "nic"); + qemu_opts_set(net, NULL, "type", "nic"); #ifdef CONFIG_SLIRP - qemu_opts_set(&qemu_net_opts, NULL, "type", "user"); + qemu_opts_set(net, NULL, "type", "user"); #endif } QTAILQ_INIT(&vlans); QTAILQ_INIT(&non_vlan_clients); - if (qemu_opts_foreach(&qemu_netdev_opts, net_init_netdev, NULL, 1) == -1) + if (qemu_opts_foreach(qemu_find_opts("netdev"), net_init_netdev, NULL, 1) == -1) return -1; - if (qemu_opts_foreach(&qemu_net_opts, net_init_client, NULL, 1) == -1) { + if (qemu_opts_foreach(net, net_init_client, NULL, 1) == -1) { return -1; } |