s390x/kvm: drop KVMState parameter from kvm_s390_set_mem_limit()
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> Message-Id: <20170818114353.13455-3-david@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
This commit is contained in:
parent
fba5f6feba
commit
708f99c366
@ -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;
|
||||
}
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user