On Mon, Oct 16, 2023 at 11:55:25AM +0200, Jan Beulich wrote:
> On 04.10.2023 15:53, Roger Pau Monne wrote:
> > @@ -1950,7 +1978,15 @@ int mem_sharing_fork_reset(struct domain *d, bool
> > reset_state,
> >
> > state:
> > if ( reset_state )
> > + {
> > rc = copy_settings(d, pd);
> > + if ( rc == -ERESTART )
> > + /*
> > + * Translate to -EAGAIN, see TODO comment at top of function
> > about
> > + * hypercall continuations.
> > + */
> > + rc = -EAGAIN;
> > + }
>
> Are existing callers known to properly handle EAGAIN? I'm worried of the
> verbosity that was no lost here.
No idea about the callers using XENMEM_sharing_op_fork_reset, but it
did seem the best option rather than leaking -ERESTART to callers. We
have no callers of xc_memshr_fork_reset() in the tree.
vm_event_resume() will trigger an assert if mem_sharing_fork_reset()
fails with any error code, so doesn't make much difference there if
the return is -EAGAIN or -ERESTART.
My initial proposal had -EBUSY IIRC.
Thanks, Roger.