qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 2/2] net: Drop the NetLegacy structure, always use Netdev


From: Eric Blake
Subject: Re: [PATCH v3 2/2] net: Drop the NetLegacy structure, always use Netdev instead
Date: Thu, 21 May 2020 16:51:04 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0

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 <address@hidden>
---
  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 <address@hidden>

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]