On 11/12/2026 5:30 AM, Daniel P. Berrangé wrote:
> The Machine base class implements TYPE_TARGET_SPECIFIC since
> its children will almost all be target specific.
> 
> When the 'targets' field is set to a non-zero value on a
> machine type, it will block creation of an instance of the
> machine unless the current selected target matches. This
> allows the current 'is_available' callback to be removed.
> 
> Eventually only the 'none' machine is likely to leave the
> 'targets' field set to 0, since it is universally creatable.
>

Once all machines are correctly tagged per target, maybe we could simply
forbid having 0.

> Signed-off-by: Daniel P. Berrangé <[email protected]>
> ---
>  hw/core/machine.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/core/machine.c b/hw/core/machine.c
> index f7406537aa7..8692365ce89 100644
> --- a/hw/core/machine.c
> +++ b/hw/core/machine.c
> @@ -1804,6 +1804,7 @@ static const TypeInfo machine_info = {
>      .instance_finalize = machine_finalize,
>      .interfaces = (const InterfaceInfo[]) {
>          { TYPE_ALIASED },
> +        { TYPE_TARGET_SPECIFIC },
>          { }
>      }
>  };


Reply via email to