On Mon, Nov 16, 2026 at 01:25:36PM -0800, Pierrick Bouvier wrote:
> 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.

Yes, contrary to my commit message 'none' machine should
be set to QEMU_ARCH_ALL, so nothing should end up with
a value of '0' in the end.

> 
> > 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 },
> >          { }
> >      }
> >  };
> 

With regards,
Daniel
-- 
|: https://berrange.com       ~~        https://hachyderm.io/@berrange :|
|: https://libvirt.org          ~~          https://entangle-photo.org :|
|: https://pixelfed.art/berrange   ~~    https://fstop138.berrange.com :|


Reply via email to