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