Re: [PATCH RFC 04/15] net/vhost-user: add memory isolation

Stefan Hajnoczi <[email protected]> Mon, 27 Jul 2026 14:48:08 -0400
Newsgroups dev.linux.lists.virtio-fs,org.nongnu.qemu-devel
Message-ID <20260727184808.GC371693@fedora>
--1OUtWB2/rX/yB0aQ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Jul 23, 2026 at 03:30:03PM -0700, Connor Kite wrote:
> Add a memory-isolation property to NetdevPassOptions and
> NetDevVhostUserOptions in net.json.  This property will
> be used for vhost-user devices to disable access to guest
> memory from devices.
>=20
> It will be passed into vhost_user_init() in a future patch.
>=20
> Signed-off-by: Connor Kite <[email protected]>
> ---
>  net/passt.c      |  7 +++++++
>  net/vhost-user.c |  4 ++++
>  qapi/net.json    | 15 +++++++++++----
>  3 files changed, 22 insertions(+), 4 deletions(-)
>=20
> diff --git a/net/passt.c b/net/passt.c
> index 45440c399b..ce80186883 100644
> --- a/net/passt.c
> +++ b/net/passt.c
> @@ -735,6 +735,13 @@ int net_init_passt(const Netdev *netdev, const char =
*name,
>      s->pidfile =3D pidfile;
> =20
>      if (netdev->u.passt.has_vhost_user && netdev->u.passt.vhost_user) {
> +        bool memory_isolation G_GNUC_UNUSED =3D false;
> +
> +        if (netdev->u.passt.has_memory_isolation &&
> +           netdev->u.passt.memory_isolation) {
> +            memory_isolation =3D true;
> +        }

This is dead code (hence G_GNUC_UNUSED) and is harder to review because
we don't know how it will be used until later in the patch series. I
guess vhost_user_init() and net_passt_vhost_user_init() will gain a
memory_isolation argument in a future patch.

Linear reviews of the patch series are easiest for reviewers. Please
reorder this so that vhost_user_init() and net_pass_vhost_user_init()
are changed first. You can hardcode the argument to false in those
patches. This patch can be moved afterwards so that memory_isolation is
never dead code.

--1OUtWB2/rX/yB0aQ
Content-Type: application/pgp-signature; name=signature.asc

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAmpnp+gACgkQnKSrs4Gr
c8gPOQf/XYHmejG58UtHRz8dS3h1zerjw27qrlpz+sb/VxPkff6Q/N1EFsQBjOYI
mzxUd8rmBkUdE6VtdcU9EBjyJdOFuimihT8mM+GD6fq8Iui6U1tVGVRxFNvefRo4
2lTCTqvDMCQUIIMflryfP5oVGZY2Gq3V65xOslZ7MYvilPWCVG4iIS58/1vk1VI7
qHaQoJPMpSsSyZ/PYLbb8R5JCtGprERCDaadSXXQDqpTF9iiFrAW0CQRhdmKTYXz
K5GA2i1EAO74SJzBBBd1UglZ4mwZBsmv5RBj1eopve0TfTDfMGiUzOlZAiNUvpCl
kw0n/Akh/aL6XnT5z8uReL63ALKMng==
=8TkL
-----END PGP SIGNATURE-----

--1OUtWB2/rX/yB0aQ--