On 17.08.26 21:49, Peter Xu wrote:
On Mon, Aug 17, 2026 at 09:15:17PM +0300, Vladimir Sementsov-Ogievskiy wrote:
We only need to touch migration_capabilities_and_transport_compatible()?
It should work for both, and fail QMP commands directly might also be
slightly better.
Hm. Actually, migration_capabilities_and_transport_compatible() only sees
the parsed MigrationAddress, before any QIOChannel is created. At that
point we can't call qio_channel_has_feature(ioc, QIO_CHANNEL_FEATURE_FD_PASS),
because there is no ioc yet..
So, at least, we can't check, is passed from user fd is a UNIX socket
for SOCKET_ADDRESS_TYPE_FD case.
Maybe have one extra step for FD with socket_sockaddr_to_address()?
For this we need an fd itself, but we don't have it at the moment, we
get it from monitof_fd_param() later (and we can't call it twice, as
it removes the fd from the list).
Now I think, correct place to check FD case is migration_fd_valid()
function, which also called both for outgoing and incoming paths.
So, check that we use either UNIX socket or FD in
migration_capabilities_and_transport_compatible(), and later check
for fd to be UNIX socket in migration_fd_valid().
Will do in v21, if no better ideas.
--
Best regards,
Vladimir