All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2] postcopy: drop ram_pages parameter from postcopy_ram_incoming_init()
@ 2018-06-20 20:27 David Hildenbrand
  2018-06-21 10:36 ` Dr. David Alan Gilbert
  2018-06-27  9:04 ` Juan Quintela
  0 siblings, 2 replies; 3+ messages in thread
From: David Hildenbrand @ 2018-06-20 20:27 UTC (permalink / raw)
  To: qemu-devel
  Cc: Paolo Bonzini, Juan Quintela, Dr . David Alan Gilbert, David Hildenbrand

Not needed. Don't expose last_ram_page().

Signed-off-by: David Hildenbrand <david@redhat.com>
---

v1 -> v2:
- Make "last_ram_page" static

 exec.c                   | 2 +-
 include/exec/ram_addr.h  | 1 -
 migration/postcopy-ram.c | 4 ++--
 migration/postcopy-ram.h | 2 +-
 migration/ram.c          | 4 +---
 5 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/exec.c b/exec.c
index 9f4706db19..cc1c102d95 100644
--- a/exec.c
+++ b/exec.c
@@ -1940,7 +1940,7 @@ static ram_addr_t find_ram_offset(ram_addr_t size)
     return offset;
 }
 
-unsigned long last_ram_page(void)
+static unsigned long last_ram_page(void)
 {
     RAMBlock *block;
     ram_addr_t last = 0;
diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h
index 9295c01a89..d6687690fb 100644
--- a/include/exec/ram_addr.h
+++ b/include/exec/ram_addr.h
@@ -71,7 +71,6 @@ static inline unsigned long int ramblock_recv_bitmap_offset(void *host_addr,
 }
 
 long qemu_getrampagesize(void);
-unsigned long last_ram_page(void);
 RAMBlock *qemu_ram_alloc_from_file(ram_addr_t size, MemoryRegion *mr,
                                    bool share, const char *mem_path,
                                    Error **errp);
diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c
index 48e51556a7..932f188949 100644
--- a/migration/postcopy-ram.c
+++ b/migration/postcopy-ram.c
@@ -500,7 +500,7 @@ static int cleanup_range(const char *block_name, void *host_addr,
  * postcopy later; must be called prior to any precopy.
  * called from arch_init's similarly named ram_postcopy_incoming_init
  */
-int postcopy_ram_incoming_init(MigrationIncomingState *mis, size_t ram_pages)
+int postcopy_ram_incoming_init(MigrationIncomingState *mis)
 {
     if (qemu_ram_foreach_migratable_block(init_range, NULL)) {
         return -1;
@@ -1265,7 +1265,7 @@ bool postcopy_ram_supported_by_host(MigrationIncomingState *mis)
     return false;
 }
 
-int postcopy_ram_incoming_init(MigrationIncomingState *mis, size_t ram_pages)
+int postcopy_ram_incoming_init(MigrationIncomingState *mis)
 {
     error_report("postcopy_ram_incoming_init: No OS support");
     return -1;
diff --git a/migration/postcopy-ram.h b/migration/postcopy-ram.h
index d900d9c34f..9d55536fd1 100644
--- a/migration/postcopy-ram.h
+++ b/migration/postcopy-ram.h
@@ -27,7 +27,7 @@ int postcopy_ram_enable_notify(MigrationIncomingState *mis);
  * postcopy later; must be called prior to any precopy.
  * called from ram.c's similarly named ram_postcopy_incoming_init
  */
-int postcopy_ram_incoming_init(MigrationIncomingState *mis, size_t ram_pages);
+int postcopy_ram_incoming_init(MigrationIncomingState *mis);
 
 /*
  * At the end of a migration where postcopy_ram_incoming_init was called.
diff --git a/migration/ram.c b/migration/ram.c
index cd5f55117d..8de7ab683e 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -3107,9 +3107,7 @@ static int ram_load_cleanup(void *opaque)
  */
 int ram_postcopy_incoming_init(MigrationIncomingState *mis)
 {
-    unsigned long ram_pages = last_ram_page();
-
-    return postcopy_ram_incoming_init(mis, ram_pages);
+    return postcopy_ram_incoming_init(mis);
 }
 
 /**
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH v2] postcopy: drop ram_pages parameter from postcopy_ram_incoming_init()
  2018-06-20 20:27 [Qemu-devel] [PATCH v2] postcopy: drop ram_pages parameter from postcopy_ram_incoming_init() David Hildenbrand
@ 2018-06-21 10:36 ` Dr. David Alan Gilbert
  2018-06-27  9:04 ` Juan Quintela
  1 sibling, 0 replies; 3+ messages in thread
From: Dr. David Alan Gilbert @ 2018-06-21 10:36 UTC (permalink / raw)
  To: David Hildenbrand; +Cc: qemu-devel, Paolo Bonzini, Juan Quintela

* David Hildenbrand (david@redhat.com) wrote:
> Not needed. Don't expose last_ram_page().
> 
> Signed-off-by: David Hildenbrand <david@redhat.com>

Ah nice find; that disappeared part way through the review of my
postcopy series.


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

> ---
> 
> v1 -> v2:
> - Make "last_ram_page" static
> 
>  exec.c                   | 2 +-
>  include/exec/ram_addr.h  | 1 -
>  migration/postcopy-ram.c | 4 ++--
>  migration/postcopy-ram.h | 2 +-
>  migration/ram.c          | 4 +---
>  5 files changed, 5 insertions(+), 8 deletions(-)
> 
> diff --git a/exec.c b/exec.c
> index 9f4706db19..cc1c102d95 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -1940,7 +1940,7 @@ static ram_addr_t find_ram_offset(ram_addr_t size)
>      return offset;
>  }
>  
> -unsigned long last_ram_page(void)
> +static unsigned long last_ram_page(void)
>  {
>      RAMBlock *block;
>      ram_addr_t last = 0;
> diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h
> index 9295c01a89..d6687690fb 100644
> --- a/include/exec/ram_addr.h
> +++ b/include/exec/ram_addr.h
> @@ -71,7 +71,6 @@ static inline unsigned long int ramblock_recv_bitmap_offset(void *host_addr,
>  }
>  
>  long qemu_getrampagesize(void);
> -unsigned long last_ram_page(void);
>  RAMBlock *qemu_ram_alloc_from_file(ram_addr_t size, MemoryRegion *mr,
>                                     bool share, const char *mem_path,
>                                     Error **errp);
> diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c
> index 48e51556a7..932f188949 100644
> --- a/migration/postcopy-ram.c
> +++ b/migration/postcopy-ram.c
> @@ -500,7 +500,7 @@ static int cleanup_range(const char *block_name, void *host_addr,
>   * postcopy later; must be called prior to any precopy.
>   * called from arch_init's similarly named ram_postcopy_incoming_init
>   */
> -int postcopy_ram_incoming_init(MigrationIncomingState *mis, size_t ram_pages)
> +int postcopy_ram_incoming_init(MigrationIncomingState *mis)
>  {
>      if (qemu_ram_foreach_migratable_block(init_range, NULL)) {
>          return -1;
> @@ -1265,7 +1265,7 @@ bool postcopy_ram_supported_by_host(MigrationIncomingState *mis)
>      return false;
>  }
>  
> -int postcopy_ram_incoming_init(MigrationIncomingState *mis, size_t ram_pages)
> +int postcopy_ram_incoming_init(MigrationIncomingState *mis)
>  {
>      error_report("postcopy_ram_incoming_init: No OS support");
>      return -1;
> diff --git a/migration/postcopy-ram.h b/migration/postcopy-ram.h
> index d900d9c34f..9d55536fd1 100644
> --- a/migration/postcopy-ram.h
> +++ b/migration/postcopy-ram.h
> @@ -27,7 +27,7 @@ int postcopy_ram_enable_notify(MigrationIncomingState *mis);
>   * postcopy later; must be called prior to any precopy.
>   * called from ram.c's similarly named ram_postcopy_incoming_init
>   */
> -int postcopy_ram_incoming_init(MigrationIncomingState *mis, size_t ram_pages);
> +int postcopy_ram_incoming_init(MigrationIncomingState *mis);
>  
>  /*
>   * At the end of a migration where postcopy_ram_incoming_init was called.
> diff --git a/migration/ram.c b/migration/ram.c
> index cd5f55117d..8de7ab683e 100644
> --- a/migration/ram.c
> +++ b/migration/ram.c
> @@ -3107,9 +3107,7 @@ static int ram_load_cleanup(void *opaque)
>   */
>  int ram_postcopy_incoming_init(MigrationIncomingState *mis)
>  {
> -    unsigned long ram_pages = last_ram_page();
> -
> -    return postcopy_ram_incoming_init(mis, ram_pages);
> +    return postcopy_ram_incoming_init(mis);
>  }
>  
>  /**
> -- 
> 2.17.1
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH v2] postcopy: drop ram_pages parameter from postcopy_ram_incoming_init()
  2018-06-20 20:27 [Qemu-devel] [PATCH v2] postcopy: drop ram_pages parameter from postcopy_ram_incoming_init() David Hildenbrand
  2018-06-21 10:36 ` Dr. David Alan Gilbert
@ 2018-06-27  9:04 ` Juan Quintela
  1 sibling, 0 replies; 3+ messages in thread
From: Juan Quintela @ 2018-06-27  9:04 UTC (permalink / raw)
  To: David Hildenbrand; +Cc: qemu-devel, Paolo Bonzini, Dr . David Alan Gilbert

David Hildenbrand <david@redhat.com> wrote:
> Not needed. Don't expose last_ram_page().
>
> Signed-off-by: David Hildenbrand <david@redhat.com>
> ---
>
> v1 -> v2:
> - Make "last_ram_page" static

And there was already an v2 of the patch ...
Reviewed-by: Juan Quintela <quintela@redhat.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-06-27  9:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-20 20:27 [Qemu-devel] [PATCH v2] postcopy: drop ram_pages parameter from postcopy_ram_incoming_init() David Hildenbrand
2018-06-21 10:36 ` Dr. David Alan Gilbert
2018-06-27  9:04 ` Juan Quintela

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.