From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38668) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bYEGz-0007Su-KB for qemu-devel@nongnu.org; Fri, 12 Aug 2016 11:21:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bYEGy-0002R3-KM for qemu-devel@nongnu.org; Fri, 12 Aug 2016 11:21:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50058) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bYEGy-0002Ql-Eo for qemu-devel@nongnu.org; Fri, 12 Aug 2016 11:21:24 -0400 Date: Fri, 12 Aug 2016 17:22:58 +0800 From: Peter Xu Message-ID: <20160812092258.GX4793@pxdev.xzpeter.org> References: <1470922183-22873-1-git-send-email-peterx@redhat.com> <3cd53f4a-217a-74f8-9852-84f1045859fd@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <3cd53f4a-217a-74f8-9852-84f1045859fd@redhat.com> Subject: Re: [Qemu-devel] [PATCH] intel_iommu: add "eim" property List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org, imammedo@redhat.com, rth@twiddle.net, ehabkost@redhat.com, mst@redhat.com, jan.kiszka@web.de, rkrcmar@redhat.com, davidkiarie4@gmail.com On Fri, Aug 12, 2016 at 10:34:44AM +0200, Paolo Bonzini wrote: > > > On 11/08/2016 15:29, Peter Xu wrote: > > + > > +static void vtd_eim_prop_set(Object *o, bool value, Error **errp) > > +{ > > + IntelIOMMUState *s = INTEL_IOMMU_DEVICE(o); > > + s->eim_supported = value; > > +} > > + > > +static void vtd_instance_init(Object *o) > > +{ > > + IntelIOMMUState *s = INTEL_IOMMU_DEVICE(o); > > + > > + /* > > + * TODO: we can enable this by default after we have full x2apic > > + * support. > > + */ > > + s->eim_supported = false; > > + object_property_add_bool(o, "eim", vtd_eim_prop_get, > > + vtd_eim_prop_set, NULL); > > +} > > + > > static const TypeInfo vtd_info = { > > .name = TYPE_INTEL_IOMMU_DEVICE, > > .parent = TYPE_X86_IOMMU_DEVICE, > > + .instance_init = vtd_instance_init, > > This can use DEFINE_PROP_BOOL. Right. Will post v2. Thanks! -- peterx