qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/3] net: Remove "-net channel" and update "-net nic" docs
@ 2017-12-19 15:28 Thomas Huth
  2017-12-19 15:28 ` [Qemu-devel] [PATCH 1/3] net: Remove the legacy "-net channel" parameter Thomas Huth
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Thomas Huth @ 2017-12-19 15:28 UTC (permalink / raw)
  To: qemu-devel, Jason Wang; +Cc: Samuel Thibault, peter.maydell

Remove the deprecated (and even undocumented) "-net channel" parameter,
and update our docs with regards to the possibility to use "netdev=..."
together with the "-net nic" option for embedded NICs.

Thomas Huth (3):
  net: Remove the legacy "-net channel" parameter
  qemu-doc: The "-net nic" option can be used with "netdev=...", too
  qemu-doc: Update the deprecation information of -tftp, -bootp, -redir
    and -smb

 include/net/slirp.h |  2 --
 net/net.c           |  7 -------
 net/slirp.c         | 34 ----------------------------------
 qemu-doc.texi       | 38 +++++++++++++++++++++-----------------
 qemu-options.hx     | 14 ++++++++------
 5 files changed, 29 insertions(+), 66 deletions(-)

-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PATCH 1/3] net: Remove the legacy "-net channel" parameter
  2017-12-19 15:28 [Qemu-devel] [PATCH 0/3] net: Remove "-net channel" and update "-net nic" docs Thomas Huth
@ 2017-12-19 15:28 ` Thomas Huth
  2017-12-19 15:28 ` [Qemu-devel] [PATCH 2/3] qemu-doc: The "-net nic" option can be used with "netdev=...", too Thomas Huth
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Thomas Huth @ 2017-12-19 15:28 UTC (permalink / raw)
  To: qemu-devel, Jason Wang; +Cc: Samuel Thibault, peter.maydell

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.

Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
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 f7317df..09680f9 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] 5+ messages in thread

* [Qemu-devel] [PATCH 2/3] qemu-doc: The "-net nic" option can be used with "netdev=...", too
  2017-12-19 15:28 [Qemu-devel] [PATCH 0/3] net: Remove "-net channel" and update "-net nic" docs Thomas Huth
  2017-12-19 15:28 ` [Qemu-devel] [PATCH 1/3] net: Remove the legacy "-net channel" parameter Thomas Huth
@ 2017-12-19 15:28 ` Thomas Huth
  2017-12-19 15:28 ` [Qemu-devel] [PATCH 3/3] qemu-doc: Update the deprecation information of -tftp, -bootp, -redir and -smb Thomas Huth
  2017-12-22  2:06 ` [Qemu-devel] [PATCH 0/3] net: Remove "-net channel" and update "-net nic" docs Jason Wang
  3 siblings, 0 replies; 5+ messages in thread
From: Thomas Huth @ 2017-12-19 15:28 UTC (permalink / raw)
  To: qemu-devel, Jason Wang; +Cc: Samuel Thibault, peter.maydell

Looks like we missed to document that it is also possible to specify
a netdev with "-net nic" - which is very useful if you want to
configure your on-board NIC to use a backend that has been specified
with "-netdev".

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 qemu-options.hx | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/qemu-options.hx b/qemu-options.hx
index 32d9378..4e235c6 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -2022,9 +2022,10 @@ DEF("netdev", HAS_ARG, QEMU_OPTION_netdev,
     "-netdev hubport,id=str,hubid=n\n"
     "                configure a hub port on QEMU VLAN 'n'\n", QEMU_ARCH_ALL)
 DEF("net", HAS_ARG, QEMU_OPTION_net,
-    "-net nic[,vlan=n][,macaddr=mac][,model=type][,name=str][,addr=str][,vectors=v]\n"
-    "                old way to create a new NIC and connect it to VLAN 'n'\n"
-    "                (use the '-device devtype,netdev=str' option if possible instead)\n"
+    "-net nic[,vlan=n][,netdev=nd][,macaddr=mac][,model=type][,name=str][,addr=str][,vectors=v]\n"
+    "                configure or create an on-board (or machine default) NIC and\n"
+    "                connect it either to VLAN 'n' or the netdev 'nd' (for pluggable\n"
+    "                NICs please use '-device devtype,netdev=nd' instead)\n"
     "-net dump[,vlan=n][,file=f][,len=n]\n"
     "                dump traffic on vlan 'n' to file 'f' (max n bytes per packet)\n"
     "-net none       use it alone to have zero network devices. If no -net option\n"
@@ -2045,10 +2046,11 @@ DEF("net", HAS_ARG, QEMU_OPTION_net,
     "                old way to initialize a host network interface\n"
     "                (use the -netdev option if possible instead)\n", QEMU_ARCH_ALL)
 STEXI
-@item -net nic[,vlan=@var{n}][,macaddr=@var{mac}][,model=@var{type}] [,name=@var{name}][,addr=@var{addr}][,vectors=@var{v}]
+@item -net nic[,vlan=@var{n}][,netdev=@var{nd}][,macaddr=@var{mac}][,model=@var{type}] [,name=@var{name}][,addr=@var{addr}][,vectors=@var{v}]
 @findex -net
-Create a new Network Interface Card and connect it to VLAN @var{n} (@var{n}
-= 0 is the default). The NIC is an e1000 by default on the PC
+Configure or create an on-board (or machine default) Network Interface Card
+(NIC) and connect it either to VLAN @var{n} (@var{n} = 0 is the default), or
+to the netdev @var{nd}. The NIC is an e1000 by default on the PC
 target. Optionally, the MAC address can be changed to @var{mac}, the
 device address set to @var{addr} (PCI cards only),
 and a @var{name} can be assigned for use in monitor commands.
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [Qemu-devel] [PATCH 3/3] qemu-doc: Update the deprecation information of -tftp, -bootp, -redir and -smb
  2017-12-19 15:28 [Qemu-devel] [PATCH 0/3] net: Remove "-net channel" and update "-net nic" docs Thomas Huth
  2017-12-19 15:28 ` [Qemu-devel] [PATCH 1/3] net: Remove the legacy "-net channel" parameter Thomas Huth
  2017-12-19 15:28 ` [Qemu-devel] [PATCH 2/3] qemu-doc: The "-net nic" option can be used with "netdev=...", too Thomas Huth
@ 2017-12-19 15:28 ` Thomas Huth
  2017-12-22  2:06 ` [Qemu-devel] [PATCH 0/3] net: Remove "-net channel" and update "-net nic" docs Jason Wang
  3 siblings, 0 replies; 5+ messages in thread
From: Thomas Huth @ 2017-12-19 15:28 UTC (permalink / raw)
  To: qemu-devel, Jason Wang; +Cc: Samuel Thibault, peter.maydell

The information how to update the deprecated parameters was too scarce,
so that some people did not update to the new syntax yet. Provide some
more information to make sure that it is clear how to update from the
old syntax to the new one.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 qemu-doc.texi | 33 +++++++++++++++++++++------------
 1 file changed, 21 insertions(+), 12 deletions(-)

diff --git a/qemu-doc.texi b/qemu-doc.texi
index 09680f9..9236c0b 100644
--- a/qemu-doc.texi
+++ b/qemu-doc.texi
@@ -2437,27 +2437,36 @@ 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.
+The ``-tftp /some/dir'' argument is replaced by
+``-netdev user,id=x,tftp=/some/dir'', either accompanied with
+``-device ...,netdev=x'' (for pluggable NICs) or ``-net nic,netdev=x''
+(for embedded NICs). 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.
+The ``-bootp /some/file'' argument is replaced by
+``-netdev user,id=x,bootp=/some/file'', either accompanied with
+``-device ...,netdev=x'' (for pluggable NICs) or ``-net nic,netdev=x''
+(for embedded NICs). 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.
+The ``-redir [tcp|udp]:hostport:[guestaddr]:guestport'' argument is
+replaced by ``-netdev
+user,id=x,hostfwd=[tcp|udp]:[hostaddr]:hostport-[guestaddr]:guestport'',
+either accompanied with ``-device ...,netdev=x'' (for pluggable NICs) or
+``-net nic,netdev=x'' (for embedded NICs). 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.
+The ``-smb /some/dir'' argument is replaced by
+``-netdev user,id=x,smb=/some/dir'', either accompanied with
+``-device ...,netdev=x'' (for pluggable NICs) or ``-net nic,netdev=x''
+(for embedded NICs). The new syntax allows different settings to be
+provided per NIC.
 
 @subsection -net vlan (since 2.9.0)
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH 0/3] net: Remove "-net channel" and update "-net nic" docs
  2017-12-19 15:28 [Qemu-devel] [PATCH 0/3] net: Remove "-net channel" and update "-net nic" docs Thomas Huth
                   ` (2 preceding siblings ...)
  2017-12-19 15:28 ` [Qemu-devel] [PATCH 3/3] qemu-doc: Update the deprecation information of -tftp, -bootp, -redir and -smb Thomas Huth
@ 2017-12-22  2:06 ` Jason Wang
  3 siblings, 0 replies; 5+ messages in thread
From: Jason Wang @ 2017-12-22  2:06 UTC (permalink / raw)
  To: Thomas Huth, qemu-devel; +Cc: Samuel Thibault, peter.maydell



On 2017年12月19日 23:28, Thomas Huth wrote:
> Remove the deprecated (and even undocumented) "-net channel" parameter,
> and update our docs with regards to the possibility to use "netdev=..."
> together with the "-net nic" option for embedded NICs.
>
> Thomas Huth (3):
>    net: Remove the legacy "-net channel" parameter
>    qemu-doc: The "-net nic" option can be used with "netdev=...", too
>    qemu-doc: Update the deprecation information of -tftp, -bootp, -redir
>      and -smb
>
>   include/net/slirp.h |  2 --
>   net/net.c           |  7 -------
>   net/slirp.c         | 34 ----------------------------------
>   qemu-doc.texi       | 38 +++++++++++++++++++++-----------------
>   qemu-options.hx     | 14 ++++++++------
>   5 files changed, 29 insertions(+), 66 deletions(-)
>

Applied.

Thanks

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-12-22  2:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-19 15:28 [Qemu-devel] [PATCH 0/3] net: Remove "-net channel" and update "-net nic" docs Thomas Huth
2017-12-19 15:28 ` [Qemu-devel] [PATCH 1/3] net: Remove the legacy "-net channel" parameter Thomas Huth
2017-12-19 15:28 ` [Qemu-devel] [PATCH 2/3] qemu-doc: The "-net nic" option can be used with "netdev=...", too Thomas Huth
2017-12-19 15:28 ` [Qemu-devel] [PATCH 3/3] qemu-doc: Update the deprecation information of -tftp, -bootp, -redir and -smb Thomas Huth
2017-12-22  2:06 ` [Qemu-devel] [PATCH 0/3] net: Remove "-net channel" and update "-net nic" docs Jason Wang

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).