Copying Andreas just in case. Thomas Huth <th...@redhat.com> writes:
> On 07/17/2015 09:25 AM, Peter Maydell wrote: >> On 17 July 2015 at 07:53, Thomas Huth <th...@redhat.com> wrote: >>> Ok, assuming that my "Network traffic dumping for -netdev devices" patch >>> series is going to solve the dumping-for-netdev problem, how do we >>> tackle the remaining problems that we have to solve before we can >>> deprecate -net? Does anybody have a survey of the (onboard) NICs that >>> can only be configured with -net but not with -device? Could they >>> nowadays be changed to work with -device, too, or are there still major >>> obstacles to solve first? >> >> The problem is that "-device" says "create a new device and >> configure it like this". But onboard NICs are created by >> the board, so we want let the user say how to configure >> those devices, not create new ones... The more general problem is lack of a uniform way to configure onboard devices. We have a bunch of ways to configure onboard devices: -net nic, -serial, -parallel, -drive, ... These all deposit configuration requests in well-known places for the board code to pick up. A request can apply (a) to a mandatory onboard device, modifying its configuration, or (b) to an optional onboard device, triggering its creation, or (c) to nothing in particular. It all depends on the board code. For qdevified devices, you can replace (b) with -device, but not (a), as Peter points out. To likewise replace (a), we'd need means to change an *existing* device's properties. Complication: how to address the device. Onboard devices don't have a qdev ID... QOM path? Aside: you can sometimes use -global to replace (a), but it's not general, because -global applies to all devices of a certain type, not just the one you're actually targeting. > Ok, I see ... maybe it makes sense to simply keep "-net nic" to be able > to configure the default/onboard NIC, and only to remove all the other > -net options instead ("-net user" etc.). The disliked vlan/hub concept > could then be removed, too, since "-net nic" can be used together with > "-netdev" nowadays by using something like "-net nic,netdev=xxx" as far > as I know. That would clean up most points of confusion, I think, and > would not cause too much code churn for the onboard NICs. Does that > sound feasible? Deprecating -net except for -net nic sounds like a fine step forward to me.