From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Cornelia Huck <cornelia.huck@de.ibm.com>,
kvm@vger.kernel.org, linux-s390@vger.kernel.org,
qemu-devel@nongnu.org
Cc: gleb@kernel.org, pbonzini@redhat.com, agraf@suse.de
Subject: Re: [Qemu-devel] [PATCH 4/6] s390x: Add I/O adapter registration.
Date: Wed, 26 Feb 2014 09:29:12 +0100 [thread overview]
Message-ID: <530DA5D8.6040909@de.ibm.com> (raw)
In-Reply-To: <1393349120-18228-5-git-send-email-cornelia.huck@de.ibm.com>
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
next prev parent reply other threads:[~2014-02-26 8:29 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-25 17:25 [Qemu-devel] [PATCH 0/6] qemu: irqfds for s390x Cornelia Huck
2014-02-25 17:25 ` [Qemu-devel] [PATCH 1/6] s390x/virtio-ccw: Adapter interrupt support Cornelia Huck
2014-03-04 9:05 ` Cornelia Huck
2014-03-04 9:20 ` Christian Borntraeger
2014-02-25 17:25 ` [Qemu-devel] [PATCH 2/6] linux-headers: add new interfaces Cornelia Huck
2014-02-25 17:25 ` [Qemu-devel] [PATCH 3/6] kvm: add kvm_enable_cap_{vm,vcpu} Cornelia Huck
2014-02-25 17:25 ` [Qemu-devel] [PATCH 4/6] s390x: Add I/O adapter registration Cornelia Huck
2014-02-26 8:29 ` Christian Borntraeger [this message]
2014-02-26 8:37 ` Cornelia Huck
2014-02-25 17:25 ` [Qemu-devel] [PATCH 5/6] s390x/virtio-ccw: reference-counted indicators Cornelia Huck
2014-02-25 17:25 ` [Qemu-devel] [PATCH 6/6] s390x/virtio-ccw: Wire up irq routing and irqfds Cornelia Huck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=530DA5D8.6040909@de.ibm.com \
--to=borntraeger@de.ibm.com \
--cc=agraf@suse.de \
--cc=cornelia.huck@de.ibm.com \
--cc=gleb@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).