From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DA82DEB363E for ; Tue, 3 Mar 2026 15:07:01 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vxRKC-0006JJ-UE; Tue, 03 Mar 2026 10:06:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vxRKA-0006Gx-2K for qemu-arm@nongnu.org; Tue, 03 Mar 2026 10:06:14 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vxRK7-0001zk-0T for qemu-arm@nongnu.org; Tue, 03 Mar 2026 10:06:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1772550369; 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: in-reply-to:in-reply-to:references:references; bh=+/1Ia0JDxT+wMwXWYRKbNyOnEImODRJtabXEfJLopJw=; b=INrskINz9MN9lQYBAGWsont48M0VwHX3WGuMHFF3u83+/rRwfLK3ZH7XdRFF09/+W2GNWm 4teT72qwU5s6icM05rXDAlrCenS1+pGOkyTKySnap3PmMZA1BRCuFbzCrkr4OkG2OORt8+ L2fKVRjBeXe8jereJySdLn0kOcDhpkQ= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-145-kfXNNujcMmSzkL5g48kpmg-1; Tue, 03 Mar 2026 10:06:06 -0500 X-MC-Unique: kfXNNujcMmSzkL5g48kpmg-1 X-Mimecast-MFC-AGG-ID: kfXNNujcMmSzkL5g48kpmg_1772550365 Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-8cb390a0c4eso3741285085a.1 for ; Tue, 03 Mar 2026 07:06:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772550365; x=1773155165; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+/1Ia0JDxT+wMwXWYRKbNyOnEImODRJtabXEfJLopJw=; b=H8rSlSBWl4mkcqiPLOlcekgFOsXEgj5GxV5cEj2oEbJx2N+MdeZLK5R9dyt+8cIREv dkQ1U6CLQMIE/Hqgww/W+OqADF2GWCq1LaeCJWMQO+6wi3srHtVJLueO3+020VDQVvy8 LXnjea307+DgcC8ZYFrgWmZQYnQZee2qoPBuPcyasQkuZwdyED4K+0Etjxwb1hKReO2D kvzghaqxPcJrcS9Xr9tl+ZtSUkwPUrfvv+dUp1hiNUMgp3G0kyjgPplUdlxq1TAX00+v YmZIMs719uUosELMtPgp/H9i62+pYoRwiS9LEzUqK2TK9Bipvr28s+8vCwvzl2Ewr9Z5 m3sQ== X-Forwarded-Encrypted: i=1; AJvYcCUDCPqF6e1EDGzzFHewjfHciYeSgRu7PtjhjnqXZdWef8QKsLvuxxl2GZ+Jg1ygLocsDoAngqMs9w==@nongnu.org X-Gm-Message-State: AOJu0Yxu6LQisH2hGaPQNema0bR7MVLNRn0KWWIH8aY5bsJ+BvDHbuzo 3ibagNep3aEz/2DljYenfwGKC+l900qzTYYqA/cVw5eX4BIkrLX7bcfX8bqDlU+n6KhGeoUPx8V bkqgp1B9KvIXo01kTZAv7OgyB+bc6PXMdBZjnH5k6VHhMZvs1vqqf5w== X-Gm-Gg: ATEYQzyN6xq0mcvhaMrY6bZjc6wyk1mc5fiTnyAGl9ByoL9VfoQrvTs9yOUzI7IZCwD W9E8Yp++VIXCW/C7rEyVJwyqaiyMmSzbV0cSr/dV2WQhrGzKsBmWdDSqPJ2ravTtJiqN4ufGq9c 1CkOu903CGksDcZOmTA76oNMIR1InaO56of34TH1IyymjyTNeepOvKqs3UgMiFdOodQdtwRwe7n tt1uStzc0f0KpA8+s6sCikz9yaXCi8cJ8H/tzoaft0dasvcNu4lj+JBr+ecP15ztHpDlAqDDVaq g4WKU90HG9nUaHl1f9ZxmDOwa/tFFrlZ9VjHcJm0xgWbZTA5uhyrupn/x1gzVLn912dfB0Cgz85 5QhOccD7bzGn7mQ== X-Received: by 2002:a05:620a:4015:b0:8cb:4d9b:6b48 with SMTP id af79cd13be357-8cbc8d6f18bmr1928604285a.6.1772550365524; Tue, 03 Mar 2026 07:06:05 -0800 (PST) X-Received: by 2002:a05:620a:4015:b0:8cb:4d9b:6b48 with SMTP id af79cd13be357-8cbc8d6f18bmr1928598185a.6.1772550365036; Tue, 03 Mar 2026 07:06:05 -0800 (PST) Received: from x1.local ([174.91.117.149]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8cbbf6f93b5sm1399519585a.31.2026.03.03.07.06.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Mar 2026 07:06:03 -0800 (PST) Date: Tue, 3 Mar 2026 10:05:52 -0500 From: Peter Xu To: Vladimir Sementsov-Ogievskiy Cc: Fabiano Rosas , Pierrick Bouvier , Nicholas Piggin , Harsh Prateek Bora , Peter Maydell , "open list:All patches CC here" , "open list:sPAPR (pseries)" , "open list:ARM TCG CPUs" Subject: Re: [PATCH v2 03/16] migration: make .post_save() a void function Message-ID: References: <20260220210214.800050-1-vsementsov@yandex-team.ru> <20260220210214.800050-4-vsementsov@yandex-team.ru> <87ecm5u7wc.fsf@suse.de> <5be3da95-a636-4b50-8d68-17f363fc005b@yandex-team.ru> MIME-Version: 1.0 In-Reply-To: <5be3da95-a636-4b50-8d68-17f363fc005b@yandex-team.ru> X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: GRsLb-mgFjYtcSAlQJ2GYwcIEL4TfX-vac7CmjsmIgc_1772550365 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Received-SPF: pass client-ip=170.10.129.124; envelope-from=peterx@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -5 X-Spam_score: -0.6 X-Spam_bar: / X-Spam_report: (-0.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.322, RCVD_IN_VALIDITY_SAFE_BLOCKED=1.141, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-arm-bounces+qemu-arm=archiver.kernel.org@nongnu.org Sender: qemu-arm-bounces+qemu-arm=archiver.kernel.org@nongnu.org On Sat, Feb 28, 2026 at 02:56:30AM +0300, Vladimir Sementsov-Ogievskiy wrote: > On 28.02.26 01:41, Fabiano Rosas wrote: > > > diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h > > > index 3695afd483..15578b3e28 100644 > > > --- a/include/migration/vmstate.h > > > +++ b/include/migration/vmstate.h > > > @@ -223,7 +223,15 @@ struct VMStateDescription { > > > bool (*post_load_errp)(void *opaque, int version_id, Error **errp); > > > int (*pre_save)(void *opaque); > > > bool (*pre_save_errp)(void *opaque, Error **errp); > > > - int (*post_save)(void *opaque); > > > + > > > + /* > > > + * post_save() rarely used to free some temporary resources. > > > + * It's is called if .pre_save[_errp]() call was successful > > > + * (or .pre_save[_errp] handler absent), regardless success > > > + * or failure during fields and subsections save. If > > > + * .pre_save[_errp]() fails, .post_save() is not called. > > > + */ > > I would not mention usage directly and maybe also simplify the language > > a bit. If there's doubt on the exact flow, people can read the code: > > > > /* > > * Unless .pre_save() fails, post_save() is called after saving > > * fields and subsections. It should not fail because at this point > > * the state has potentially already been transferred. > > */ > > > Agree, sounds good. With the update, feel free to take: Reviewed-by: Peter Xu -- Peter Xu