[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 4/6] s390x: Add I/O adapter registration.
From: |
Christian Borntraeger |
Subject: |
Re: [Qemu-devel] [PATCH 4/6] s390x: Add I/O adapter registration. |
Date: |
Wed, 26 Feb 2014 09:29:12 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 |
On 25/02/14 18:25, Cornelia Huck wrote:
> +int kvm_s390_io_adapter_map(uint32_t id, uint64_t map_addr, bool do_map)
> +{
> + struct kvm_s390_io_adapter_req req = {
> + .id = id,
> + .type = do_map ? KVM_S390_IO_ADAPTER_MAP : KVM_S390_IO_ADAPTER_UNMAP,
> + .addr = map_addr,
> + };
> + KVMS390FLICState *flic = s390_get_flic();
> + struct kvm_device_attr attr;
Can we use designated initializer for attr, e.g.
struct kvm_device_attr attr = {
.group = KVM_DEV_FLIC_ADAPTER_MODIFY,
.addr = (uint64_t)&req,
}
> + int r;
> +
> + if (!flic) {
> + return -ENOSYS;
> + }
> + if (!kvm_check_extension(kvm_state, KVM_CAP_IRQ_ROUTING)) {
> + return -ENOSYS;
> + }
> +
> + attr.group = KVM_DEV_FLIC_ADAPTER_MODIFY;
> + attr.addr = (uint64_t)&req;
and not do it here. That will zero out the other fields of attr.
Same for the register code.
Christian
- [Qemu-devel] [PATCH 0/6] qemu: irqfds for s390x, Cornelia Huck, 2014/02/25
- [Qemu-devel] [PATCH 2/6] linux-headers: add new interfaces, Cornelia Huck, 2014/02/25
- [Qemu-devel] [PATCH 1/6] s390x/virtio-ccw: Adapter interrupt support., Cornelia Huck, 2014/02/25
- [Qemu-devel] [PATCH 4/6] s390x: Add I/O adapter registration., Cornelia Huck, 2014/02/25
- Re: [Qemu-devel] [PATCH 4/6] s390x: Add I/O adapter registration.,
Christian Borntraeger <=
- [Qemu-devel] [PATCH 3/6] kvm: add kvm_enable_cap_{vm,vcpu}, Cornelia Huck, 2014/02/25
- [Qemu-devel] [PATCH 6/6] s390x/virtio-ccw: Wire up irq routing and irqfds., Cornelia Huck, 2014/02/25
- [Qemu-devel] [PATCH 5/6] s390x/virtio-ccw: reference-counted indicators, Cornelia Huck, 2014/02/25