On Fri, Jan 12, 2024 at 10:40:28AM +0000, Daniel P. Berrangé wrote:
> On Fri, Jan 12, 2024 at 08:01:36AM +0800, Peter Xu wrote:
> > On Thu, Jan 11, 2024 at 03:46:02PM -0300, Fabiano Rosas wrote:
> > > > (1) Does this apply to all io channel users, or only migration?
> > > 
> > > All file channel users.
> > 
> > I meant the whole idea of flushing on close, on whether there will be
> > iochannel users that will prefer not do so?  It's a matter of where to put
> > this best.
> 
> IMHO, all users of QIOChannelFile will benefit from flushing, to ensure
> integrity of their saved file upon host crash.

Thanks.  It might be nice to also mention that is for all purpose then in
the commit message (currently, it only mentions "for migration only"), some
description would be even nicer on why it services all purposes.

For example, I think it applies to all as long as we don't have use case
for frequent open/close of iochannels which may require a fast close(), so
all use cases will hope the sync to happen.

Then we could optionally also document above QIOChannelClass.io_close() on
the implied behavior.

When looking at that header, I noticed we used to have io_flush() for
zerocopy.  I'm wondering whether we should also do that for close() when
zerocopy is enabled.  This may mean that file sockets can also implement
io_flush(), then we call io_flush() in close() if ever existed.

Thanks,

-- 
Peter Xu


Reply via email to