[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 01/21] qdev: Replace cannot_instantiate_with_
From: |
Eduardo Habkost |
Subject: |
Re: [Qemu-devel] [PATCH v2 01/21] qdev: Replace cannot_instantiate_with_device_add_yet with !user_creatable |
Date: |
Wed, 5 Apr 2017 18:25:12 -0300 |
User-agent: |
Mutt/1.7.1 (2016-10-04) |
Forgot to answer this part on my previous message:
On Wed, Apr 05, 2017 at 10:01:29PM +0300, Marcel Apfelbaum wrote:
[...]
> > When it was introduced, we had 54
> > cannot_instantiate_with_device_add_yet=true lines in the code.
> > Today (3 years later) this number has not shrinked: we now have
> > 57 cannot_instantiate_with_device_add_yet=true lines. I think it
> > is safe to say it is not a temporary measure, and we won't see
> > the flag go away soon.
> >
> > Instead of a long field name that misleads people to believe it
> > is temporary, replace it a shorter and less misleading field:
> > user_creatable.
>
> I completely agree with you. I never liked "negation" fields
> and especially the ones ending with "_yet".
>
> I also don't understand why "user_creatable" can't be used for white-listing
> *Q35*.
> I do understand that on some archs we need a white-list per board,
> but I don't think x86 needs it.
It's true that q35 wouldn't break if it simply used
user_creatable after applying this series. But it will break if
one day we link code that registers a user-creatable non-x86
device inside the qemu-system-x86_64 binary (even if by
accident), or if we add a new user-creatable sysbus device for
other x86 machines (e.g. isapc, xenfv, xenpv, pc-i440fx).
Maybe those situations are unlikely, but if we introduce common
infrastructure to let machine-types define their sysbus
whitelists[1], we get the ability to define the q35 whitelist for
free.
[1] See "[RFC 0/4] Replace has_dynamic_sysbus with device type whitelist"
--
Eduardo
[Qemu-devel] [PATCH v2 03/21] xen-backend: Remove FIXME comment about user_creatable flag, Eduardo Habkost, 2017/04/04
[Qemu-devel] [PATCH v2 04/21] iommu: Remove FIXME comment about user_creatable=true, Eduardo Habkost, 2017/04/04
[Qemu-devel] [PATCH v2 05/21] fdc: Remove user_creatable flag from sysbus-fdc & SUNW, fdtwo, Eduardo Habkost, 2017/04/04
[Qemu-devel] [PATCH v2 02/21] sysbus: Set user_creatable=false by default on TYPE_SYS_BUS_DEVICE, Eduardo Habkost, 2017/04/04