On 30.10.25 20:19, Vladimir Sementsov-Ogievskiy wrote:
To implement in future backend-transfer migration for virtio-net,
i.e. we are going to migrate TAP fd and some other TAP properties,
we'll need a possibility to postpone opening TAP device until the
point where we are know what user wants: open TAP device, or wait
from fd coming in migration stream.
So, new interface is here: since this commit, net backends may
postpone some initialization actions (like opening or connecting)
up to call of .backend_connect() handler.
Currently, for all net drivers, .backend_connect() is called
during set of netdev property, so drivers continue to work with
already "connected" backends.
Still, we add a possibility for drivers to use new
DEFINE_NIC_PROPERTIES_NO_CONNECT() instead of
DEFINE_NIC_PROPERTIES(). This way, driver take responsibility
to call net_backend_connect() in its own. So, in future we'll
use it in vritio-net, to finally implement backand-transfer
migration fot TAP backend.
Signed-off-by: Vladimir Sementsov-Ogievskiy<[email protected]>
fixup for this commit (otherwise new macro is impossible to use):
--- a/include/hw/qdev-properties-system.h
+++ b/include/hw/qdev-properties-system.h
@@ -20,6 +20,7 @@ extern const PropertyInfo qdev_prop_fdc_drive_type;
extern const PropertyInfo qdev_prop_drive;
extern const PropertyInfo qdev_prop_drive_iothread;
extern const PropertyInfo qdev_prop_netdev;
+extern const PropertyInfo qdev_prop_netdev_no_connect;
extern const PropertyInfo qdev_prop_pci_devfn;
extern const PropertyInfo qdev_prop_blocksize;
extern const PropertyInfo qdev_prop_pci_host_devaddr;
--
Best regards,
Vladimir