On 12/05/2020 16.26, Eric Blake wrote: > On 5/12/20 7:31 AM, Thomas Huth wrote: >> 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 <ebl...@redhat.com> >> Signed-off-by: Thomas Huth <th...@redhat.com> >> --- >> docs/system/deprecated.rst | 15 +++++++++------ >> net/net.c | 10 +--------- >> qapi/net.json | 3 --- >> 3 files changed, 10 insertions(+), 18 deletions(-) >> > >> +++ b/qapi/net.json >> @@ -474,8 +474,6 @@ >> # >> # @id: identifier for monitor commands >> # >> -# @name: identifier for monitor commands, ignored if @id is present >> -# >> # @opts: device type specific properties (legacy) >> # >> # Since: 1.2 >> @@ -483,7 +481,6 @@ >> { 'struct': 'NetLegacy', >> 'data': { >> '*id': 'str', >> - '*name': 'str', >> 'opts': 'NetLegacyOptions' } } > > Why is 'id' left optional? I'd expect it to be mandatory, now.
That's because it is still optional, indeed. It is currently perfectly valid to run "qemu-system-xyz -net user -net nic" without specifying any "id". If I remove the "*" here, the old syntax breaks. I don't think that we want this here, so "*id" has to stay optional. (FWIW, the ID is then created internally, see assign_name() in net/net.c) Thomas