[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 02/13] net: Deprecate the "name" parameter of -net
From: |
Thomas Huth |
Subject: |
[Qemu-devel] [PULL 02/13] net: Deprecate the "name" parameter of -net |
Date: |
Tue, 25 Sep 2018 18:03:36 +0200 |
In early times, network backends were specified by a "vlan" and "name"
tuple. With the introduction of netdevs, the "name" was replaced by an
"id" (which is supposed to be unique), but the "name" parameter stayed
as an alias which could be used instead of "id". Unfortunately, we miss
the duplication check for "name":
$ qemu-system-x86_64 -net user,name=n1 -net user,name=n1
... starts without an error, while "id" correctly complains:
$ qemu-system-x86_64 -net user,id=n1 -net user,id=n1
qemu-system-x86_64: -net user,id=n1: Duplicate ID 'n1' for net
Instead of trying to fix the code for the legacy "name" parameter, let's
rather get rid of this old interface and deprecate the "name" parameter
now - this will also be less confusing for the users in the long run.
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Thomas Huth <address@hidden>
---
net/net.c | 4 ++++
qemu-deprecated.texi | 5 +++++
2 files changed, 9 insertions(+)
diff --git a/net/net.c b/net/net.c
index 2a31339..cdcd5cf 100644
--- a/net/net.c
+++ b/net/net.c
@@ -984,6 +984,10 @@ static int net_client_init1(const void *object, bool
is_netdev, Error **errp)
/* missing optional values have been initialized to "all bits zero" */
name = net->has_id ? net->id : net->name;
+ if (net->has_name) {
+ warn_report("The 'name' parameter is deprecated, use 'id'
instead");
+ }
+
/* Map the old options to the new flat type */
switch (opts->type) {
case NET_LEGACY_OPTIONS_TYPE_NONE:
diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi
index 2283fc5..4ac5c6a 100644
--- a/qemu-deprecated.texi
+++ b/qemu-deprecated.texi
@@ -83,6 +83,11 @@ The 'file' driver for drives is no longer appropriate for
character or host
devices and will only accept regular files (S_IFREG). The correct driver
for these file types is 'host_cdrom' or 'host_device' as appropriate.
address@hidden -net ...,address@hidden (since 3.1)
+
+The @option{name} parameter of the @option{-net} option is a synonym
+for the @option{id} parameter, which should now be used instead.
+
@section QEMU Machine Protocol (QMP) commands
@subsection block-dirty-bitmap-add "autoload" parameter (since 2.12.0)
--
1.8.3.1
- [Qemu-devel] [PULL 00/13] Deprecation, qtests and some trivial doc updates, Thomas Huth, 2018/09/25
- [Qemu-devel] [PULL 01/13] Makefile: Add missing dependency for qemu-deprecated.texi, Thomas Huth, 2018/09/25
- [Qemu-devel] [PULL 04/13] hw/core/machine: Officially deprecate the enforce-config-section parameter, Thomas Huth, 2018/09/25
- [Qemu-devel] [PULL 03/13] net/slirp: Deprecate the [hub_id name] parameter tuple, Thomas Huth, 2018/09/25
- [Qemu-devel] [PULL 05/13] memfd: fix possible usage of the uninitialized file descriptor, Thomas Huth, 2018/09/25
- [Qemu-devel] [PULL 06/13] trivial: Make bios files and source files non-executable, Thomas Huth, 2018/09/25
- [Qemu-devel] [PULL 02/13] net: Deprecate the "name" parameter of -net,
Thomas Huth <=
- [Qemu-devel] [PULL 07/13] docs: Fix some typos (most found by codespell), Thomas Huth, 2018/09/25
- [Qemu-devel] [PULL 08/13] qdev: fix a typo in comment, Thomas Huth, 2018/09/25
- [Qemu-devel] [PULL 09/13] hw/qdev-core: Fix description of instance_init, Thomas Huth, 2018/09/25
- [Qemu-devel] [PULL 12/13] Revert "check: Move endianess test to common", Thomas Huth, 2018/09/25
- [Qemu-devel] [PULL 11/13] Revert "check: Move wdt_ib700 test to common", Thomas Huth, 2018/09/25
- [Qemu-devel] [PULL 10/13] tests/migration: Speed up the test on ppc64, Thomas Huth, 2018/09/25
- [Qemu-devel] [PULL 13/13] Revert "check: Move VMXNET3 test to common", Thomas Huth, 2018/09/25
- Re: [Qemu-devel] [PULL 00/13] Deprecation, qtests and some trivial doc updates, Peter Maydell, 2018/09/27