提交 7f161aae 编写于 作者: M Mark McLoughlin 提交者: Anthony Liguori

net: add QemuOptsList arg to net_client_parse()

Patchworks-ID: 35505
Signed-off-by: NMark McLoughlin <markmc@redhat.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 d80b9fc6
...@@ -3231,11 +3231,12 @@ int net_init_clients(void) ...@@ -3231,11 +3231,12 @@ int net_init_clients(void)
return 0; return 0;
} }
int net_client_parse(const char *optarg) int net_client_parse(QemuOptsList *opts_list, const char *optarg)
{ {
#if defined(CONFIG_SLIRP) #if defined(CONFIG_SLIRP)
/* handle legacy -net channel,port:chr */ /* handle legacy -net channel,port:chr */
if (!strncmp(optarg, "channel,", strlen("channel,"))) { if (!strcmp(opts_list->name, "net") &&
!strncmp(optarg, "channel,", strlen("channel,"))) {
int ret; int ret;
optarg += strlen("channel,"); optarg += strlen("channel,");
...@@ -3256,7 +3257,7 @@ int net_client_parse(const char *optarg) ...@@ -3256,7 +3257,7 @@ int net_client_parse(const char *optarg)
return ret; return ret;
} }
#endif #endif
if (!qemu_opts_parse(&qemu_net_opts, optarg, "type")) { if (!qemu_opts_parse(opts_list, optarg, "type")) {
return -1; return -1;
} }
......
...@@ -136,7 +136,7 @@ extern const char *legacy_bootp_filename; ...@@ -136,7 +136,7 @@ extern const char *legacy_bootp_filename;
int net_client_init(Monitor *mon, QemuOpts *opts); int net_client_init(Monitor *mon, QemuOpts *opts);
void net_client_uninit(NICInfo *nd); void net_client_uninit(NICInfo *nd);
int net_client_parse(const char *str); int net_client_parse(QemuOptsList *opts_list, const char *str);
int net_init_clients(void); int net_init_clients(void);
int net_slirp_smb(const char *exported_dir); int net_slirp_smb(const char *exported_dir);
void net_slirp_hostfwd_add(Monitor *mon, const QDict *qdict); void net_slirp_hostfwd_add(Monitor *mon, const QDict *qdict);
......
...@@ -5088,7 +5088,7 @@ int main(int argc, char **argv, char **envp) ...@@ -5088,7 +5088,7 @@ int main(int argc, char **argv, char **envp)
break; break;
#endif #endif
case QEMU_OPTION_net: case QEMU_OPTION_net:
if (net_client_parse(optarg) == -1) { if (net_client_parse(&qemu_net_opts, optarg) == -1) {
exit(1); exit(1);
} }
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册