On Fri, Feb 16, 2018 at 01:16:05PM +0000, Dr. David Alan Gilbert (git) wrote:
[...]
> diff --git a/migration/postcopy-ram.h b/migration/postcopy-ram.h
> index bee21d4401..4bda5aa509 100644
> --- a/migration/postcopy-ram.h
> +++ b/migration/postcopy-ram.h
> @@ -141,4 +141,25 @@ void postcopy_remove_notifier(NotifierWithReturn *n);
> /* Call the notifier list set by postcopy_add_start_notifier */
> int postcopy_notify(enum PostcopyNotifyReason reason, Error **errp);
>
> +struct PostCopyFD;
> +
> +/* ufd is a pointer to the struct uffd_msg *TODO: more Portable! */
> +typedef int (*pcfdhandler)(struct PostCopyFD *pcfd, void *ufd);
> +
> +struct PostCopyFD {
> + int fd;
> + /* Data to pass to handler */
> + void *data;
> + /* Handler to be called whenever we get a poll event */
> + pcfdhandler handler;
> + /* A string to use in error messages */
> + char *idstr;
This was changed to const char in next patch. We can move it here?
The patch is a big one, there are quite a lot of TODOs and I still
think there can be some helper functions shared between fd handling
for 0-1 and 2-N but it looks good to me for merging as a first version.
After we have confirmed the definition of PostCopyFD please add:
Reviewed-by: Peter Xu <[email protected]>
Thanks,
--
Peter Xu