diff options
author | Dr. David Alan Gilbert <dgilbert@redhat.com> | 2018-03-12 17:21:04 +0000 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2018-03-20 05:03:28 +0200 |
commit | 00fa4fc85b00f1a8a810068d158a7a66e88658eb (patch) | |
tree | c9b0fb8b4a92b19ca17e5167077dcadf6ba0a173 /migration/postcopy-ram.h | |
parent | 2a84ffc0be7e54f2f4b76cb3ebfdde0b37bba9f0 (diff) | |
download | qemu-00fa4fc85b00f1a8a810068d158a7a66e88658eb.tar.gz |
postcopy: Allow registering of fd handler
Allow other userfaultfd's to be registered into the fault thread
so that handlers for shared memory can get responses.
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'migration/postcopy-ram.h')
-rw-r--r-- | migration/postcopy-ram.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/migration/postcopy-ram.h b/migration/postcopy-ram.h index 0421c98d57..f21eef6702 100644 --- a/migration/postcopy-ram.h +++ b/migration/postcopy-ram.h @@ -143,4 +143,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 */ + const char *idstr; +}; + +/* Register a userfaultfd owned by an external process for + * shared memory. + */ +void postcopy_register_shared_ufd(struct PostCopyFD *pcfd); +void postcopy_unregister_shared_ufd(struct PostCopyFD *pcfd); + #endif |