[1/3] migration/postcopy: rename postcopy_ram_enable_notify to postcopy_ram_incoming_setup
diff mbox series

Message ID 20191001100122.17730-2-richardw.yang@linux.intel.com
State New
Headers show
Series
  • migration/postcopy: cleanup related to postcopy
Related show

Commit Message

Wei Yang Oct. 1, 2019, 10:01 a.m. UTC
Function postcopy_ram_incoming_setup and postcopy_ram_incoming_cleanup
is a pair. Rename to make it clear for audience.

Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
---
 migration/postcopy-ram.c | 4 ++--
 migration/postcopy-ram.h | 2 +-
 migration/savevm.c       | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

Comments

Dr. David Alan Gilbert Oct. 8, 2019, 2:17 p.m. UTC | #1
* Wei Yang (richardw.yang@linux.intel.com) wrote:
> Function postcopy_ram_incoming_setup and postcopy_ram_incoming_cleanup
> is a pair. Rename to make it clear for audience.
> 
> Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>

Yes OK.
It really initially just setup the userfault, but it also kicks off the
fault thread as well so it has got a bit more hairy.


Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

> ---
>  migration/postcopy-ram.c | 4 ++--
>  migration/postcopy-ram.h | 2 +-
>  migration/savevm.c       | 2 +-
>  3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c
> index 1f63e65ed7..b24c4a10c2 100644
> --- a/migration/postcopy-ram.c
> +++ b/migration/postcopy-ram.c
> @@ -1094,7 +1094,7 @@ retry:
>      return NULL;
>  }
>  
> -int postcopy_ram_enable_notify(MigrationIncomingState *mis)
> +int postcopy_ram_incoming_setup(MigrationIncomingState *mis)
>  {
>      /* Open the fd for the kernel to give us userfaults */
>      mis->userfault_fd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
> @@ -1321,7 +1321,7 @@ int postcopy_request_shared_page(struct PostCopyFD *pcfd, RAMBlock *rb,
>      return -1;
>  }
>  
> -int postcopy_ram_enable_notify(MigrationIncomingState *mis)
> +int postcopy_ram_incoming_setup(MigrationIncomingState *mis)
>  {
>      assert(0);
>      return -1;
> diff --git a/migration/postcopy-ram.h b/migration/postcopy-ram.h
> index 9c8bd2bae0..d2668cc820 100644
> --- a/migration/postcopy-ram.h
> +++ b/migration/postcopy-ram.h
> @@ -20,7 +20,7 @@ bool postcopy_ram_supported_by_host(MigrationIncomingState *mis);
>   * Make all of RAM sensitive to accesses to areas that haven't yet been written
>   * and wire up anything necessary to deal with it.
>   */
> -int postcopy_ram_enable_notify(MigrationIncomingState *mis);
> +int postcopy_ram_incoming_setup(MigrationIncomingState *mis);
>  
>  /*
>   * Initialise postcopy-ram, setting the RAM to a state where we can go into
> diff --git a/migration/savevm.c b/migration/savevm.c
> index adad938f57..f3292eb003 100644
> --- a/migration/savevm.c
> +++ b/migration/savevm.c
> @@ -1865,7 +1865,7 @@ static int loadvm_postcopy_handle_listen(MigrationIncomingState *mis)
>       * shouldn't be doing anything yet so don't actually expect requests
>       */
>      if (migrate_postcopy_ram()) {
> -        if (postcopy_ram_enable_notify(mis)) {
> +        if (postcopy_ram_incoming_setup(mis)) {
>              postcopy_ram_incoming_cleanup(mis);
>              return -1;
>          }
> -- 
> 2.17.1
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

Patch
diff mbox series

diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c
index 1f63e65ed7..b24c4a10c2 100644
--- a/migration/postcopy-ram.c
+++ b/migration/postcopy-ram.c
@@ -1094,7 +1094,7 @@  retry:
     return NULL;
 }
 
-int postcopy_ram_enable_notify(MigrationIncomingState *mis)
+int postcopy_ram_incoming_setup(MigrationIncomingState *mis)
 {
     /* Open the fd for the kernel to give us userfaults */
     mis->userfault_fd = syscall(__NR_userfaultfd, O_CLOEXEC | O_NONBLOCK);
@@ -1321,7 +1321,7 @@  int postcopy_request_shared_page(struct PostCopyFD *pcfd, RAMBlock *rb,
     return -1;
 }
 
-int postcopy_ram_enable_notify(MigrationIncomingState *mis)
+int postcopy_ram_incoming_setup(MigrationIncomingState *mis)
 {
     assert(0);
     return -1;
diff --git a/migration/postcopy-ram.h b/migration/postcopy-ram.h
index 9c8bd2bae0..d2668cc820 100644
--- a/migration/postcopy-ram.h
+++ b/migration/postcopy-ram.h
@@ -20,7 +20,7 @@  bool postcopy_ram_supported_by_host(MigrationIncomingState *mis);
  * Make all of RAM sensitive to accesses to areas that haven't yet been written
  * and wire up anything necessary to deal with it.
  */
-int postcopy_ram_enable_notify(MigrationIncomingState *mis);
+int postcopy_ram_incoming_setup(MigrationIncomingState *mis);
 
 /*
  * Initialise postcopy-ram, setting the RAM to a state where we can go into
diff --git a/migration/savevm.c b/migration/savevm.c
index adad938f57..f3292eb003 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -1865,7 +1865,7 @@  static int loadvm_postcopy_handle_listen(MigrationIncomingState *mis)
      * shouldn't be doing anything yet so don't actually expect requests
      */
     if (migrate_postcopy_ram()) {
-        if (postcopy_ram_enable_notify(mis)) {
+        if (postcopy_ram_incoming_setup(mis)) {
             postcopy_ram_incoming_cleanup(mis);
             return -1;
         }