aboutsummaryrefslogtreecommitdiff
path: root/net/net.c
diff options
context:
space:
mode:
authorThomas Huth <thuth@redhat.com>2020-05-18 20:01:02 +0200
committerJason Wang <jasowang@redhat.com>2020-06-18 21:05:52 +0800
commit9d903f30cb37eb2f7aec53ab58cd869f48ec16d5 (patch)
treee60c69894827d37ed043d1d04a6126c9a97c55b8 /net/net.c
parentfda43b1204aecd1db158b3255c591d227fbdd629 (diff)
net: Drop the legacy "name" parameter from the -net option
It's been deprecated since QEMU v3.1, so it's time to finally remove it. The "id" parameter can simply be used instead. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'net/net.c')
-rw-r--r--net/net.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/net/net.c b/net/net.c
index 4c62b10acd..e55d3572a4 100644
--- a/net/net.c
+++ b/net/net.c
@@ -969,12 +969,10 @@ static int net_client_init1(const void *object, bool is_netdev, Error **errp)
{
Netdev legacy = {0};
const Netdev *netdev;
- const char *name;
NetClientState *peer = NULL;
if (is_netdev) {
netdev = object;
- name = netdev->id;
if (netdev->type == NET_CLIENT_DRIVER_NIC ||
!net_client_init_fun[netdev->type]) {
@@ -987,12 +985,6 @@ static int net_client_init1(const void *object, bool is_netdev, Error **errp)
const NetLegacyOptions *opts = net->opts;
legacy.id = net->id;
netdev = &legacy;
- /* 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) {
@@ -1052,7 +1044,7 @@ static int net_client_init1(const void *object, bool is_netdev, Error **errp)
}
}
- if (net_client_init_fun[netdev->type](netdev, name, peer, errp) < 0) {
+ if (net_client_init_fun[netdev->type](netdev, netdev->id, peer, errp) < 0) {
/* FIXME drop when all init functions store an Error */
if (errp && !*errp) {
error_setg(errp, QERR_DEVICE_INIT_FAILED,