From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202412 header.b=fBrmIEDd; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 7904C5A0626 for ; Fri, 31 Jan 2025 07:32:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202412; t=1738305128; bh=kPqa6MZyUwTruDtI+WjTubacXgRE+AUHz907Ys4WmTs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fBrmIEDdz5PUP6hnunS1bInrvR1j5ReDym8EEiZAqZzAi5oRrZ9Cuh8PlESaQtmQ/ Vd5hAaamDR2u5Rj8rBzaCYyoc0jnANnLtDJshHFXQhpMPs4SwSLYF4qbrqS71OKKn/ gFrO8lw7LUIkaZWyxJRjylVdxuqJhKsKTOZHjTgdAtHlO/L62GPY/uAO7toDWWL1wR 0mNcx9jEz7Z+8n7XWx3q37A2jaer/Nt/Vtf3/svJeqltP196R4zY1pprE1SsH/b9d5 wsxun38kgoyVkbBnDrdX60DB1L0EXVNQlzfoiynq7jreXWatM9HZzN7uHB8lPt+Y/b nj9nabcDyVIWA== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4YkmJm0Zkmz4x4t; Fri, 31 Jan 2025 17:32:08 +1100 (AEDT) Date: Fri, 31 Jan 2025 17:21:47 +1100 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH 2/2] migrate: More sophisticated versioning Message-ID: References: <20250131045215.1368543-1-david@gibson.dropbear.id.au> <20250131045215.1368543-3-david@gibson.dropbear.id.au> <20250131065348.0b283d0f@elisabeth> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Ow3y00eQfPxnNrr+" Content-Disposition: inline In-Reply-To: <20250131065348.0b283d0f@elisabeth> Message-ID-Hash: XQNRCPEQHPNKSZJQPMHKAKZ6OORFDFVD X-Message-ID-Hash: XQNRCPEQHPNKSZJQPMHKAKZ6OORFDFVD X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --Ow3y00eQfPxnNrr+ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 31, 2025 at 06:53:48AM +0100, Stefano Brivio wrote: > On Fri, 31 Jan 2025 15:52:15 +1100 > David Gibson wrote: >=20 > > At present the header for our device state migration stream is sent as > > a buffer in the sections array, like anything else. It contains both > > version information, and details on the source ABI which are specific to > > v1 of the migration protocol. Alter this for greater flexibility: > >=20 > > * We separate out a minimal fixed header, which we will need to keep f= or > > every future version, from a version specific header, containing (for > > v1) the ABI data >=20 > What's the purpose of this if there should be no ABI data? We might get rid of the ABI data, but it seems very likely to me that future protocol versions will want some sort of header / metadata information. More specifically, it seems likely to me that they'll want some sort of meta information that needs to be checked / processed, but not read into a long term data structure as-is. The read_header_v() hook allows us to do that easily. > I have this for the moment: >=20 > /* Immutable part of header structure: keep these two sections at the > * beginning, because they are enough to identify a version regardless > * of metadata. > */ > .magic =3D MIGRATE_MAGIC, > .version =3D htonl_constant(MIGRATE_VERSION), > /* End of immutable part of header structure */ >=20 > ...which to be honest already felt like wasted effort, despite being > just two comments. >=20 > > * Handle both the headers separately from the data sections making for > > better symmetry between the source and target sides > > * Add a "compat_version" field. This will allow us to make future > > protocol extensions which are backwards compatible with older target= s, > > while retaining the ability to also make breaking protocol extension= s. > >=20 > > This establishes a minimal header with fixed representation to maintain > > for all future versions. > >=20 > > Signed-off-by: David Gibson > > --- > > migrate.c | 157 ++++++++++++++++++++++++++++++++++++++++-------------- > > migrate.h | 26 ++++++--- > > 2 files changed, 138 insertions(+), 45 deletions(-) > ^^^ >=20 > ...is this really a good idea if we want to drop this right away? I > might be missing something but I think it would more sense to focus on > the "targeted" data transfer instead. I'm seeing this as preliminary steps towards doing the targeted data transfer. For one thing I want to be able to experiment with that (let's call it v2) without breaking your v1 stuff. Even if we drop v1 before merge, I think that's useful during dev. But even without that, I think I'm going to want some sort of "header" information for v2, and this provides an easy way to hook that in. --=20 David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson --Ow3y00eQfPxnNrr+ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmeca/oACgkQzQJF27ox 2Gd7zg//ZDlYA+NGsJTPEFPFrkzNaTsECcgtA6OvUOWxLJym6LvfYuPi3QQmZc8D bocmne0iGI3NVml2eju/ZkfZvE9jDWAVfo28GtN6ZI0vRQcpvxNlMBKj7Kyw67Up 7kvXfeY48KkwC30jNt0j7buCRwJ/mXnrLYnts3aey/Q+gODh/zBegbFnbF4AMrYi Bo1Kgz1zrAuNiKMX7/vqHlgfdtSavieneeUwmz959WNQkqEy/nRdsoPR5Em0AfzU KziULWGyePuR8PEb46QvzWXShsiD+H+h1UBvTqjGFUNHYzxzDKZWZT1Rgwlk85V9 do5OXZN/7aDsYCQRIVt0dJR/jhExGnhpw/rPiMabnb0C1DTA7ZsmtNUc3QHQ00YH BmKNbIz6YOBxbg8SrNoGyPq4pr1cHnlJ+w/WgKbAGRVDjjj+/MiCV+0piugrVbQ3 dgCT6ahW+eOE3YA1H3Lv1FwlmbgVa4Aa54jPCZZY2LZKEsvq7O2phNG9njpgNbgf DsGz97qwPaH9xE9ZvNb9UOO7S7MhGwWNe6L6+EKa0JwX3IRZcRdYcRcjio+Jp6kj 9cXofubRYEvjL/K8uy3R7mul20hpL3iRAm/+uAOhHczhuhq8wtUwZa8s7vx18m2Y dwalogUY01FSH8Uu4POZezyLLlhhYiddy+ByHdD+WaGldCN4R1Y= =rEwq -----END PGP SIGNATURE----- --Ow3y00eQfPxnNrr+--