qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: "Peter Xu" <peterx@redhat.com>,
	qemu-devel@nongnu.org,
	"Dr . David Alan Gilbert" <dave@treblig.org>,
	"Cédric Le Goater" <clg@redhat.com>,
	"Jason Wang" <jasowang@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Fabiano Rosas" <farosas@suse.de>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Laurent Vivier" <lvivier@redhat.com>,
	"Michael S . Tsirkin" <mst@redhat.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Alexandr Moshkov" <dtalexundeer@yandex-team.ru>,
	"Vladimir Sementsov-Ogievskiy" <vsementsov@yandex-team.ru>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Thomas Huth" <thuth@redhat.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Juraj Marcin" <jmarcin@redhat.com>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Akihiko Odaki" <odaki@rsg.ci.i.u-tokyo.ac.jp>,
	"Eric Blake" <eblake@redhat.com>
Subject: Re: [PATCH RFC 00/10] QOM: Introduce OBJECT_COMPAT class
Date: Wed, 10 Dec 2025 11:52:04 +0000	[thread overview]
Message-ID: <aTle5C2pN8ZslZX7@redhat.com> (raw)
In-Reply-To: <aTlZIlgB20OpdSEl@redhat.com>

On Wed, Dec 10, 2025 at 12:27:30PM +0100, Kevin Wolf wrote:
> Am 09.12.2025 um 17:28 hat Peter Xu geschrieben:
> > [This is an RFC series, as being marked out.  It is trying to collect
> >  opinions.  It's not for merging yet]
> > 
> > Background
> > ==========
> > 
> > It all starts with machine compat properties..
> > 
> > Machine compat properties are the major weapon we use currently in QEMU to
> > define a proper guest ABI, so that whenever we migration a VM instance from
> > whatever QEMU version1 to another QEMU version2, as long as the machine
> > type is the same, logically the ABI is guaranteed, and migration should
> > succeed.  If it didn't, it's a bug.
> > 
> > These compat properties are only attached to qdev for now.  It almost
> > worked.
> > 
> > Said that, it's also not true - we already have non-qdev users of such, by
> > explicitly code it up to apply the compat fields.  Please refer to the
> > first patch commit message for details (meanwhile latter patches will
> > convert them into a generic model).
> > 
> > Obviously, we have demands to leverage machine compat properties even
> > outside of qdev.  It can be a network backend, it can be an object (for
> > example, memory backends), it can be a migration object, and more.
> 
> This doesn't feel obvious to me at all. A machine type defines what
> hardware the guest sees. Guest hardware is essentially qdev.
> 
> I don't see any reasons why a backend should be interested in what guest
> hardware looks like, that would seem like a bad layering violation. Many
> backends can even exist without a guest at all, and are also used in
> tools like qemu-storage-daemon. Having a machine type in a tool that
> doesn't run a guest doesn't make any sense.

The sev-guest compat property for 'legacy-vm-type' is an interesting
example.

This property ultimately controls which of two different kernel ioctls
for KVM are used for initializing the SEV guest. It can casue guest
VM measurement changes, but none the less this is not really a guest
ABI knob, it is a host kernel compatibility knob.  You need a newer
host kernel version if this is set to 'off'.

So by associating this legacy-vm-type type with the machine type,
we don't affect the guest hardware, but we *do* impact the ability
to use that machine type depedning on what kernel version you have.

IOW, QEMU machine types version 9.1 or later are no longer runnable
on many old kernels.

Over the years we've had a good number of occassions where we want
defaults changes, or worse, where we auto-negotiate features, which
depend on host kernel version.

I've suggested in the past that IMHO we're missing a concept of a
"versioned platform", to complement the "versioned machine" concept.

That would let mgmt apps decide what platform compatibility level
they required, independantly of choosing machine types, and so avoid
creating runability constraints on machine types.

> So if we do introduce some mechanism to provide different defaults for
> compatibility with older versions, it has to be separate from machine
> types.
> 
> Maybe it would make most sense to address this on the QAPI level then
> and finally fully QAPIfy the command line. Adding defaults to the QAPI
> schema is something that has come up again and again, so maybe we could
> introduce that and do it in a versioned way from the start.


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



  reply	other threads:[~2025-12-10 11:53 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-09 16:28 [PATCH RFC 00/10] QOM: Introduce OBJECT_COMPAT class Peter Xu
2025-12-09 16:28 ` [PATCH RFC 01/10] qom: Introduce object-compat Peter Xu
2025-12-09 16:28 ` [PATCH RFC 02/10] qdev: Inherit from TYPE_OBJECT_COMPAT Peter Xu
2025-12-09 16:28 ` [PATCH RFC 03/10] hostmem: " Peter Xu
2025-12-09 16:28 ` [PATCH RFC 04/10] accel: " Peter Xu
2025-12-09 16:28 ` [PATCH RFC 05/10] confidential guest support: " Peter Xu
2025-12-09 16:28 ` [PATCH RFC 06/10] qom: Unexport object_apply_compat_props() Peter Xu
2025-12-09 16:28 ` [PATCH RFC 07/10] qdev: Pave way for exporting Property to be used in non-qdev Peter Xu
2025-12-09 16:28 ` [PATCH RFC 08/10] qdev: Introduce helper object_apply_globals() Peter Xu
2025-12-09 16:28 ` [PATCH RFC 09/10] qdev: Refactor and rename of qdev_class_add_property() Peter Xu
2025-12-09 16:28 ` [PATCH RFC 10/10] migration: Inherit from TYPE_OBJECT_COMPAT Peter Xu
2025-12-10 11:27 ` [PATCH RFC 00/10] QOM: Introduce OBJECT_COMPAT class Kevin Wolf
2025-12-10 11:52   ` Daniel P. Berrangé [this message]
2025-12-10 16:17     ` Peter Xu
2025-12-10 18:25       ` Vladimir Sementsov-Ogievskiy
2025-12-10 20:15         ` Peter Xu
2025-12-11  9:48       ` Daniel P. Berrangé
2025-12-11 15:09         ` Peter Xu
2025-12-11 15:26           ` Daniel P. Berrangé
2025-12-11 16:05             ` Peter Xu
2025-12-11 15:28 ` Akihiko Odaki
2025-12-11 15:57   ` Peter Xu
2025-12-12  5:38     ` Akihiko Odaki
2025-12-11 16:29 ` Cédric Le Goater
2025-12-11 17:14   ` Peter Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aTle5C2pN8ZslZX7@redhat.com \
    --to=berrange@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=armbru@redhat.com \
    --cc=clg@redhat.com \
    --cc=dave@treblig.org \
    --cc=dtalexundeer@yandex-team.ru \
    --cc=eblake@redhat.com \
    --cc=farosas@suse.de \
    --cc=jasowang@redhat.com \
    --cc=jmarcin@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=mst@redhat.com \
    --cc=odaki@rsg.ci.i.u-tokyo.ac.jp \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=peterx@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=stefanha@redhat.com \
    --cc=thuth@redhat.com \
    --cc=vsementsov@yandex-team.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).