public inbox for qemu-rust@nongnu.org
 help / color / mirror / Atom feed
* Re: [PATCH v3 03/18] migration: make .post_save() a void function
       [not found]   ` <87o6l01r5z.fsf@suse.de>
@ 2026-03-09 14:41     ` Zhao Liu
  0 siblings, 0 replies; only message in thread
From: Zhao Liu @ 2026-03-09 14:41 UTC (permalink / raw)
  To: Fabiano Rosas, Paolo Bonzini
  Cc: Vladimir Sementsov-Ogievskiy, peterx, qemu-devel,
	Pierrick Bouvier, Nicholas Piggin, Harsh Prateek Bora,
	Peter Maydell, open list:sPAPR (pseries), open list:ARM TCG CPUs,
	qemu-rust

> +CC Paolo, Zhao
> 
> This change breaks the rust build:
> https://gitlab.com/farosas/qemu/-/jobs/13393119755
> 
>   error[E0308]: mismatched types
>      --> ../rust/migration/src/vmstate.rs:605:18
>       |
>   605 |             Some(vmstate_no_version_cb::<T, F>)
>       |             ---- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found fn item
>       |             |
>       |             arguments to this enum variant are incorrect
>       |
>       = note: expected fn pointer `unsafe extern "C" fn(_) -> ()`
>                     found fn item `unsafe extern "C" fn(_) -> i32 {vmstate_no_version_cb::<T, F, impl Into<Errno>>}`
> 
> 
> Is something like the following diff the right fix? It'd be nice to get
> an ack so this series doesn't miss the freeze. (CI run:
> https://gitlab.com/farosas/qemu/-/pipelines/2369688593)
> 
> -- >8 --
> From 90a7b53d2b0d53692df1ef2cfe7607b13e4961d8 Mon Sep 17 00:00:00 2001
> From: Fabiano Rosas <farosas@suse.de>
> Date: Fri, 6 Mar 2026 18:53:14 -0300
> Subject: [PATCH] fixup! migration: make .post_save() a void function
> 
> Signed-off-by: Fabiano Rosas <farosas@suse.de>
> ---
>  rust/migration/src/migratable.rs |  3 +--
>  rust/migration/src/vmstate.rs    | 12 +++++++-----
>  2 files changed, 8 insertions(+), 7 deletions(-)
> 
> diff --git a/rust/migration/src/migratable.rs b/rust/migration/src/migratable.rs
> index 7748aac2f2..7088c1b156 100644
> --- a/rust/migration/src/migratable.rs
> +++ b/rust/migration/src/migratable.rs
> @@ -406,10 +406,9 @@ fn pre_save(&self) -> Result<(), InvalidError> {
>          Ok(())
>      }
>  
> -    fn post_save(&self) -> Result<(), InvalidError> {
> +    fn post_save(&self) {
>          let state = unsafe { Box::from_raw(self.migration_state.replace(ptr::null_mut())) };
>          drop(state);
> -        Ok(())
>      }

What about this?

fn post_save(&self) {
    let _ = unsafe { Box::from_raw(self.migration_state.replace(ptr::null_mut())) };
}

Others LGTM,

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-03-09 14:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20260304212303.667141-1-vsementsov@yandex-team.ru>
     [not found] ` <20260304212303.667141-4-vsementsov@yandex-team.ru>
     [not found]   ` <87o6l01r5z.fsf@suse.de>
2026-03-09 14:41     ` [PATCH v3 03/18] migration: make .post_save() a void function Zhao Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox