Re: [PATCH v3 10/10] migration: Add a wrapper to cleanup migration files

2023-08-16 Thread Peter Xu
On Wed, Aug 16, 2023 at 11:57:17AM -0300, Fabiano Rosas wrote: > I'm talking about the actual yank action, not the unregister. > > migration_yank_iochannel() calls qio_channel_shutdown() in the same way > as qemu_file_shutdown(), but unlike the latter, it doesn't set > f->last_error = -EIO. Which

Re: [PATCH v3 10/10] migration: Add a wrapper to cleanup migration files

2023-08-16 Thread Fabiano Rosas
Peter Xu writes: > On Tue, Aug 15, 2023 at 07:31:28PM -0300, Fabiano Rosas wrote: >> Peter Xu writes: >> >> > On Fri, Aug 11, 2023 at 12:08:36PM -0300, Fabiano Rosas wrote: >> >> We currently have a pattern for cleaning up a migration QEMUFile: >> >> >> >> qemu_mutex_lock(&s->qemu_file_lock)

Re: [PATCH v3 10/10] migration: Add a wrapper to cleanup migration files

2023-08-16 Thread Peter Xu
On Tue, Aug 15, 2023 at 07:31:28PM -0300, Fabiano Rosas wrote: > Peter Xu writes: > > > On Fri, Aug 11, 2023 at 12:08:36PM -0300, Fabiano Rosas wrote: > >> We currently have a pattern for cleaning up a migration QEMUFile: > >> > >> qemu_mutex_lock(&s->qemu_file_lock); > >> file = s->file_nam

Re: [PATCH v3 10/10] migration: Add a wrapper to cleanup migration files

2023-08-15 Thread Fabiano Rosas
Peter Xu writes: > On Fri, Aug 11, 2023 at 12:08:36PM -0300, Fabiano Rosas wrote: >> We currently have a pattern for cleaning up a migration QEMUFile: >> >> qemu_mutex_lock(&s->qemu_file_lock); >> file = s->file_name; >> s->file_name = NULL; >> qemu_mutex_unlock(&s->qemu_file_lock); >>

Re: [PATCH v3 10/10] migration: Add a wrapper to cleanup migration files

2023-08-15 Thread Peter Xu
On Fri, Aug 11, 2023 at 12:08:36PM -0300, Fabiano Rosas wrote: > We currently have a pattern for cleaning up a migration QEMUFile: > > qemu_mutex_lock(&s->qemu_file_lock); > file = s->file_name; > s->file_name = NULL; > qemu_mutex_unlock(&s->qemu_file_lock); > > migration_ioc_unregister

[PATCH v3 10/10] migration: Add a wrapper to cleanup migration files

2023-08-11 Thread Fabiano Rosas
We currently have a pattern for cleaning up a migration QEMUFile: qemu_mutex_lock(&s->qemu_file_lock); file = s->file_name; s->file_name = NULL; qemu_mutex_unlock(&s->qemu_file_lock); migration_ioc_unregister_yank_from_file(file); qemu_file_shutdown(file); qemu_fclose(file); There