* [Qemu-devel] [PATCH for-2.12 0/2] Remove deprecated net parameters @ 2017-12-07 18:02 Thomas Huth 2017-12-07 18:02 ` [Qemu-devel] [PATCH for-2.12 1/2] net: Remove the legacy "-net channel" parameter Thomas Huth 2017-12-07 18:02 ` [Qemu-devel] [PATCH for-2.12 2/2] net: Remove the deprecated -tftp, -bootp, -redir and -smb options Thomas Huth 0 siblings, 2 replies; 9+ messages in thread From: Thomas Huth @ 2017-12-07 18:02 UTC (permalink / raw) To: qemu-devel, Jason Wang, Samuel Thibault These parameters have been marked as deprecated since QEMU v2.6.0. And since QEMU 2.10, we've documented the policy that deprecated interfaces can be removed after two public releases in case nobody came up with real good reasons to keep them. As far as I know, nobody complained, so it's time to remove these legacy options now. Thomas Huth (2): net: Remove the legacy "-net channel" parameter net: Remove the deprecated -tftp, -bootp, -redir and -smb options include/net/net.h | 3 -- include/net/slirp.h | 6 ---- net/net.c | 7 ---- net/slirp.c | 92 ----------------------------------------------------- os-posix.c | 8 ----- qemu-doc.texi | 29 ----------------- qemu-options.hx | 15 --------- vl.c | 18 ----------- 8 files changed, 178 deletions(-) -- 1.8.3.1 ^ permalink raw reply [flat|nested] 9+ messages in thread
* [Qemu-devel] [PATCH for-2.12 1/2] net: Remove the legacy "-net channel" parameter 2017-12-07 18:02 [Qemu-devel] [PATCH for-2.12 0/2] Remove deprecated net parameters Thomas Huth @ 2017-12-07 18:02 ` Thomas Huth 2017-12-11 21:53 ` Samuel Thibault 2017-12-07 18:02 ` [Qemu-devel] [PATCH for-2.12 2/2] net: Remove the deprecated -tftp, -bootp, -redir and -smb options Thomas Huth 1 sibling, 1 reply; 9+ messages in thread From: Thomas Huth @ 2017-12-07 18:02 UTC (permalink / raw) To: qemu-devel, Jason Wang, Samuel Thibault It has never been documented, so hardly anybody knows about this parameter, and it is marked as deprecated since QEMU v2.6. Time to let it go now. Signed-off-by: Thomas Huth <thuth@redhat.com> --- include/net/slirp.h | 2 -- net/net.c | 7 ------- net/slirp.c | 34 ---------------------------------- qemu-doc.texi | 5 ----- 4 files changed, 48 deletions(-) diff --git a/include/net/slirp.h b/include/net/slirp.h index 64b795c..0c98e46 100644 --- a/include/net/slirp.h +++ b/include/net/slirp.h @@ -36,8 +36,6 @@ void hmp_hostfwd_remove(Monitor *mon, const QDict *qdict); int net_slirp_redir(const char *redir_str); -int net_slirp_parse_legacy(QemuOptsList *opts_list, const char *optarg, int *ret); - int net_slirp_smb(const char *exported_dir); void hmp_info_usernet(Monitor *mon, const QDict *qdict); diff --git a/net/net.c b/net/net.c index 39ef546..7425857 100644 --- a/net/net.c +++ b/net/net.c @@ -1565,13 +1565,6 @@ int net_init_clients(void) int net_client_parse(QemuOptsList *opts_list, const char *optarg) { -#if defined(CONFIG_SLIRP) - int ret; - if (net_slirp_parse_legacy(opts_list, optarg, &ret)) { - return ret; - } -#endif - if (!qemu_opts_parse_noisily(opts_list, optarg, true)) { return -1; } diff --git a/net/slirp.c b/net/slirp.c index 318a26e..cb8ca23 100644 --- a/net/slirp.c +++ b/net/slirp.c @@ -956,37 +956,3 @@ int net_init_slirp(const Netdev *netdev, const char *name, return ret; } - -int net_slirp_parse_legacy(QemuOptsList *opts_list, const char *optarg, int *ret) -{ - if (strcmp(opts_list->name, "net") != 0 || - strncmp(optarg, "channel,", strlen("channel,")) != 0) { - return 0; - } - - error_report("The '-net channel' option is deprecated. " - "Please use '-netdev user,guestfwd=...' instead."); - - /* handle legacy -net channel,port:chr */ - optarg += strlen("channel,"); - - if (QTAILQ_EMPTY(&slirp_stacks)) { - struct slirp_config_str *config; - - config = g_malloc(sizeof(*config)); - pstrcpy(config->str, sizeof(config->str), optarg); - config->flags = SLIRP_CFG_LEGACY; - config->next = slirp_configs; - slirp_configs = config; - *ret = 0; - } else { - Error *err = NULL; - *ret = slirp_guestfwd(QTAILQ_FIRST(&slirp_stacks), optarg, 1, &err); - if (*ret < 0) { - error_report_err(err); - } - } - - return 1; -} - diff --git a/qemu-doc.texi b/qemu-doc.texi index db2351c..982cab5 100644 --- a/qemu-doc.texi +++ b/qemu-doc.texi @@ -2459,11 +2459,6 @@ The ``-smb /some/dir'' argument is now a synonym for setting the ``-netdev user,smb=/some/dir'' argument instead. The new syntax allows different settings to be provided per NIC. -@subsection -net channel (since 2.6.0) - -The ``--net channel,ARGS'' argument is now a synonym for setting -the ``-netdev user,guestfwd=ARGS'' argument instead. - @subsection -net vlan (since 2.9.0) The ``-net vlan=NN'' argument is partially replaced with the -- 1.8.3.1 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PATCH for-2.12 1/2] net: Remove the legacy "-net channel" parameter 2017-12-07 18:02 ` [Qemu-devel] [PATCH for-2.12 1/2] net: Remove the legacy "-net channel" parameter Thomas Huth @ 2017-12-11 21:53 ` Samuel Thibault 0 siblings, 0 replies; 9+ messages in thread From: Samuel Thibault @ 2017-12-11 21:53 UTC (permalink / raw) To: Thomas Huth; +Cc: qemu-devel, Jason Wang Thomas Huth, on jeu. 07 déc. 2017 19:02:34 +0100, wrote: > It has never been documented, so hardly anybody knows about this > parameter, and it is marked as deprecated since QEMU v2.6. > Time to let it go now. > > Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org> > --- > include/net/slirp.h | 2 -- > net/net.c | 7 ------- > net/slirp.c | 34 ---------------------------------- > qemu-doc.texi | 5 ----- > 4 files changed, 48 deletions(-) > > diff --git a/include/net/slirp.h b/include/net/slirp.h > index 64b795c..0c98e46 100644 > --- a/include/net/slirp.h > +++ b/include/net/slirp.h > @@ -36,8 +36,6 @@ void hmp_hostfwd_remove(Monitor *mon, const QDict *qdict); > > int net_slirp_redir(const char *redir_str); > > -int net_slirp_parse_legacy(QemuOptsList *opts_list, const char *optarg, int *ret); > - > int net_slirp_smb(const char *exported_dir); > > void hmp_info_usernet(Monitor *mon, const QDict *qdict); > diff --git a/net/net.c b/net/net.c > index 39ef546..7425857 100644 > --- a/net/net.c > +++ b/net/net.c > @@ -1565,13 +1565,6 @@ int net_init_clients(void) > > int net_client_parse(QemuOptsList *opts_list, const char *optarg) > { > -#if defined(CONFIG_SLIRP) > - int ret; > - if (net_slirp_parse_legacy(opts_list, optarg, &ret)) { > - return ret; > - } > -#endif > - > if (!qemu_opts_parse_noisily(opts_list, optarg, true)) { > return -1; > } > diff --git a/net/slirp.c b/net/slirp.c > index 318a26e..cb8ca23 100644 > --- a/net/slirp.c > +++ b/net/slirp.c > @@ -956,37 +956,3 @@ int net_init_slirp(const Netdev *netdev, const char *name, > > return ret; > } > - > -int net_slirp_parse_legacy(QemuOptsList *opts_list, const char *optarg, int *ret) > -{ > - if (strcmp(opts_list->name, "net") != 0 || > - strncmp(optarg, "channel,", strlen("channel,")) != 0) { > - return 0; > - } > - > - error_report("The '-net channel' option is deprecated. " > - "Please use '-netdev user,guestfwd=...' instead."); > - > - /* handle legacy -net channel,port:chr */ > - optarg += strlen("channel,"); > - > - if (QTAILQ_EMPTY(&slirp_stacks)) { > - struct slirp_config_str *config; > - > - config = g_malloc(sizeof(*config)); > - pstrcpy(config->str, sizeof(config->str), optarg); > - config->flags = SLIRP_CFG_LEGACY; > - config->next = slirp_configs; > - slirp_configs = config; > - *ret = 0; > - } else { > - Error *err = NULL; > - *ret = slirp_guestfwd(QTAILQ_FIRST(&slirp_stacks), optarg, 1, &err); > - if (*ret < 0) { > - error_report_err(err); > - } > - } > - > - return 1; > -} > - > diff --git a/qemu-doc.texi b/qemu-doc.texi > index db2351c..982cab5 100644 > --- a/qemu-doc.texi > +++ b/qemu-doc.texi > @@ -2459,11 +2459,6 @@ The ``-smb /some/dir'' argument is now a synonym for setting > the ``-netdev user,smb=/some/dir'' argument instead. The new > syntax allows different settings to be provided per NIC. > > -@subsection -net channel (since 2.6.0) > - > -The ``--net channel,ARGS'' argument is now a synonym for setting > -the ``-netdev user,guestfwd=ARGS'' argument instead. > - > @subsection -net vlan (since 2.9.0) > > The ``-net vlan=NN'' argument is partially replaced with the > -- > 1.8.3.1 > -- Samuel R: Parce que ça renverse bêtement l'ordre naturel de lecture! Q: Mais pourquoi citer en fin d'article est-il si effroyable? R: Citer en fin d'article Q: Quelle est la chose la plus désagréable sur les groupes de news? ^ permalink raw reply [flat|nested] 9+ messages in thread
* [Qemu-devel] [PATCH for-2.12 2/2] net: Remove the deprecated -tftp, -bootp, -redir and -smb options 2017-12-07 18:02 [Qemu-devel] [PATCH for-2.12 0/2] Remove deprecated net parameters Thomas Huth 2017-12-07 18:02 ` [Qemu-devel] [PATCH for-2.12 1/2] net: Remove the legacy "-net channel" parameter Thomas Huth @ 2017-12-07 18:02 ` Thomas Huth 2017-12-11 21:53 ` Samuel Thibault 2017-12-11 22:04 ` Peter Maydell 1 sibling, 2 replies; 9+ messages in thread From: Thomas Huth @ 2017-12-07 18:02 UTC (permalink / raw) To: qemu-devel, Jason Wang, Samuel Thibault These options likely do not work as expected as soon as the user tries to use more than one network interface at once. The parameters have been marked as deprecated since QEMU v2.6, so users had plenty of time to move their scripts to the new syntax. Time to remove the old parameters now. Signed-off-by: Thomas Huth <thuth@redhat.com> --- include/net/net.h | 3 --- include/net/slirp.h | 4 ---- net/slirp.c | 58 ----------------------------------------------------- os-posix.c | 8 -------- qemu-doc.texi | 24 ---------------------- qemu-options.hx | 15 -------------- vl.c | 18 ----------------- 7 files changed, 130 deletions(-) diff --git a/include/net/net.h b/include/net/net.h index 1c55a93..670e03e 100644 --- a/include/net/net.h +++ b/include/net/net.h @@ -204,9 +204,6 @@ extern NICInfo nd_table[MAX_NICS]; extern const char *host_net_devices[]; /* from net.c */ -extern const char *legacy_tftp_prefix; -extern const char *legacy_bootp_filename; - int net_client_init(QemuOpts *opts, bool is_netdev, Error **errp); int net_client_parse(QemuOptsList *opts_list, const char *str); int net_init_clients(void); diff --git a/include/net/slirp.h b/include/net/slirp.h index 0c98e46..2c37fa0 100644 --- a/include/net/slirp.h +++ b/include/net/slirp.h @@ -34,10 +34,6 @@ void hmp_hostfwd_add(Monitor *mon, const QDict *qdict); void hmp_hostfwd_remove(Monitor *mon, const QDict *qdict); -int net_slirp_redir(const char *redir_str); - -int net_slirp_smb(const char *exported_dir); - void hmp_info_usernet(Monitor *mon, const QDict *qdict); #endif diff --git a/net/slirp.c b/net/slirp.c index cb8ca23..4999a25 100644 --- a/net/slirp.c +++ b/net/slirp.c @@ -85,8 +85,6 @@ typedef struct SlirpState { } SlirpState; static struct slirp_config_str *slirp_configs; -const char *legacy_tftp_prefix; -const char *legacy_bootp_filename; static QTAILQ_HEAD(slirp_stacks, SlirpState) slirp_stacks = QTAILQ_HEAD_INITIALIZER(slirp_stacks); @@ -96,8 +94,6 @@ static int slirp_guestfwd(SlirpState *s, const char *config_str, int legacy_format, Error **errp); #ifndef _WIN32 -static const char *legacy_smb_export; - static int slirp_smb(SlirpState *s, const char *exported_dir, struct in_addr vserver_addr, Error **errp); static void slirp_smb_cleanup(SlirpState *s); @@ -193,13 +189,6 @@ static int net_slirp_init(NetClientState *peer, const char *model, return -1; } - if (!tftp_export) { - tftp_export = legacy_tftp_prefix; - } - if (!bootfile) { - bootfile = legacy_bootp_filename; - } - if (vnetwork) { if (get_str_sep(buf, sizeof(buf), &vnetwork, '/') < 0) { if (!inet_aton(vnetwork, &net)) { @@ -386,9 +375,6 @@ static int net_slirp_init(NetClientState *peer, const char *model, } } #ifndef _WIN32 - if (!smb_export) { - smb_export = legacy_smb_export; - } if (smb_export) { if (slirp_smb(s, smb_export, smbsrv, errp) < 0) { goto error; @@ -586,28 +572,6 @@ void hmp_hostfwd_add(Monitor *mon, const QDict *qdict) } -int net_slirp_redir(const char *redir_str) -{ - struct slirp_config_str *config; - Error *err = NULL; - int res; - - if (QTAILQ_EMPTY(&slirp_stacks)) { - config = g_malloc(sizeof(*config)); - pstrcpy(config->str, sizeof(config->str), redir_str); - config->flags = SLIRP_CFG_HOSTFWD | SLIRP_CFG_LEGACY; - config->next = slirp_configs; - slirp_configs = config; - return 0; - } - - res = slirp_hostfwd(QTAILQ_FIRST(&slirp_stacks), redir_str, 1, &err); - if (res < 0) { - error_report_err(err); - } - return res; -} - #ifndef _WIN32 /* automatic user mode samba server configuration */ @@ -723,28 +687,6 @@ static int slirp_smb(SlirpState* s, const char *exported_dir, return 0; } -/* automatic user mode samba server configuration (legacy interface) */ -int net_slirp_smb(const char *exported_dir) -{ - struct in_addr vserver_addr = { .s_addr = 0 }; - - if (legacy_smb_export) { - fprintf(stderr, "-smb given twice\n"); - return -1; - } - legacy_smb_export = exported_dir; - if (!QTAILQ_EMPTY(&slirp_stacks)) { - Error *err = NULL; - int res = slirp_smb(QTAILQ_FIRST(&slirp_stacks), exported_dir, - vserver_addr, &err); - if (res < 0) { - error_report_err(err); - } - return res; - } - return 0; -} - #endif /* !defined(_WIN32) */ struct GuestFwd { diff --git a/os-posix.c b/os-posix.c index b9c2343..a1fb6b5 100644 --- a/os-posix.c +++ b/os-posix.c @@ -134,14 +134,6 @@ void os_set_proc_name(const char *s) void os_parse_cmd_args(int index, const char *optarg) { switch (index) { -#ifdef CONFIG_SLIRP - case QEMU_OPTION_smb: - error_report("The -smb option is deprecated. " - "Please use '-netdev user,smb=...' instead."); - if (net_slirp_smb(optarg) < 0) - exit(1); - break; -#endif case QEMU_OPTION_runas: user_pwd = getpwnam(optarg); if (!user_pwd) { diff --git a/qemu-doc.texi b/qemu-doc.texi index 982cab5..2068b91 100644 --- a/qemu-doc.texi +++ b/qemu-doc.texi @@ -2435,30 +2435,6 @@ synonym for setting ``-object tls-creds-x509,dir=/path/to/certs,id=tls0,verify-peer=yes'' combined with ``-vnc tls-creds=tls0' -@subsection -tftp (since 2.6.0) - -The ``-tftp /some/dir'' argument is now a synonym for setting -the ``-netdev user,tftp=/some/dir' argument. The new syntax -allows different settings to be provided per NIC. - -@subsection -bootp (since 2.6.0) - -The ``-bootp /some/file'' argument is now a synonym for setting -the ``-netdev user,bootp=/some/file' argument. The new syntax -allows different settings to be provided per NIC. - -@subsection -redir (since 2.6.0) - -The ``-redir ARGS'' argument is now a synonym for setting -the ``-netdev user,hostfwd=ARGS'' argument instead. The new -syntax allows different settings to be provided per NIC. - -@subsection -smb (since 2.6.0) - -The ``-smb /some/dir'' argument is now a synonym for setting -the ``-netdev user,smb=/some/dir'' argument instead. The new -syntax allows different settings to be provided per NIC. - @subsection -net vlan (since 2.9.0) The ``-net vlan=NN'' argument is partially replaced with the diff --git a/qemu-options.hx b/qemu-options.hx index f11c4ac..9189b82 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -1904,16 +1904,6 @@ STEXI @table @option ETEXI -HXCOMM Legacy slirp options (now moved to -net user): -#ifdef CONFIG_SLIRP -DEF("tftp", HAS_ARG, QEMU_OPTION_tftp, "", QEMU_ARCH_ALL) -DEF("bootp", HAS_ARG, QEMU_OPTION_bootp, "", QEMU_ARCH_ALL) -DEF("redir", HAS_ARG, QEMU_OPTION_redir, "", QEMU_ARCH_ALL) -#ifndef _WIN32 -DEF("smb", HAS_ARG, QEMU_OPTION_smb, "", QEMU_ARCH_ALL) -#endif -#endif - DEF("netdev", HAS_ARG, QEMU_OPTION_netdev, #ifdef CONFIG_SLIRP "-netdev user,id=str[,ipv4[=on|off]][,net=addr[/mask]][,host=addr]\n" @@ -2218,11 +2208,6 @@ qemu -net 'user,guestfwd=tcp:10.0.2.100:1234-cmd:netcat 10.10.1.1 4321' @end table -Note: Legacy stand-alone options -tftp, -bootp, -smb and -redir are still -processed and applied to -net user. Mixing them with the new configuration -syntax gives undefined results. Their use for new applications is discouraged -as they will be removed from future versions. - @item -netdev tap,id=@var{id}[,fd=@var{h}][,ifname=@var{name}][,script=@var{file}][,downscript=@var{dfile}][,br=@var{bridge}][,helper=@var{helper}] @itemx -net tap[,vlan=@var{n}][,name=@var{name}][,fd=@var{h}][,ifname=@var{name}][,script=@var{file}][,downscript=@var{dfile}][,br=@var{bridge}][,helper=@var{helper}] Connect the host TAP network interface @var{name} to VLAN @var{n}. diff --git a/vl.c b/vl.c index 1ad1c04..e6a4653 100644 --- a/vl.c +++ b/vl.c @@ -3470,24 +3470,6 @@ int main(int argc, char **argv, char **envp) } break; #endif -#ifdef CONFIG_SLIRP - case QEMU_OPTION_tftp: - error_report("The -tftp option is deprecated. " - "Please use '-netdev user,tftp=...' instead."); - legacy_tftp_prefix = optarg; - break; - case QEMU_OPTION_bootp: - error_report("The -bootp option is deprecated. " - "Please use '-netdev user,bootfile=...' instead."); - legacy_bootp_filename = optarg; - break; - case QEMU_OPTION_redir: - error_report("The -redir option is deprecated. " - "Please use '-netdev user,hostfwd=...' instead."); - if (net_slirp_redir(optarg) < 0) - exit(1); - break; -#endif case QEMU_OPTION_bt: add_device_config(DEV_BT, optarg); break; -- 1.8.3.1 ^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PATCH for-2.12 2/2] net: Remove the deprecated -tftp, -bootp, -redir and -smb options 2017-12-07 18:02 ` [Qemu-devel] [PATCH for-2.12 2/2] net: Remove the deprecated -tftp, -bootp, -redir and -smb options Thomas Huth @ 2017-12-11 21:53 ` Samuel Thibault 2017-12-11 22:04 ` Peter Maydell 1 sibling, 0 replies; 9+ messages in thread From: Samuel Thibault @ 2017-12-11 21:53 UTC (permalink / raw) To: Thomas Huth; +Cc: qemu-devel, Jason Wang Thomas Huth, on jeu. 07 déc. 2017 19:02:35 +0100, wrote: > These options likely do not work as expected as soon as the user > tries to use more than one network interface at once. The parameters > have been marked as deprecated since QEMU v2.6, so users had plenty > of time to move their scripts to the new syntax. Time to remove the > old parameters now. > > Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org> > --- > include/net/net.h | 3 --- > include/net/slirp.h | 4 ---- > net/slirp.c | 58 ----------------------------------------------------- > os-posix.c | 8 -------- > qemu-doc.texi | 24 ---------------------- > qemu-options.hx | 15 -------------- > vl.c | 18 ----------------- > 7 files changed, 130 deletions(-) > > diff --git a/include/net/net.h b/include/net/net.h > index 1c55a93..670e03e 100644 > --- a/include/net/net.h > +++ b/include/net/net.h > @@ -204,9 +204,6 @@ extern NICInfo nd_table[MAX_NICS]; > extern const char *host_net_devices[]; > > /* from net.c */ > -extern const char *legacy_tftp_prefix; > -extern const char *legacy_bootp_filename; > - > int net_client_init(QemuOpts *opts, bool is_netdev, Error **errp); > int net_client_parse(QemuOptsList *opts_list, const char *str); > int net_init_clients(void); > diff --git a/include/net/slirp.h b/include/net/slirp.h > index 0c98e46..2c37fa0 100644 > --- a/include/net/slirp.h > +++ b/include/net/slirp.h > @@ -34,10 +34,6 @@ > void hmp_hostfwd_add(Monitor *mon, const QDict *qdict); > void hmp_hostfwd_remove(Monitor *mon, const QDict *qdict); > > -int net_slirp_redir(const char *redir_str); > - > -int net_slirp_smb(const char *exported_dir); > - > void hmp_info_usernet(Monitor *mon, const QDict *qdict); > > #endif > diff --git a/net/slirp.c b/net/slirp.c > index cb8ca23..4999a25 100644 > --- a/net/slirp.c > +++ b/net/slirp.c > @@ -85,8 +85,6 @@ typedef struct SlirpState { > } SlirpState; > > static struct slirp_config_str *slirp_configs; > -const char *legacy_tftp_prefix; > -const char *legacy_bootp_filename; > static QTAILQ_HEAD(slirp_stacks, SlirpState) slirp_stacks = > QTAILQ_HEAD_INITIALIZER(slirp_stacks); > > @@ -96,8 +94,6 @@ static int slirp_guestfwd(SlirpState *s, const char *config_str, > int legacy_format, Error **errp); > > #ifndef _WIN32 > -static const char *legacy_smb_export; > - > static int slirp_smb(SlirpState *s, const char *exported_dir, > struct in_addr vserver_addr, Error **errp); > static void slirp_smb_cleanup(SlirpState *s); > @@ -193,13 +189,6 @@ static int net_slirp_init(NetClientState *peer, const char *model, > return -1; > } > > - if (!tftp_export) { > - tftp_export = legacy_tftp_prefix; > - } > - if (!bootfile) { > - bootfile = legacy_bootp_filename; > - } > - > if (vnetwork) { > if (get_str_sep(buf, sizeof(buf), &vnetwork, '/') < 0) { > if (!inet_aton(vnetwork, &net)) { > @@ -386,9 +375,6 @@ static int net_slirp_init(NetClientState *peer, const char *model, > } > } > #ifndef _WIN32 > - if (!smb_export) { > - smb_export = legacy_smb_export; > - } > if (smb_export) { > if (slirp_smb(s, smb_export, smbsrv, errp) < 0) { > goto error; > @@ -586,28 +572,6 @@ void hmp_hostfwd_add(Monitor *mon, const QDict *qdict) > > } > > -int net_slirp_redir(const char *redir_str) > -{ > - struct slirp_config_str *config; > - Error *err = NULL; > - int res; > - > - if (QTAILQ_EMPTY(&slirp_stacks)) { > - config = g_malloc(sizeof(*config)); > - pstrcpy(config->str, sizeof(config->str), redir_str); > - config->flags = SLIRP_CFG_HOSTFWD | SLIRP_CFG_LEGACY; > - config->next = slirp_configs; > - slirp_configs = config; > - return 0; > - } > - > - res = slirp_hostfwd(QTAILQ_FIRST(&slirp_stacks), redir_str, 1, &err); > - if (res < 0) { > - error_report_err(err); > - } > - return res; > -} > - > #ifndef _WIN32 > > /* automatic user mode samba server configuration */ > @@ -723,28 +687,6 @@ static int slirp_smb(SlirpState* s, const char *exported_dir, > return 0; > } > > -/* automatic user mode samba server configuration (legacy interface) */ > -int net_slirp_smb(const char *exported_dir) > -{ > - struct in_addr vserver_addr = { .s_addr = 0 }; > - > - if (legacy_smb_export) { > - fprintf(stderr, "-smb given twice\n"); > - return -1; > - } > - legacy_smb_export = exported_dir; > - if (!QTAILQ_EMPTY(&slirp_stacks)) { > - Error *err = NULL; > - int res = slirp_smb(QTAILQ_FIRST(&slirp_stacks), exported_dir, > - vserver_addr, &err); > - if (res < 0) { > - error_report_err(err); > - } > - return res; > - } > - return 0; > -} > - > #endif /* !defined(_WIN32) */ > > struct GuestFwd { > diff --git a/os-posix.c b/os-posix.c > index b9c2343..a1fb6b5 100644 > --- a/os-posix.c > +++ b/os-posix.c > @@ -134,14 +134,6 @@ void os_set_proc_name(const char *s) > void os_parse_cmd_args(int index, const char *optarg) > { > switch (index) { > -#ifdef CONFIG_SLIRP > - case QEMU_OPTION_smb: > - error_report("The -smb option is deprecated. " > - "Please use '-netdev user,smb=...' instead."); > - if (net_slirp_smb(optarg) < 0) > - exit(1); > - break; > -#endif > case QEMU_OPTION_runas: > user_pwd = getpwnam(optarg); > if (!user_pwd) { > diff --git a/qemu-doc.texi b/qemu-doc.texi > index 982cab5..2068b91 100644 > --- a/qemu-doc.texi > +++ b/qemu-doc.texi > @@ -2435,30 +2435,6 @@ synonym for setting > ``-object tls-creds-x509,dir=/path/to/certs,id=tls0,verify-peer=yes'' > combined with ``-vnc tls-creds=tls0' > > -@subsection -tftp (since 2.6.0) > - > -The ``-tftp /some/dir'' argument is now a synonym for setting > -the ``-netdev user,tftp=/some/dir' argument. The new syntax > -allows different settings to be provided per NIC. > - > -@subsection -bootp (since 2.6.0) > - > -The ``-bootp /some/file'' argument is now a synonym for setting > -the ``-netdev user,bootp=/some/file' argument. The new syntax > -allows different settings to be provided per NIC. > - > -@subsection -redir (since 2.6.0) > - > -The ``-redir ARGS'' argument is now a synonym for setting > -the ``-netdev user,hostfwd=ARGS'' argument instead. The new > -syntax allows different settings to be provided per NIC. > - > -@subsection -smb (since 2.6.0) > - > -The ``-smb /some/dir'' argument is now a synonym for setting > -the ``-netdev user,smb=/some/dir'' argument instead. The new > -syntax allows different settings to be provided per NIC. > - > @subsection -net vlan (since 2.9.0) > > The ``-net vlan=NN'' argument is partially replaced with the > diff --git a/qemu-options.hx b/qemu-options.hx > index f11c4ac..9189b82 100644 > --- a/qemu-options.hx > +++ b/qemu-options.hx > @@ -1904,16 +1904,6 @@ STEXI > @table @option > ETEXI > > -HXCOMM Legacy slirp options (now moved to -net user): > -#ifdef CONFIG_SLIRP > -DEF("tftp", HAS_ARG, QEMU_OPTION_tftp, "", QEMU_ARCH_ALL) > -DEF("bootp", HAS_ARG, QEMU_OPTION_bootp, "", QEMU_ARCH_ALL) > -DEF("redir", HAS_ARG, QEMU_OPTION_redir, "", QEMU_ARCH_ALL) > -#ifndef _WIN32 > -DEF("smb", HAS_ARG, QEMU_OPTION_smb, "", QEMU_ARCH_ALL) > -#endif > -#endif > - > DEF("netdev", HAS_ARG, QEMU_OPTION_netdev, > #ifdef CONFIG_SLIRP > "-netdev user,id=str[,ipv4[=on|off]][,net=addr[/mask]][,host=addr]\n" > @@ -2218,11 +2208,6 @@ qemu -net 'user,guestfwd=tcp:10.0.2.100:1234-cmd:netcat 10.10.1.1 4321' > > @end table > > -Note: Legacy stand-alone options -tftp, -bootp, -smb and -redir are still > -processed and applied to -net user. Mixing them with the new configuration > -syntax gives undefined results. Their use for new applications is discouraged > -as they will be removed from future versions. > - > @item -netdev tap,id=@var{id}[,fd=@var{h}][,ifname=@var{name}][,script=@var{file}][,downscript=@var{dfile}][,br=@var{bridge}][,helper=@var{helper}] > @itemx -net tap[,vlan=@var{n}][,name=@var{name}][,fd=@var{h}][,ifname=@var{name}][,script=@var{file}][,downscript=@var{dfile}][,br=@var{bridge}][,helper=@var{helper}] > Connect the host TAP network interface @var{name} to VLAN @var{n}. > diff --git a/vl.c b/vl.c > index 1ad1c04..e6a4653 100644 > --- a/vl.c > +++ b/vl.c > @@ -3470,24 +3470,6 @@ int main(int argc, char **argv, char **envp) > } > break; > #endif > -#ifdef CONFIG_SLIRP > - case QEMU_OPTION_tftp: > - error_report("The -tftp option is deprecated. " > - "Please use '-netdev user,tftp=...' instead."); > - legacy_tftp_prefix = optarg; > - break; > - case QEMU_OPTION_bootp: > - error_report("The -bootp option is deprecated. " > - "Please use '-netdev user,bootfile=...' instead."); > - legacy_bootp_filename = optarg; > - break; > - case QEMU_OPTION_redir: > - error_report("The -redir option is deprecated. " > - "Please use '-netdev user,hostfwd=...' instead."); > - if (net_slirp_redir(optarg) < 0) > - exit(1); > - break; > -#endif > case QEMU_OPTION_bt: > add_device_config(DEV_BT, optarg); > break; > -- > 1.8.3.1 > -- Samuel <N> sl - display animations aimed to correct users who accidentally enter <N> sl instead of ls. ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PATCH for-2.12 2/2] net: Remove the deprecated -tftp, -bootp, -redir and -smb options 2017-12-07 18:02 ` [Qemu-devel] [PATCH for-2.12 2/2] net: Remove the deprecated -tftp, -bootp, -redir and -smb options Thomas Huth 2017-12-11 21:53 ` Samuel Thibault @ 2017-12-11 22:04 ` Peter Maydell 2017-12-14 12:28 ` Thomas Huth 1 sibling, 1 reply; 9+ messages in thread From: Peter Maydell @ 2017-12-11 22:04 UTC (permalink / raw) To: Thomas Huth; +Cc: QEMU Developers, Jason Wang, Samuel Thibault On 7 December 2017 at 18:02, Thomas Huth <thuth@redhat.com> wrote: > These options likely do not work as expected as soon as the user > tries to use more than one network interface at once. The parameters > have been marked as deprecated since QEMU v2.6, so users had plenty > of time to move their scripts to the new syntax. Time to remove the > old parameters now. The deprecation message says: error_report("The -redir option is deprecated. " "Please use '-netdev user,hostfwd=...' instead."); How does this work for systems which have embedded ethernet devices and can't use -netdev ? This is one reason I haven't bothered to update my scripts yet (the other being that the deprecation message is basically saying "go and do a bunch of research into command line syntax" rather than "replace your current option '-redir xyz' with '-netdev user,hostfwd=x,y:z'"...) The message also doesn't point out that if you were previously using -net + -redir you need to switch to -device + -netdev, since -net + -netdev doesn't work AFAIK. Which is more upheaval to a working command line setup. thanks -- PMM ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PATCH for-2.12 2/2] net: Remove the deprecated -tftp, -bootp, -redir and -smb options 2017-12-11 22:04 ` Peter Maydell @ 2017-12-14 12:28 ` Thomas Huth 2017-12-14 13:16 ` Peter Maydell 0 siblings, 1 reply; 9+ messages in thread From: Thomas Huth @ 2017-12-14 12:28 UTC (permalink / raw) To: Peter Maydell Cc: QEMU Developers, Jason Wang, Samuel Thibault, Stefan Hajnoczi Hi Peter, On 11.12.2017 23:04, Peter Maydell wrote: > On 7 December 2017 at 18:02, Thomas Huth <thuth@redhat.com> wrote: >> These options likely do not work as expected as soon as the user >> tries to use more than one network interface at once. The parameters >> have been marked as deprecated since QEMU v2.6, so users had plenty >> of time to move their scripts to the new syntax. Time to remove the >> old parameters now. > > The deprecation message says: > error_report("The -redir option is deprecated. " > "Please use '-netdev user,hostfwd=...' instead."); > > How does this work for systems which have embedded ethernet > devices and can't use -netdev ? Of course it should work the same way as you currently can configure all embedded ethernet devices: -net nic -net user,hostfwd=... By the way, I think our documentation is really lacking some proper description how to deal with on-board devices ... > This is one reason I haven't bothered to update my scripts yet -redir is likely not doing what you expect as soon as you are using two or more (embedded or non-embedded) NICs on a machine, so you really should not use that option anymore. > The message also doesn't point out that if you were previously > using -net + -redir you need to switch to -device + -netdev, > since -net + -netdev doesn't work AFAIK. I haven't tried, but I think you can also use: -netdev user,id=u1,hostfwd=... -net nic,netdev=u1 Or did you run into problems here? Anyway, looks like we really have to improve our documentation about "-net nic" ... yet another item for my TODO list (unless somebody else wants to have a try)... Thomas ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PATCH for-2.12 2/2] net: Remove the deprecated -tftp, -bootp, -redir and -smb options 2017-12-14 12:28 ` Thomas Huth @ 2017-12-14 13:16 ` Peter Maydell 2017-12-14 15:38 ` Thomas Huth 0 siblings, 1 reply; 9+ messages in thread From: Peter Maydell @ 2017-12-14 13:16 UTC (permalink / raw) To: Thomas Huth; +Cc: QEMU Developers, Jason Wang, Samuel Thibault, Stefan Hajnoczi On 14 December 2017 at 12:28, Thomas Huth <thuth@redhat.com> wrote: > On 11.12.2017 23:04, Peter Maydell wrote: >> The deprecation message says: >> error_report("The -redir option is deprecated. " >> "Please use '-netdev user,hostfwd=...' instead."); >> >> How does this work for systems which have embedded ethernet >> devices and can't use -netdev ? > > Of course it should work the same way as you currently can configure all > embedded ethernet devices: > > -net nic -net user,hostfwd=... Mmm, but the deprecation message doesn't say that. > By the way, I think our documentation is really lacking some proper > description how to deal with on-board devices ... > >> This is one reason I haven't bothered to update my scripts yet > > -redir is likely not doing what you expect as soon as you are using two > or more (embedded or non-embedded) NICs on a machine, so you really > should not use that option anymore. Two NICs on a machine is an obscure special case, though. Almost all setups will have just the one NIC. >> The message also doesn't point out that if you were previously >> using -net + -redir you need to switch to -device + -netdev, >> since -net + -netdev doesn't work AFAIK. > > I haven't tried, but I think you can also use: > > -netdev user,id=u1,hostfwd=... -net nic,netdev=u1 > > Or did you run into problems here? Nope. I just ignored the whole thing because the deprecation message didn't give me enough help and didn't actually stop anything working, and I knew that what the message did say was definitely wrong for my command line. I suspect I'm not an entirely atypical user here... I think what we need to do to be able to actually remove this code is: (1) make sure our documentation is clear and simple about how to move from an old command line to a new one (with examples, and covering all the conditions, not just the "let's assume everything's a PC with a pluggable PCI network card" case) (2) make the deprecation warning be specific, and cover all the cases, and probably refer to a documentation URL (3) make -redir in versions where we've removed the functionality print a message that specifically says "this option has been removed and is replaced by $FOO; see $URL for how to update your command line" (ie not just "-redir: unknown option", but retain the deprecation warning text for a bit). (Sorry if this feels like unexpectedly raising the bar for deprecation&removal -- I should probably have raised the issue earlier, but it was only your patch doing the removal that reminded me.) thanks -- PMM ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] [PATCH for-2.12 2/2] net: Remove the deprecated -tftp, -bootp, -redir and -smb options 2017-12-14 13:16 ` Peter Maydell @ 2017-12-14 15:38 ` Thomas Huth 0 siblings, 0 replies; 9+ messages in thread From: Thomas Huth @ 2017-12-14 15:38 UTC (permalink / raw) To: Peter Maydell Cc: QEMU Developers, Jason Wang, Samuel Thibault, Stefan Hajnoczi On 14.12.2017 14:16, Peter Maydell wrote: > On 14 December 2017 at 12:28, Thomas Huth <thuth@redhat.com> wrote: >> On 11.12.2017 23:04, Peter Maydell wrote: >>> The deprecation message says: >>> error_report("The -redir option is deprecated. " >>> "Please use '-netdev user,hostfwd=...' instead."); >>> >>> How does this work for systems which have embedded ethernet >>> devices and can't use -netdev ? >> >> Of course it should work the same way as you currently can configure all >> embedded ethernet devices: >> >> -net nic -net user,hostfwd=... > > Mmm, but the deprecation message doesn't say that. > >> By the way, I think our documentation is really lacking some proper >> description how to deal with on-board devices ... >> >>> This is one reason I haven't bothered to update my scripts yet >> >> -redir is likely not doing what you expect as soon as you are using two >> or more (embedded or non-embedded) NICs on a machine, so you really >> should not use that option anymore. > > Two NICs on a machine is an obscure special case, though. > Almost all setups will have just the one NIC. > >>> The message also doesn't point out that if you were previously >>> using -net + -redir you need to switch to -device + -netdev, >>> since -net + -netdev doesn't work AFAIK. >> >> I haven't tried, but I think you can also use: >> >> -netdev user,id=u1,hostfwd=... -net nic,netdev=u1 >> >> Or did you run into problems here? > > Nope. I just ignored the whole thing because the deprecation > message didn't give me enough help and didn't actually stop > anything working, and I knew that what the message did > say was definitely wrong for my command line. I suspect I'm > not an entirely atypical user here... > > I think what we need to do to be able to actually remove > this code is: > (1) make sure our documentation is clear and simple about > how to move from an old command line to a new one > (with examples, and covering all the conditions, not > just the "let's assume everything's a PC with a > pluggable PCI network card" case) > (2) make the deprecation warning be specific, and > cover all the cases, and probably refer to a documentation > URL > (3) make -redir in versions where we've removed the > functionality print a message that specifically says > "this option has been removed and is replaced by $FOO; > see $URL for how to update your command line" (ie not > just "-redir: unknown option", but retain the deprecation > warning text for a bit). > > (Sorry if this feels like unexpectedly raising the bar > for deprecation&removal -- I should probably have > raised the issue earlier, but it was only your > patch doing the removal that reminded me.) Well, you could have at least complained during the 2.10 development cycle when we put all the deprecation stuff into place... But it's ok, this just showed me that there's at least somebody still around who uses the old parameters, and it also revealed that our documentation about how to configure on-board NICs is really bad. I'll try to come up with some patches that improve the documentation and the deprecation message, and then we can remove these options in QEMU v2.14 instead. The code for these options is rather simple anyway, so it also should not hurt that much to carry it on a little bit longer. @Jason: Could you please ignore this patch here, but queue at least the "-net channel" patch? I'm pretty sure that nobody is using "-net channel" anymore these days, so removing "-net channel" right now should be fine. Thomas ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2017-12-14 15:38 UTC | newest] Thread overview: 9+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2017-12-07 18:02 [Qemu-devel] [PATCH for-2.12 0/2] Remove deprecated net parameters Thomas Huth 2017-12-07 18:02 ` [Qemu-devel] [PATCH for-2.12 1/2] net: Remove the legacy "-net channel" parameter Thomas Huth 2017-12-11 21:53 ` Samuel Thibault 2017-12-07 18:02 ` [Qemu-devel] [PATCH for-2.12 2/2] net: Remove the deprecated -tftp, -bootp, -redir and -smb options Thomas Huth 2017-12-11 21:53 ` Samuel Thibault 2017-12-11 22:04 ` Peter Maydell 2017-12-14 12:28 ` Thomas Huth 2017-12-14 13:16 ` Peter Maydell 2017-12-14 15:38 ` Thomas Huth
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).