qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Jones <drjones@redhat.com>
To: Peter Xu <peterx@redhat.com>
Cc: wei@redhat.com, peter.maydell@linaro.org, armbru@redhat.com,
	qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com,
	qemu-arm@nongnu.org, abologna@redhat.com
Subject: Re: [Qemu-devel] [PATCH v3 3/3] arm: implement query-gic-capability
Date: Mon, 7 Mar 2016 08:38:13 +0100	[thread overview]
Message-ID: <20160307073813.GB1865@localhost.redhat.com> (raw)
In-Reply-To: <20160307053824.GB7438@pxdev.xzpeter.org>

On Mon, Mar 07, 2016 at 01:38:24PM +0800, Peter Xu wrote:
> On Mon, Mar 07, 2016 at 06:12:38AM +0100, Andrew Jones wrote:
> > On Mon, Mar 07, 2016 at 12:23:28PM +0800, Peter Xu wrote:
> > > +#ifdef CONFIG_KVM
> > > +/*
> > > + * This is merely the same as kvm_create_device(). The only
> > > + * difference is we are using raw fds rather than KVMState, so that
> > > + * we can use it even without kvm_state initialized.
> > > + */
> > > +static int kvm_create_device_fds(int kvm_fd, int vmfd,
> > > +                                 uint64_t type, bool test)
> > 
> > I don't think we need this helper function. Who else will call it?
> > Particularly without test==true? Anyway, I think three ioctls directly
> > called from qmp_query_gic_capability should be OK.
> 
> Right. However, I would still consider using a helper function if
> you would not mind. E.g, how about this:

Fine by me.

Thanks,
drew

> 
> #ifdef CONFIG_KVM
> /* Test whether KVM support specific device. */
> static inline int kvm_support_device(int vmfd, uint64_t type)
> {
>     struct kvm_create_device create_dev = {
>         .type = type,
>         .fd = -1,
>         .flags = KVM_CREATE_DEVICE_TEST,
>     };
>     return ioctl(vmfd, KVM_CREATE_DEVICE, &create_dev);
> }
> #endif
> 
> Thanks.
> Peter
> 

  reply	other threads:[~2016-03-07  7:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-07  4:23 [Qemu-devel] [PATCH v3 0/3] ARM: add query-gic-capability SMP command Peter Xu
2016-03-07  4:23 ` [Qemu-devel] [PATCH v3 1/3] arm: qmp: add GICCapability struct Peter Xu
2016-03-07  4:23 ` [Qemu-devel] [PATCH v3 2/3] arm: qmp: add query-gic-capability interface Peter Xu
2016-03-07  4:23 ` [Qemu-devel] [PATCH v3 3/3] arm: implement query-gic-capability Peter Xu
2016-03-07  5:12   ` Andrew Jones
2016-03-07  5:38     ` Peter Xu
2016-03-07  7:38       ` Andrew Jones [this message]
2016-03-07  9:55 ` [Qemu-devel] [PATCH v3 0/3] ARM: add query-gic-capability SMP command Andrea Bolognani
2016-03-08  5:20   ` Peter Xu

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=20160307073813.GB1865@localhost.redhat.com \
    --to=drjones@redhat.com \
    --cc=abologna@redhat.com \
    --cc=armbru@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=peter.maydell@linaro.org \
    --cc=peterx@redhat.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=wei@redhat.com \
    /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).