On 5/18/20 1:01 PM, Thomas Huth wrote:
Now that the "name" parameter is gone, there is hardly any difference
between NetLegacy and Netdev anymore, so we can drop NetLegacy and always
use Netdev to simplify the code quite a bit.
The only two differences that were really left between Netdev and NetLegacy:
1) NetLegacy does not allow a "hubport" type. We can continue to block
this with a simple check in net_client_init1() for this type.
2) The "id" parameter was optional in NetLegacy (and an internal id
was chosen via assign_name() during initialization), but it is mandatory
for Netdev. To avoid that the visitor code bails out here, we have to
add an internal id to the QemuOpts already earlier now.
Signed-off-by: Thomas Huth <th...@redhat.com>
---
Note: I did not rename the "is_netdev" parameter of the function (as
Eric suggested) - you really have to think of "-netdev" vs. "-net"
here and not about "Netdev" vs. "NetLegacy". But if this "is_netdev"
thing still confuses us in the future, we can still rename it with an
additional follow-up patch later instead.
Works for me. It still might be nice mentioning "-netdev" vs. "-net" in
the commit message (and the fact that "-net" was what was previously
using the legacy type). But with the explanations you've given, the
code looks correct, and a commit message tweak does not change:
Reviewed-by: Eric Blake <ebl...@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org