Laszlo Ersek 6687b79d63 convert net_client_init() to OptsVisitor
The net_client_init() prototype is kept intact.

Based on "is_netdev", the QemuOpts-rooted QemuOpt-list is parsed as a
Netdev or a NetLegacy. The original meat of net_client_init() is moved to
and simplified in net_client_init1():

Fields not common between -net and -netdev are clearly separated. Getting
the name for the init functions is cleaner: Netdev::id is mandatory, and
all init functions handle a NULL NetLegacy::name. NetLegacy::vlan
explicitly depends on -net (see below).

Verifying the "type=" option for -netdev can be turned into a switch.

Format validation with qemu_opts_validate() can be removed because the
visitor covers it. Relatedly, the "net_client_types" array is reduced to
an array of init functions that can be directly indexed by opts->kind.
(Help text is available in the schema JSON.)

The outermost negation in the condition around qemu_find_vlan() was
flattened, because it expresses the dependent code's requirements more
clearly.

VLAN lookup is avoided if there's no init function to pass the VLAN to.

Whenever the value of type=... is needed, we substitute
NetClientOptionsKind_lookup[kind].

The individual init functions are not converted yet, thus the original
QemuOpts instance is passed transparently.

v1->v2:
- NetLegacy::name is optional. Tracked it through all init functions: they
  all handle a NULL name. Updated commit message accordingly.

v2->v3:
- NetLegacy::id is allowed and takes precedence over NetLegacy::name.

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
2012-07-23 11:55:18 +01:00
2012-07-23 11:55:17 +01:00
2012-06-21 20:04:24 +00:00
2012-06-18 15:32:45 +02:00
2012-07-23 11:55:17 +01:00
2012-06-21 17:59:27 -05:00
2012-07-23 11:55:17 +01:00
2012-07-10 18:27:33 +02:00
2012-07-07 09:04:42 +00:00
2011-11-07 10:57:36 -06:00
2012-04-19 16:51:47 +02:00
2012-06-29 13:31:07 +02:00
2011-12-02 10:50:57 +00:00
2011-08-27 15:42:35 +00:00
2012-07-13 10:38:16 +01:00
2011-09-16 08:26:31 -05:00
2012-01-13 10:37:00 +00:00
2012-05-14 07:27:24 +02:00
2012-02-09 16:17:51 +01:00
2012-03-12 10:30:23 +00:00
2012-06-29 13:31:07 +02:00
2012-04-15 21:25:16 +02:00
2012-03-30 08:14:11 -05:00
2012-05-12 09:14:38 +00:00
2012-01-10 09:36:43 +01:00
2012-03-07 13:03:51 +00:00
2012-06-24 01:04:51 +02:00
2012-06-24 01:04:51 +02:00
2012-04-01 20:30:23 +02:00
2012-03-14 22:20:27 +01:00
2012-06-27 16:33:26 -05:00
2012-03-14 22:20:27 +01:00
2012-07-23 11:55:17 +01:00
2012-07-23 11:55:17 +01:00
2011-12-02 10:50:57 +00:00
2012-03-14 22:20:27 +01:00
2012-07-13 13:46:55 -03:00
2012-07-13 13:46:55 -03:00
2011-12-02 10:50:57 +00:00
2011-08-27 15:42:35 +00:00
2011-08-27 15:42:35 +00:00
2012-05-08 14:30:09 -03:00
2011-10-16 13:13:05 +02:00
2012-03-19 15:17:21 +02:00
2011-12-09 11:25:22 +00:00
2011-12-02 10:50:57 +00:00
2012-05-10 08:33:34 -05:00
2012-06-28 20:28:36 +00:00
2012-03-15 10:39:52 -03:00
2012-06-29 13:27:28 +02:00
2012-06-29 13:27:28 +02:00
2011-08-27 15:42:35 +00:00
2012-02-15 09:39:21 -06:00
2012-07-23 11:55:18 +01:00
2012-02-17 08:33:32 -06:00
2012-02-17 08:33:32 -06:00
2012-04-26 13:14:58 -05:00
2012-07-10 18:27:33 +02:00
2012-01-13 10:55:56 -06:00
2012-03-14 22:20:27 +01:00
2012-01-10 18:23:58 +01:00
2012-04-07 14:00:45 +00:00
2012-01-10 18:23:58 +01:00
2012-07-23 11:55:18 +01:00
2012-02-03 10:41:08 -06:00
2012-07-17 16:48:32 +02:00
2012-07-14 11:53:03 +00:00
2012-07-14 11:53:03 +00:00
2012-04-19 17:19:37 +02:00
2012-04-15 21:25:16 +02:00
2012-04-07 14:00:45 +00:00
2011-12-15 09:20:50 -06:00
2011-12-06 10:07:04 +00:00
2012-06-21 18:45:18 +00:00
2012-05-08 14:30:09 -03:00
2012-04-24 09:50:31 -05:00
2011-12-11 17:50:43 -06:00
2011-10-01 09:31:08 +00:00
2012-03-14 22:20:27 +01:00
2011-08-27 15:42:35 +00:00
2012-06-29 13:18:21 +02:00
2011-10-31 21:52:17 +01:00
2012-06-22 10:34:21 +01:00
2012-06-28 20:28:08 +00:00
2012-06-29 13:18:21 +02:00
2011-08-27 15:42:35 +00:00

Read the documentation in qemu-doc.html or on http://wiki.qemu.org

- QEMU team
Description
No description provided
Readme 569 MiB
Languages
C 83%
C++ 6.3%
Python 3.2%
Dylan 2.9%
Shell 1.6%
Other 2.8%