diff mbox

[v3,for-2.11,02/18] s390x/kvm: drop KVMState parameter from kvm_s390_set_mem_limit()

Message ID 20170818114353.13455-3-david@redhat.com
State New
Headers show

Commit Message

David Hildenbrand Aug. 18, 2017, 11:43 a.m. UTC
Not needed at that point. Also drop it from kvm_s390_query_mem_limit()
we call in kvm_s390_set_mem_limit().

Signed-off-by: David Hildenbrand <david@redhat.com>
---
 target/s390x/cpu.h |  7 +++----
 target/s390x/kvm.c | 12 ++++++------
 2 files changed, 9 insertions(+), 10 deletions(-)

Comments

Thomas Huth Aug. 18, 2017, 3:39 p.m. UTC | #1
On 18.08.2017 13:43, David Hildenbrand wrote:
> Not needed at that point. Also drop it from kvm_s390_query_mem_limit()
> we call in kvm_s390_set_mem_limit().
> 
> Signed-off-by: David Hildenbrand <david@redhat.com>
> ---
>  target/s390x/cpu.h |  7 +++----
>  target/s390x/kvm.c | 12 ++++++------
>  2 files changed, 9 insertions(+), 10 deletions(-)

Reviewed-by: Thomas Huth <thuth@redhat.com>
diff mbox

Patch

diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h
index 44b1a7a..798e299 100644
--- a/target/s390x/cpu.h
+++ b/target/s390x/cpu.h
@@ -1169,7 +1169,7 @@  int kvm_s390_cmma_active(void);
 void kvm_s390_cmma_reset(void);
 int kvm_s390_set_cpu_state(S390CPU *cpu, uint8_t cpu_state);
 void kvm_s390_reset_vcpu(S390CPU *cpu);
-int kvm_s390_set_mem_limit(KVMState *s, uint64_t new_limit, uint64_t *hw_limit);
+int kvm_s390_set_mem_limit(uint64_t new_limit, uint64_t *hw_limit);
 void kvm_s390_vcpu_interrupt_pre_save(S390CPU *cpu);
 int kvm_s390_vcpu_interrupt_post_load(S390CPU *cpu);
 int kvm_s390_get_ri(void);
@@ -1215,8 +1215,7 @@  static inline int kvm_s390_set_cpu_state(S390CPU *cpu, uint8_t cpu_state)
 static inline void kvm_s390_reset_vcpu(S390CPU *cpu)
 {
 }
-static inline int kvm_s390_set_mem_limit(KVMState *s, uint64_t new_limit,
-                                         uint64_t *hw_limit)
+static inline int kvm_s390_set_mem_limit(uint64_t new_limit, uint64_t *hw_limit)
 {
     return 0;
 }
@@ -1243,7 +1242,7 @@  static inline void kvm_s390_crypto_reset(void)
 static inline int s390_set_memory_limit(uint64_t new_limit, uint64_t *hw_limit)
 {
     if (kvm_enabled()) {
-        return kvm_s390_set_mem_limit(kvm_state, new_limit, hw_limit);
+        return kvm_s390_set_mem_limit(new_limit, hw_limit);
     }
     return 0;
 }
diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c
index d0bb9e9..0e324ae 100644
--- a/target/s390x/kvm.c
+++ b/target/s390x/kvm.c
@@ -145,7 +145,7 @@  static int active_cmma;
 
 static void *legacy_s390_alloc(size_t size, uint64_t *align);
 
-static int kvm_s390_query_mem_limit(KVMState *s, uint64_t *memory_limit)
+static int kvm_s390_query_mem_limit(uint64_t *memory_limit)
 {
     struct kvm_device_attr attr = {
         .group = KVM_S390_VM_MEM_CTRL,
@@ -153,10 +153,10 @@  static int kvm_s390_query_mem_limit(KVMState *s, uint64_t *memory_limit)
         .addr = (uint64_t) memory_limit,
     };
 
-    return kvm_vm_ioctl(s, KVM_GET_DEVICE_ATTR, &attr);
+    return kvm_vm_ioctl(kvm_state, KVM_GET_DEVICE_ATTR, &attr);
 }
 
-int kvm_s390_set_mem_limit(KVMState *s, uint64_t new_limit, uint64_t *hw_limit)
+int kvm_s390_set_mem_limit(uint64_t new_limit, uint64_t *hw_limit)
 {
     int rc;
 
@@ -166,18 +166,18 @@  int kvm_s390_set_mem_limit(KVMState *s, uint64_t new_limit, uint64_t *hw_limit)
         .addr = (uint64_t) &new_limit,
     };
 
-    if (!kvm_vm_check_mem_attr(s, KVM_S390_VM_MEM_LIMIT_SIZE)) {
+    if (!kvm_vm_check_mem_attr(kvm_state, KVM_S390_VM_MEM_LIMIT_SIZE)) {
         return 0;
     }
 
-    rc = kvm_s390_query_mem_limit(s, hw_limit);
+    rc = kvm_s390_query_mem_limit(hw_limit);
     if (rc) {
         return rc;
     } else if (*hw_limit < new_limit) {
         return -E2BIG;
     }
 
-    return kvm_vm_ioctl(s, KVM_SET_DEVICE_ATTR, &attr);
+    return kvm_vm_ioctl(kvm_state, KVM_SET_DEVICE_ATTR, &attr);
 }
 
 int kvm_s390_cmma_active(void)