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>
This commit is contained in:
parent
fda43b1204
commit
9d903f30cb
|
@ -47,12 +47,6 @@ 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
|
devices and will only accept regular files (S_IFREG). The correct driver
|
||||||
for these file types is 'host_cdrom' or 'host_device' as appropriate.
|
for these file types is 'host_cdrom' or 'host_device' as appropriate.
|
||||||
|
|
||||||
``-net ...,name=``\ *name* (since 3.1)
|
|
||||||
''''''''''''''''''''''''''''''''''''''
|
|
||||||
|
|
||||||
The ``name`` parameter of the ``-net`` option is a synonym
|
|
||||||
for the ``id`` parameter, which should now be used instead.
|
|
||||||
|
|
||||||
``-smp`` (invalid topologies) (since 3.1)
|
``-smp`` (invalid topologies) (since 3.1)
|
||||||
'''''''''''''''''''''''''''''''''''''''''
|
'''''''''''''''''''''''''''''''''''''''''
|
||||||
|
|
||||||
|
@ -441,6 +435,15 @@ What follows is a record of recently removed, formerly deprecated
|
||||||
features that serves as a record for users who have encountered
|
features that serves as a record for users who have encountered
|
||||||
trouble after a recent upgrade.
|
trouble after a recent upgrade.
|
||||||
|
|
||||||
|
System emulator command line arguments
|
||||||
|
--------------------------------------
|
||||||
|
|
||||||
|
``-net ...,name=``\ *name* (removed in 5.1)
|
||||||
|
'''''''''''''''''''''''''''''''''''''''''''
|
||||||
|
|
||||||
|
The ``name`` parameter of the ``-net`` option was a synonym
|
||||||
|
for the ``id`` parameter, which should now be used instead.
|
||||||
|
|
||||||
QEMU Machine Protocol (QMP) commands
|
QEMU Machine Protocol (QMP) commands
|
||||||
------------------------------------
|
------------------------------------
|
||||||
|
|
||||||
|
|
10
net/net.c
10
net/net.c
|
@ -969,12 +969,10 @@ static int net_client_init1(const void *object, bool is_netdev, Error **errp)
|
||||||
{
|
{
|
||||||
Netdev legacy = {0};
|
Netdev legacy = {0};
|
||||||
const Netdev *netdev;
|
const Netdev *netdev;
|
||||||
const char *name;
|
|
||||||
NetClientState *peer = NULL;
|
NetClientState *peer = NULL;
|
||||||
|
|
||||||
if (is_netdev) {
|
if (is_netdev) {
|
||||||
netdev = object;
|
netdev = object;
|
||||||
name = netdev->id;
|
|
||||||
|
|
||||||
if (netdev->type == NET_CLIENT_DRIVER_NIC ||
|
if (netdev->type == NET_CLIENT_DRIVER_NIC ||
|
||||||
!net_client_init_fun[netdev->type]) {
|
!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;
|
const NetLegacyOptions *opts = net->opts;
|
||||||
legacy.id = net->id;
|
legacy.id = net->id;
|
||||||
netdev = &legacy;
|
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 */
|
/* Map the old options to the new flat type */
|
||||||
switch (opts->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 */
|
/* FIXME drop when all init functions store an Error */
|
||||||
if (errp && !*errp) {
|
if (errp && !*errp) {
|
||||||
error_setg(errp, QERR_DEVICE_INIT_FAILED,
|
error_setg(errp, QERR_DEVICE_INIT_FAILED,
|
||||||
|
|
|
@ -474,8 +474,6 @@
|
||||||
#
|
#
|
||||||
# @id: identifier for monitor commands
|
# @id: identifier for monitor commands
|
||||||
#
|
#
|
||||||
# @name: identifier for monitor commands, ignored if @id is present
|
|
||||||
#
|
|
||||||
# @opts: device type specific properties (legacy)
|
# @opts: device type specific properties (legacy)
|
||||||
#
|
#
|
||||||
# Since: 1.2
|
# Since: 1.2
|
||||||
|
@ -483,7 +481,6 @@
|
||||||
{ 'struct': 'NetLegacy',
|
{ 'struct': 'NetLegacy',
|
||||||
'data': {
|
'data': {
|
||||||
'*id': 'str',
|
'*id': 'str',
|
||||||
'*name': 'str',
|
|
||||||
'opts': 'NetLegacyOptions' } }
|
'opts': 'NetLegacyOptions' } }
|
||||||
|
|
||||||
##
|
##
|
||||||
|
|
Loading…
Reference in a new issue