Received: from eggs.gnu.org ([2001:4830:134:3::10]:52993) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bYDUg-0005BV-7M for qemu-devel@nongnu.org; Fri, 12 Aug 2016 10:31:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bYDUZ-0002zD-JV for qemu-devel@nongnu.org; Fri, 12 Aug 2016 10:31:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49850) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bYDUZ-0002yo-Dc for qemu-devel@nongnu.org; Fri, 12 Aug 2016 10:31:23 -0400 References: <1470922183-22873-1-git-send-email-peterx@redhat.com> From: Paolo Bonzini Message-ID: <3cd53f4a-217a-74f8-9852-84f1045859fd@redhat.com> Date: Fri, 12 Aug 2016 10:34:44 +0200 MIME-Version: 1.0 In-Reply-To: <1470922183-22873-1-git-send-email-peterx@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] intel_iommu: add "eim" property List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Xu , qemu-devel@nongnu.org Cc: imammedo@redhat.com, rth@twiddle.net, ehabkost@redhat.com, mst@redhat.com, jan.kiszka@web.de, rkrcmar@redhat.com, davidkiarie4@gmail.com 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. Paolo