}
static void
-net_init_slirp_configs(const StringList *fwd, int flags)
+net_init_slirp_configs_host(const NetdevUserHostForwardList *fwd)
{
while (fwd) {
struct slirp_config_str *config;
config = g_malloc0(sizeof(*config));
pstrcpy(config->str, sizeof(config->str), fwd->value->str);
- config->flags = flags;
+ config->flags = SLIRP_CFG_HOSTFWD;
config->next = slirp_configs;
slirp_configs = config;
}
}
-static const char **slirp_dnssearch(const StringList *dnsname)
+static void
+net_init_slirp_configs_guest(const NetdevUserGuestForwardList *fwd)
+{
+ while (fwd) {
+ struct slirp_config_str *config;
+
+ config = g_malloc0(sizeof(*config));
+ pstrcpy(config->str, sizeof(config->str), fwd->value->str);
+ config->next = slirp_configs;
+ slirp_configs = config;
+
+ fwd = fwd->next;
+ }
+}
+
+static const char **slirp_dnssearch(const NetdevUserDomainSuffixList *dnsname)
{
- const StringList *c = dnsname;
+ const NetdevUserDomainSuffixList *c = dnsname;
size_t i = 0, num_opts = 0;
const char **ret;
/* all optional fields are initialized to "all bits zero" */
- net_init_slirp_configs(user->hostfwd, SLIRP_CFG_HOSTFWD);
- net_init_slirp_configs(user->guestfwd, 0);
+ net_init_slirp_configs_host(user->hostfwd);
+ net_init_slirp_configs_guest(user->guestfwd);
ret = net_slirp_init(peer, "user", name, user->q_restrict,
ipv4, vnet, user->host,
'*param': ['PasstParameter'] },
'if': 'CONFIG_PASST' }
+##
+# @NetdevUserDomainSuffix:
+#
+# @str: DNS domain name suffix for host name lookup, similar to
+# resolv.conf(5)
+#
+# Since: 1.2
+##
+{ 'struct': 'NetdevUserDomainSuffix',
+ 'data': {
+ 'str': 'str' } }
+
+##
+# @NetdevUserHostForward:
+#
+# @str: Host port forwarding rule
+#
+# TODO: This string gets parsed by slirp_hostfwd(). We fail to
+# document syntax and semantics here. We do in qemu-options.hx.
+# Parsing structured configuration from strings is a no-no for QMP.
+# This should really be a struct. Not sure it's worth the bother
+# now.
+#
+# Since: 1.2
+##
+{ 'struct': 'NetdevUserHostForward',
+ 'data': {
+ 'str': 'str' } }
+
+##
+# @NetdevUserGuestForward:
+#
+# @str: Guest port forwarding rule
+#
+# TODO: This string gets parsed by slirp_guestfwd(). We fail to
+# document syntax and semantics here. We do in qemu-options.hx.
+# Parsing structured configuration from strings is a no-no for QMP.
+# This should really be a struct. Not sure it's worth the bother
+# now.
+#
+# Since: 1.2
+##
+{ 'struct': 'NetdevUserGuestForward',
+ 'data': {
+ 'str': 'str' } }
+
##
# @NetdevUserOptions:
#
'*bootfile': 'str',
'*dhcpstart': 'str',
'*dns': 'str',
- '*dnssearch': ['String'],
+ '*dnssearch': ['NetdevUserDomainSuffix'],
'*domainname': 'str',
'*ipv6-prefix': 'str',
'*ipv6-prefixlen': 'int',
'*ipv6-dns': 'str',
'*smb': 'str',
'*smbserver': 'str',
- '*hostfwd': ['String'],
- '*guestfwd': ['String'],
+ '*hostfwd': ['NetdevUserHostForward'],
+ '*guestfwd': ['NetdevUserGuestForward'],
'*tftp-server-name': 'str' } }
##