qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v5 11/17] target-s390x: Add KVM VM attribute int


From: Christian Borntraeger
Subject: Re: [Qemu-devel] [PATCH v5 11/17] target-s390x: Add KVM VM attribute interface for S390 CPU models
Date: Mon, 27 Apr 2015 10:15:47 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0

Am 13.04.2015 um 15:56 schrieb Michael Mueller:
[...]
> +static int cpu_model_get(KVMState *s, uint64_t attr, uint64_t addr)
> +{
> +    int rc = -ENOSYS;
> +    struct kvm_device_attr dev_attr = {
> +        .group = KVM_S390_VM_CPU_MODEL,
> +        .attr = attr,
> +        .addr = addr,

Would it make sense to do the cast here....
> +    };
> +
> +    if (kvm_vm_check_attr(s, dev_attr.group, dev_attr.attr)) {
> +        rc = kvm_vm_ioctl(s, KVM_GET_DEVICE_ATTR, &dev_attr);
> +    }
> +
> +    return rc;
> +}
> +
> +static int cpu_model_set(KVMState *s, uint64_t attr, uint64_t addr)
> +{
> +    int rc = -ENOSYS;
> +    struct kvm_device_attr dev_attr = {
> +        .group = KVM_S390_VM_CPU_MODEL,
> +        .attr = attr,
> +        .addr = addr,

...and here...

> +    };
> +
> +    if (kvm_vm_check_attr(s, dev_attr.group, dev_attr.attr)) {
> +        rc = kvm_vm_ioctl(s, KVM_SET_DEVICE_ATTR, &dev_attr);
> +    }
> +
> +    return rc;
> +}
> +
> +static int kvm_s390_get_machine_props(KVMState *s, S390MachineProps *prop)
> +{
> +    int rc = -EFAULT;
> +
> +    if (s) {
> +        rc = cpu_model_get(s, KVM_S390_VM_CPU_MACHINE, (uint64_t) prop);

and pass S390MachineProps as 3rd parameter?


> +int kvm_s390_get_processor_props(S390ProcessorProps *prop)
> +{
> +    int rc;
> +
> +    rc = cpu_model_get(kvm_state, KVM_S390_VM_CPU_PROCESSOR, (uint64_t) 
> prop);

dito
> +    trace_kvm_get_processor_props(rc, prop->cpuid, prop->ibc);
> +    return rc;
> +}
> +
> +int kvm_s390_set_processor_props(S390ProcessorProps *prop)
> +{
> +    int rc;
> +
> +    rc = cpu_model_set(kvm_state, KVM_S390_VM_CPU_PROCESSOR, (uint64_t) 
> prop);

dito




reply via email to

[Prev in Thread] Current Thread [Next in Thread]