From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=AiBsepdp; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTPS id 954615A004E for ; Mon, 03 Feb 2025 11:20:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1738578010; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=0iziFvWCGdW9k1H2bUIfdDBXfQVqQBo03FWV2v2x3Qk=; b=AiBsepdpVPVOBX09YAusdfQoTD6dTHqvSK/RJgzYYuHIBfcVf9ZoYjEZcjHJGONMlEbqxO wsShqV/xxSwqmClhmGI3RbIdmjGEck1LYny64ZunB1UEhUmvBlJh9N4BOPuiBYRNX6oejT bhfjoFPzB3TotRfP2e24f4JaS5KIZtE= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-653-tWpXPiwTO0OZli31ZedQUw-1; Mon, 03 Feb 2025 05:20:09 -0500 X-MC-Unique: tWpXPiwTO0OZli31ZedQUw-1 X-Mimecast-MFC-AGG-ID: tWpXPiwTO0OZli31ZedQUw Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-4359206e1e4so35973755e9.2 for ; Mon, 03 Feb 2025 02:20:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738578007; x=1739182807; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=0iziFvWCGdW9k1H2bUIfdDBXfQVqQBo03FWV2v2x3Qk=; b=pDQ1C0FfRK7VSH/rhYH1pappdCEuz9uTnRztnAlEgyh7SRATsuUUCrli+GiIJaf61G JeHKmiRR5zKDappudX98+zd37dZ3+6ApaSeAgXBPaqA8qbxVwnNjkbcLtpfU+5Ox+OCf qoHO/y9gPYjY0k+CU/PVHV5MKcpBOpUwXEdyT9aRB0fgLn3R/lpTsRVrPTTy8L+4Aj9C QrCxiD4ls2hnF2Mhvun9BCVa7AGk4uGqw8I/kyOfHvkJZ0GeJ6pB7g0ltjG/reqblkNJ vZlrv3yrAYr9LYNEBskuZEZhyUWuzEDhnY7btGhY5L1FqdAp3lHnTQri/k+OL1v8z3oa NqpQ== X-Gm-Message-State: AOJu0YwNXkGjnqyWUCS3et5r9oz9+nlb72tS8GUTh3EuOlqJCvwuKBPv sbTvBQebpDzp0ebvjZkm8lyhhvCxi6r0JHhGW09wX7jLWiQNHudT6E3kwtiGdJTHmuDEA2oS7RB jfk0q9jgiNp/ueDKi0pYE2fH8T26q6qJV+F0YzroViPyST13TKW3lwyzSiQ== X-Gm-Gg: ASbGncuMAWOm/YFBrkno9mKxPLAZpvtMXRZvd5vk1m6GSE43zzYQLlEEzXdX1rNx9Lx zIHsj9vhzfBEeAScUJAFC071uTMAMeF4Hr/U1sxWKbtCMI7bL1gtyH1BzP6VmQiOoz0F5dWvCgB TjshWTzrkrJ1KWdGhAcrbeQwj4imrBeI6m/gDxGnx4yBt6y1Yfc0U241Fc0e75MypUxeNFQHu2J wjx4pGPlbsvtUOT8DZJhHELH7toRO85ZxUPz+fYQfcB7CkGPtWvEl1UPn9ellTvDlWXSyyLF4JJ fSf5zqF9gkbmwKeY X-Received: by 2002:a05:600c:5486:b0:431:5c3d:1700 with SMTP id 5b1f17b1804b1-438dc40d3fdmr191475415e9.21.1738578007224; Mon, 03 Feb 2025 02:20:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IENZ1NltKtrbZz+yYMj35JawFhYtaN/XYbPzy8QUfcTVPnhY6sGSquot/121TPNdaJ4PwQWPA== X-Received: by 2002:a05:600c:5486:b0:431:5c3d:1700 with SMTP id 5b1f17b1804b1-438dc40d3fdmr191475065e9.21.1738578006820; Mon, 03 Feb 2025 02:20:06 -0800 (PST) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [2a10:fc81:a806:d6a9::1]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c5c0ec7e6sm12493397f8f.19.2025.02.03.02.20.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Feb 2025 02:20:06 -0800 (PST) Date: Mon, 3 Feb 2025 11:20:03 +0100 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH 6/6] migrate: Make migration handlers simpler and more flexible Message-ID: <20250203112003.1bcc7acd@elisabeth> In-Reply-To: <20250203092615.500163-7-david@gibson.dropbear.id.au> References: <20250203092615.500163-1-david@gibson.dropbear.id.au> <20250203092615.500163-7-david@gibson.dropbear.id.au> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 7Oe9OMFFbNdbamLG8f2nLsxTWrhzj7qdOVJtjisX65E_1738578008 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: 3GHOWDE6VSEG6WIOH4S73WHJYRWBKNDO X-Message-ID-Hash: 3GHOWDE6VSEG6WIOH4S73WHJYRWBKNDO X-MailFrom: sbrivio@redhat.com 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: On Mon, 3 Feb 2025 20:26:15 +1100 David Gibson wrote: > +/* Stages for version 1 */ > +static const struct migrate_stage stages_v1[] = { > + { > + .name = "flow pre", > + .source = flow_migrate_source_pre, > + .target = NULL, > + }, > + DATA_STAGE(flow_first_free), > + DATA_STAGE(flowtab), > + DATA_STAGE(flow_hashtab), > + DATA_STAGE(g_hash_secret), ...so this one for g_hash_secret (which is the abomination I wanted to drop) would eventually turn into a function? It looks neat, I'm just not sure if we'll really have "data stages" after I change the approach to only transfer the data we need as you suggested. Is that part of your pending queue by the way, or should I go ahead with it? > [...] > > /** > - * struct migrate_data - Data sections for given source version > - * @v: Source version this applies to, host order > - * @sections: Array of data sections, NULL-terminated > + * migrate_cb_t - Callback function to implement one migration stage > */ > -struct migrate_data { > - uint32_t v; > - struct iovec *sections; > -}; > +typedef int (*migrate_cb_t)(struct ctx *c, struct migrate_meta *m, > + const struct migrate_stage *stage, int fd); typedef is really annoying, we already have a flow_sidx which kind of made sense, but this has really no advantage over something like: struct migrate_handler { int (*fn)(struct ctx *c, struct migrate_meta *m); }; -- Stefano