All of lore.kernel.org
 help / color / mirror / Atom feed
* Can xenfv-4.2 be removed nowadays?
@ 2026-11-27 15:45 Thomas Huth
  2026-12-01  0:28 ` Stefano Stabellini
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Huth @ 2026-11-27 15:45 UTC (permalink / raw)
  To: QEMU Developers, Stefano Stabellini, Edgar E. Iglesias,
	Anthony PERARD
  Cc: Daniel P. Berrange


  Hi!

As you might know, since a couple of releases, QEMU has the policy to treat 
all versioned machine types older than 6 years as obsolete and disables them 
automatically. The code then can be removed.

This week, I started looking into removing the code of the old pc-q35-4.2 
and pc-i440fx-4.2 machine types - but I got stuck with the "xenfv-4.2" 
machine since this is still calling the pc_i440fx_machine_4_2_options() 
function.

Being a Xen ignorant, this was quite confusing for me: Why is there this old 
"xenfv-4.2" machine, but not a newer one? Is it still used, or could it be 
removed nowadays, too? Or if it could not get removed completely, could it 
get replaced by a newer variant or non-versioned machine type instead?

  Thomas



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Can xenfv-4.2 be removed nowadays?
  2026-11-27 15:45 Can xenfv-4.2 be removed nowadays? Thomas Huth
@ 2026-12-01  0:28 ` Stefano Stabellini
  2026-12-01  9:09   ` Thomas Huth
  2026-12-01  9:33   ` Daniel P. Berrangé
  0 siblings, 2 replies; 7+ messages in thread
From: Stefano Stabellini @ 2026-12-01  0:28 UTC (permalink / raw)
  To: Thomas Huth
  Cc: QEMU Developers, Stefano Stabellini, Edgar E. Iglesias,
	Anthony PERARD, Daniel P. Berrange, xen-devel

+xen-devel

On Fri, 27 Nov 2026, Thomas Huth wrote:
>  Hi!
> 
> As you might know, since a couple of releases, QEMU has the policy to treat
> all versioned machine types older than 6 years as obsolete and disables them
> automatically. The code then can be removed.
> 
> This week, I started looking into removing the code of the old pc-q35-4.2 and
> pc-i440fx-4.2 machine types - but I got stuck with the "xenfv-4.2" machine
> since this is still calling the pc_i440fx_machine_4_2_options() function.
> 
> Being a Xen ignorant, this was quite confusing for me: Why is there this old
> "xenfv-4.2" machine, but not a newer one? Is it still used, or could it be
> removed nowadays, too? Or if it could not get removed completely, could it get
> replaced by a newer variant or non-versioned machine type instead?

Upstream Xen (libxl) does not use versioned machine types: it always
passes "-machine xenfv". From that point of view, xenfv-4.2 as such
could be removed.

However, since the removal of xenfv-3.1, "xenfv" is an alias of
xenfv-4.2 (see 6ccf1e73fc). If we remove xenfv-4.2, "xenfv" goes away
with it and HVM guests started by libxl fail with:

  qemu-system-i386: unsupported machine type: "xenfv"

So xenfv-4.2 cannot simply be dropped, but we could turn it into a
non-versioned machine type. It would need to keep the current 4.2
properties so that live migration and save/restore of existing guests
keep working.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Can xenfv-4.2 be removed nowadays?
  2026-12-01  0:28 ` Stefano Stabellini
@ 2026-12-01  9:09   ` Thomas Huth
  2026-12-01  9:33   ` Daniel P. Berrangé
  1 sibling, 0 replies; 7+ messages in thread
From: Thomas Huth @ 2026-12-01  9:09 UTC (permalink / raw)
  To: Stefano Stabellini
  Cc: QEMU Developers, Edgar E. Iglesias, Anthony PERARD,
	Daniel P. Berrange, xen-devel, Paolo Bonzini, Michael S. Tsirkin

Am 01.12.26 um 01:28 schrieb Stefano Stabellini:
> +xen-devel
> 
> On Fri, 27 Nov 2026, Thomas Huth wrote:
>>   Hi!
>>
>> As you might know, since a couple of releases, QEMU has the policy to treat
>> all versioned machine types older than 6 years as obsolete and disables them
>> automatically. The code then can be removed.
>>
>> This week, I started looking into removing the code of the old pc-q35-4.2 and
>> pc-i440fx-4.2 machine types - but I got stuck with the "xenfv-4.2" machine
>> since this is still calling the pc_i440fx_machine_4_2_options() function.
>>
>> Being a Xen ignorant, this was quite confusing for me: Why is there this old
>> "xenfv-4.2" machine, but not a newer one? Is it still used, or could it be
>> removed nowadays, too? Or if it could not get removed completely, could it get
>> replaced by a newer variant or non-versioned machine type instead?
> 
> Upstream Xen (libxl) does not use versioned machine types: it always
> passes "-machine xenfv". From that point of view, xenfv-4.2 as such
> could be removed.
> 
> However, since the removal of xenfv-3.1, "xenfv" is an alias of
> xenfv-4.2 (see 6ccf1e73fc). If we remove xenfv-4.2, "xenfv" goes away
> with it and HVM guests started by libxl fail with:
> 
>    qemu-system-i386: unsupported machine type: "xenfv"
> 
> So xenfv-4.2 cannot simply be dropped, but we could turn it into a
> non-versioned machine type. It would need to keep the current 4.2
> properties so that live migration and save/restore of existing guests
> keep working.

Uh, that's not how machine types are supposed to work in QEMU. We don't have 
any migration guarantees for non-versioned machine type. Actually, migration 
compatibility is exactly the reason for having versioned machine types. So 
we cannot simply drop the "-4.2" suffix here and guarantee that the machine 
type will stay stable!

So I think you should introduce a newer xenfv-12.0 machine type in the next 
release cycle, and make sure that Xen is using that one for the next couple 
of years (instead of relying on the non-versioned alias). Then, after some 
grace period, we should finally remove the xenfv-4.2 machine type and the 
old compat stuff from QEMU. WDYT?

  Thomas




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Can xenfv-4.2 be removed nowadays?
  2026-12-01  0:28 ` Stefano Stabellini
  2026-12-01  9:09   ` Thomas Huth
@ 2026-12-01  9:33   ` Daniel P. Berrangé
  2026-12-02 23:27     ` Stefano Stabellini
  1 sibling, 1 reply; 7+ messages in thread
From: Daniel P. Berrangé @ 2026-12-01  9:33 UTC (permalink / raw)
  To: Stefano Stabellini
  Cc: Thomas Huth, QEMU Developers, Edgar E. Iglesias, Anthony PERARD,
	xen-devel

On Mon, Nov 30, 2026 at 04:28:12PM -0800, Stefano Stabellini wrote:
> +xen-devel
> 
> On Fri, 27 Nov 2026, Thomas Huth wrote:
> >  Hi!
> > 
> > As you might know, since a couple of releases, QEMU has the policy to treat
> > all versioned machine types older than 6 years as obsolete and disables them
> > automatically. The code then can be removed.
> > 
> > This week, I started looking into removing the code of the old pc-q35-4.2 and
> > pc-i440fx-4.2 machine types - but I got stuck with the "xenfv-4.2" machine
> > since this is still calling the pc_i440fx_machine_4_2_options() function.
> > 
> > Being a Xen ignorant, this was quite confusing for me: Why is there this old
> > "xenfv-4.2" machine, but not a newer one? Is it still used, or could it be
> > removed nowadays, too? Or if it could not get removed completely, could it get
> > replaced by a newer variant or non-versioned machine type instead?
> 
> Upstream Xen (libxl) does not use versioned machine types: it always
> passes "-machine xenfv". From that point of view, xenfv-4.2 as such
> could be removed.
> 
> However, since the removal of xenfv-3.1, "xenfv" is an alias of
> xenfv-4.2 (see 6ccf1e73fc). If we remove xenfv-4.2, "xenfv" goes away
> with it and HVM guests started by libxl fail with:
> 
>   qemu-system-i386: unsupported machine type: "xenfv"
> 
> So xenfv-4.2 cannot simply be dropped, but we could turn it into a
> non-versioned machine type. It would need to keep the current 4.2
> properties so that live migration and save/restore of existing guests
> keep working.

If it needs to keep ABI compat with 4.2, then that is defacto
a versioned machine type, whether it is used via the alias or
not. Effectively Xen has been relying on the fact that no one
would add a 'xenfv-11.2' and change 'xenfv' alias to point
to that.


What was the criteria for deciding to switch from xenfv-3.1 to
xenfv-4.2, and can be it repeated to get onto something less
ancient ?

Outside this xenfv machine, every versioned machine gets a new
version added in every release.

Each version, gets a 6 year lifetime before it is automatically
deleted. We decided 6 years was sufficiently long for live
migration compatibility between platform upgrades, without an
intervening cold reboot of a VM.


QEMU only wants to promise ABI compatibility for versioned
machines that are following this scheme, but we've unfortunately
overlooked xenfv-4.2 which wasn't using any of our macros for
defining versions, as it was just hardcoded at a fixed version.

Being able to purge old versions is important for QEMU's ability
to drop historical technical debt, so we really don't want to get
fixated on an ancient version that can never be changed forever.
For every other versioned machine our current oldest version is
already raised to 6.0.


More generally though, I'm wondering if the 'xenfv' machine type
really needs to exist though ?

Compared to the regular i440fx machine type the only differences
appear to be

    m->max_cpus = HVM_MAX_VCPUS;
    m->default_machine_opts = "accel=xen,suppress-vmdesc=on";

The default_machine_opts are just syntax sugar, iow, from an machine
ABI point of view

   -M xenfv-4.2

would be functionally identical to

   -M pc-i440fx-4.2,suppress-vmdesc=on  -accel xen

The 'max_cpus' field is used to provide error checking on the -smp
value, and I would have thought the Xen mgmt tools would already
sanity check the CPU count before launching QEMU.

Unless I'm missing something else that's significant about 'xenfv',
it feels like it is redundant and the Xen tools could be updated
to use the standard pc-i440fx machine types, allowing us to phase
out 'xenfv', after a suitable time has passed to allow updated
Xen tools to deploy across the ecosystem.

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 :|



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Can xenfv-4.2 be removed nowadays?
  2026-12-01  9:33   ` Daniel P. Berrangé
@ 2026-12-02 23:27     ` Stefano Stabellini
  2026-12-03  7:32       ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 7+ messages in thread
From: Stefano Stabellini @ 2026-12-02 23:27 UTC (permalink / raw)
  To: Daniel P. Berrangé
  Cc: Stefano Stabellini, Thomas Huth, QEMU Developers,
	Edgar E. Iglesias, Anthony PERARD, xen-devel

[-- Attachment #1: Type: text/plain, Size: 4469 bytes --]

On Tue, 1 Dec 2026, Daniel P. Berrangé wrote:
> On Mon, Nov 30, 2026 at 04:28:12PM -0800, Stefano Stabellini wrote:
> > +xen-devel
> > 
> > On Fri, 27 Nov 2026, Thomas Huth wrote:
> > >  Hi!
> > > 
> > > As you might know, since a couple of releases, QEMU has the policy to treat
> > > all versioned machine types older than 6 years as obsolete and disables them
> > > automatically. The code then can be removed.
> > > 
> > > This week, I started looking into removing the code of the old pc-q35-4.2 and
> > > pc-i440fx-4.2 machine types - but I got stuck with the "xenfv-4.2" machine
> > > since this is still calling the pc_i440fx_machine_4_2_options() function.
> > > 
> > > Being a Xen ignorant, this was quite confusing for me: Why is there this old
> > > "xenfv-4.2" machine, but not a newer one? Is it still used, or could it be
> > > removed nowadays, too? Or if it could not get removed completely, could it get
> > > replaced by a newer variant or non-versioned machine type instead?
> > 
> > Upstream Xen (libxl) does not use versioned machine types: it always
> > passes "-machine xenfv". From that point of view, xenfv-4.2 as such
> > could be removed.
> > 
> > However, since the removal of xenfv-3.1, "xenfv" is an alias of
> > xenfv-4.2 (see 6ccf1e73fc). If we remove xenfv-4.2, "xenfv" goes away
> > with it and HVM guests started by libxl fail with:
> > 
> >   qemu-system-i386: unsupported machine type: "xenfv"
> > 
> > So xenfv-4.2 cannot simply be dropped, but we could turn it into a
> > non-versioned machine type. It would need to keep the current 4.2
> > properties so that live migration and save/restore of existing guests
> > keep working.
> 
> If it needs to keep ABI compat with 4.2, then that is defacto
> a versioned machine type, whether it is used via the alias or
> not. Effectively Xen has been relying on the fact that no one
> would add a 'xenfv-11.2' and change 'xenfv' alias to point
> to that.

Yes, I think that is a fair point
 
 
> What was the criteria for deciding to switch from xenfv-3.1 to
> xenfv-4.2, and can be it repeated to get onto something less
> ancient ?

Honestly even I don't remember how it happened back then. But yes I
think we could upgrade to something less ancient.


> Outside this xenfv machine, every versioned machine gets a new
> version added in every release.
> 
> Each version, gets a 6 year lifetime before it is automatically
> deleted. We decided 6 years was sufficiently long for live
> migration compatibility between platform upgrades, without an
> intervening cold reboot of a VM.

Seems reasonable

 
> QEMU only wants to promise ABI compatibility for versioned
> machines that are following this scheme, but we've unfortunately
> overlooked xenfv-4.2 which wasn't using any of our macros for
> defining versions, as it was just hardcoded at a fixed version.
> 
> Being able to purge old versions is important for QEMU's ability
> to drop historical technical debt, so we really don't want to get
> fixated on an ancient version that can never be changed forever.
> For every other versioned machine our current oldest version is
> already raised to 6.0.

I see your point


 
> More generally though, I'm wondering if the 'xenfv' machine type
> really needs to exist though ?
> 
> Compared to the regular i440fx machine type the only differences
> appear to be
> 
>     m->max_cpus = HVM_MAX_VCPUS;
>     m->default_machine_opts = "accel=xen,suppress-vmdesc=on";
> 
> The default_machine_opts are just syntax sugar, iow, from an machine
> ABI point of view
> 
>    -M xenfv-4.2
> 
> would be functionally identical to
> 
>    -M pc-i440fx-4.2,suppress-vmdesc=on  -accel xen
> 
> The 'max_cpus' field is used to provide error checking on the -smp
> value, and I would have thought the Xen mgmt tools would already
> sanity check the CPU count before launching QEMU.
> 
> Unless I'm missing something else that's significant about 'xenfv',
> it feels like it is redundant and the Xen tools could be updated
> to use the standard pc-i440fx machine types, allowing us to phase
> out 'xenfv', after a suitable time has passed to allow updated
> Xen tools to deploy across the ecosystem.

Yes it looks that way to me as well


> 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 :|
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Can xenfv-4.2 be removed nowadays?
  2026-12-02 23:27     ` Stefano Stabellini
@ 2026-12-03  7:32       ` Philippe Mathieu-Daudé
  2026-12-03  9:09         ` Daniel P. Berrangé
  0 siblings, 1 reply; 7+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-12-03  7:32 UTC (permalink / raw)
  To: Daniel P. Berrangé
  Cc: Stefano Stabellini, Thomas Huth, QEMU Developers,
	Edgar E. Iglesias, Anthony PERARD, xen-devel

On 3/12/26 00:27, Stefano Stabellini wrote:
> On Tue, 1 Dec 2026, Daniel P. Berrangé wrote:
>> On Mon, Nov 30, 2026 at 04:28:12PM -0800, Stefano Stabellini wrote:


>> Compared to the regular i440fx machine type the only differences
>> appear to be
>>
>>      m->max_cpus = HVM_MAX_VCPUS;
>>      m->default_machine_opts = "accel=xen,suppress-vmdesc=on";
>>
>> The default_machine_opts are just syntax sugar, iow, from an machine
>> ABI point of view
>>
>>     -M xenfv-4.2
>>
>> would be functionally identical to
>>
>>     -M pc-i440fx-4.2,suppress-vmdesc=on  -accel xen
>>
>> The 'max_cpus' field is used to provide error checking on the -smp
>> value, and I would have thought the Xen mgmt tools would already
>> sanity check the CPU count before launching QEMU.
>>
>> Unless I'm missing something else that's significant about 'xenfv',
>> it feels like it is redundant and the Xen tools could be updated
>> to use the standard pc-i440fx machine types, allowing us to phase
>> out 'xenfv', after a suitable time has passed to allow updated
>> Xen tools to deploy across the ecosystem.

- TYPE_IGD_PASSTHROUGH_I440FX_PCI_DEVICE is used when
   xen_igd_gfx_pt_enabled() is true,
- xen_igd_reserve_slot(pcms->pcibus) called,
- pci_create_simple(pcms->pcibus, -1, "xen-platform") called.

We need to add "-device xen-platform" to the new command line.

No clue how to setup the IGD passthrough host bridge / slot reservation.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Can xenfv-4.2 be removed nowadays?
  2026-12-03  7:32       ` Philippe Mathieu-Daudé
@ 2026-12-03  9:09         ` Daniel P. Berrangé
  0 siblings, 0 replies; 7+ messages in thread
From: Daniel P. Berrangé @ 2026-12-03  9:09 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Stefano Stabellini, Thomas Huth, QEMU Developers,
	Edgar E. Iglesias, Anthony PERARD, xen-devel

On Thu, Dec 03, 2026 at 08:32:56AM +0100, Philippe Mathieu-Daudé wrote:
> On 3/12/26 00:27, Stefano Stabellini wrote:
> > On Tue, 1 Dec 2026, Daniel P. Berrangé wrote:
> > > On Mon, Nov 30, 2026 at 04:28:12PM -0800, Stefano Stabellini wrote:
> 
> 
> > > Compared to the regular i440fx machine type the only differences
> > > appear to be
> > > 
> > >      m->max_cpus = HVM_MAX_VCPUS;
> > >      m->default_machine_opts = "accel=xen,suppress-vmdesc=on";
> > > 
> > > The default_machine_opts are just syntax sugar, iow, from an machine
> > > ABI point of view
> > > 
> > >     -M xenfv-4.2
> > > 
> > > would be functionally identical to
> > > 
> > >     -M pc-i440fx-4.2,suppress-vmdesc=on  -accel xen
> > > 
> > > The 'max_cpus' field is used to provide error checking on the -smp
> > > value, and I would have thought the Xen mgmt tools would already
> > > sanity check the CPU count before launching QEMU.
> > > 
> > > Unless I'm missing something else that's significant about 'xenfv',
> > > it feels like it is redundant and the Xen tools could be updated
> > > to use the standard pc-i440fx machine types, allowing us to phase
> > > out 'xenfv', after a suitable time has passed to allow updated
> > > Xen tools to deploy across the ecosystem.
> 
> - TYPE_IGD_PASSTHROUGH_I440FX_PCI_DEVICE is used when
>   xen_igd_gfx_pt_enabled() is true,

xen_igd_gfx_pt_enabled() returns true, if xen_igd_gfx_pt_set(true)
was called, which is wired up to use of "-accel xen"

> - xen_igd_reserve_slot(pcms->pcibus) called,
> - pci_create_simple(pcms->pcibus, -1, "xen-platform") called.
> 
> We need to add "-device xen-platform" to the new command line.
> 
> No clue how to setup the IGD passthrough host bridge / slot reservation.

Sigh, I got confused by fact that we have two methods with almost
identical names xen_hvm_init_pc() and pc_xen_hvm_init().

The former is called from pc_init1(), so gets wired up correctly
in any pc-piix* / pc-q35* machines.

The latter is only called from the 'xenfv' machine.

I'm wondering why the logic that's in pc_xen_hvm_init() can't be
moved into the pc_init1() method, and toggled from xen_enabled()
like all the other Xen functionality is. Are the pc-piix* machines
already being used by Xen in other scenarios perhaps, which don't
want the extra xen-platform device.

The alternative to eliminating xenfv is to setup the versioned
machines so that we just track the regular piix versioned machines
in some more reliably automated manner.

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 :|



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-12-03  9:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-27 15:45 Can xenfv-4.2 be removed nowadays? Thomas Huth
2026-12-01  0:28 ` Stefano Stabellini
2026-12-01  9:09   ` Thomas Huth
2026-12-01  9:33   ` Daniel P. Berrangé
2026-12-02 23:27     ` Stefano Stabellini
2026-12-03  7:32       ` Philippe Mathieu-Daudé
2026-12-03  9:09         ` Daniel P. Berrangé

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.