diff mbox series

[v2] s390x: remove direct reference to mem_path global form s390x code

Message ID 1548678699-15717-1-git-send-email-imammedo@redhat.com
State New
Headers show
Series [v2] s390x: remove direct reference to mem_path global form s390x code | expand

Commit Message

Igor Mammedov Jan. 28, 2019, 12:31 p.m. UTC
I plan to deprecate -mem-path option and replace it with memory-backend,
for that it's necessary to get rid of mem_path global variable.
Do it for s390x case, replacing it with alternative way to enable
1Mb hugepages capability.

Todo that replace qemu_mempath_getpagesize() with qemu_getrampagesize()
which also checks for -mem-path provided RAM.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
v2:
  * s/qemu_mempath_getpagesize/qemu_getrampagesiz/ and drop the rest of changes
          David Hildenbrand <david@redhat.com>
---
 target/s390x/kvm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

David Hildenbrand Jan. 28, 2019, 12:46 p.m. UTC | #1
On 28.01.19 13:31, Igor Mammedov wrote:
> I plan to deprecate -mem-path option and replace it with memory-backend,
> for that it's necessary to get rid of mem_path global variable.
> Do it for s390x case, replacing it with alternative way to enable
> 1Mb hugepages capability.
> 
> Todo that replace qemu_mempath_getpagesize() with qemu_getrampagesize()
> which also checks for -mem-path provided RAM.
> 
> Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> ---
> v2:
>   * s/qemu_mempath_getpagesize/qemu_getrampagesiz/ and drop the rest of changes
>           David Hildenbrand <david@redhat.com>
> ---
>  target/s390x/kvm.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c
> index 2ebf26a..90766fa 100644
> --- a/target/s390x/kvm.c
> +++ b/target/s390x/kvm.c
> @@ -287,7 +287,7 @@ void kvm_s390_crypto_reset(void)
>  
>  static int kvm_s390_configure_mempath_backing(KVMState *s)
>  {
> -    size_t path_psize = qemu_mempath_getpagesize(mem_path);
> +    size_t path_psize = qemu_getrampagesize();
>  
>      if (path_psize == 4 * KiB) {
>          return 0;
> @@ -319,7 +319,7 @@ int kvm_arch_init(MachineState *ms, KVMState *s)
>  {
>      MachineClass *mc = MACHINE_GET_CLASS(ms);
>  
> -    if (mem_path && kvm_s390_configure_mempath_backing(s)) {
> +    if (kvm_s390_configure_mempath_backing(s)) {
>          return -EINVAL;
>      }
>  
> 

Nice!

Reviewed-by: David Hildenbrand <david@redhat.com>
Philippe Mathieu-Daudé Jan. 28, 2019, 2:55 p.m. UTC | #2
On 1/28/19 1:31 PM, Igor Mammedov wrote:
> I plan to deprecate -mem-path option and replace it with memory-backend,
> for that it's necessary to get rid of mem_path global variable.
> Do it for s390x case, replacing it with alternative way to enable
> 1Mb hugepages capability.
> 
> Todo that replace qemu_mempath_getpagesize() with qemu_getrampagesize()

I guess this should be: "To do that, replace ..."

> which also checks for -mem-path provided RAM.
> 
> Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> ---
> v2:
>   * s/qemu_mempath_getpagesize/qemu_getrampagesiz/ and drop the rest of changes
>           David Hildenbrand <david@redhat.com>
> ---
>  target/s390x/kvm.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c
> index 2ebf26a..90766fa 100644
> --- a/target/s390x/kvm.c
> +++ b/target/s390x/kvm.c
> @@ -287,7 +287,7 @@ void kvm_s390_crypto_reset(void)
>  
>  static int kvm_s390_configure_mempath_backing(KVMState *s)
>  {
> -    size_t path_psize = qemu_mempath_getpagesize(mem_path);
> +    size_t path_psize = qemu_getrampagesize();
>  
>      if (path_psize == 4 * KiB) {
>          return 0;
> @@ -319,7 +319,7 @@ int kvm_arch_init(MachineState *ms, KVMState *s)
>  {
>      MachineClass *mc = MACHINE_GET_CLASS(ms);
>  
> -    if (mem_path && kvm_s390_configure_mempath_backing(s)) {
> +    if (kvm_s390_configure_mempath_backing(s)) {
>          return -EINVAL;
>      }
>  
>
diff mbox series

Patch

diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c
index 2ebf26a..90766fa 100644
--- a/target/s390x/kvm.c
+++ b/target/s390x/kvm.c
@@ -287,7 +287,7 @@  void kvm_s390_crypto_reset(void)
 
 static int kvm_s390_configure_mempath_backing(KVMState *s)
 {
-    size_t path_psize = qemu_mempath_getpagesize(mem_path);
+    size_t path_psize = qemu_getrampagesize();
 
     if (path_psize == 4 * KiB) {
         return 0;
@@ -319,7 +319,7 @@  int kvm_arch_init(MachineState *ms, KVMState *s)
 {
     MachineClass *mc = MACHINE_GET_CLASS(ms);
 
-    if (mem_path && kvm_s390_configure_mempath_backing(s)) {
+    if (kvm_s390_configure_mempath_backing(s)) {
         return -EINVAL;
     }