From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: Alexander Graf <graf@amazon.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
virtio-dev@lists.oasis-open.org, qemu-devel@nongnu.org
Cc: Lennart Poettering <mzxreary@0pointer.de>,
linux-kernel@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Babis Chalios <bchalios@amazon.es>, Theodore Ts'o <tytso@mit.edu>,
"Cali, Marco" <xmarcalx@amazon.co.uk>,
Arnd Bergmann <arnd@arndb.de>,
"rostedt@goodmis.org" <rostedt@goodmis.org>,
Christian Brauner <brauner@kernel.org>,
Paolo Bonzini <pbonzini@redhat.com>,
"Michael Kelley (LINUX)" <mikelley@microsoft.com>,
Sean Christopherson <seanjc@google.com>,
jann@thejh.net
Subject: vm events, userspace, the vmgenid driver, and the future [was: the uevent revert thread]
Date: Thu, 19 Sep 2024 00:27:57 +0200 [thread overview]
Message-ID: <ZutT7bArzCwW5yyf@zx2c4.com> (raw)
In-Reply-To: <84c3696d-8108-4a2e-90d7-7830ca6cc3b9@amazon.com>
[broadened subject line and added relevant parties to cc list]
On Tue, Sep 17, 2024 at 10:55:20PM +0200, Alexander Graf wrote:
> What is still open are user space applications that require event based
> notification on VM clone events - and *only* VM clone events. This
> mostly caters for tools like systemd which need to execute policy - such
> as generating randomly generated MAC addresses - in the event a VM was
> cloned.
>
> That's the use case this patch "vmgenid: emit uevent when VMGENID
> updates" is about and I think the best path forward is to just revert
> the revert. A uevent from the device driver is a well established, well
> fitting Linux mechanism for that type of notification.
The thing that worries me is that vmgenid is just some weird random
microsoft acpi driver. It's one sort of particular device, and not a
very good one at that. There's still room for virtio/qemu to improve on
it with their own thing, or for vbox or whatever else to have their
version, and xen theirs, and so forth. That is to say, I'm not sure that
this virtual hardware is *the* way of doing it.
Even in terms of the entropy stuff (which I know you no longer care
about, but I do), mst's original virtio-rng draft mentioned reporting
events beyond just VM forks, extending it generically to any kind of
entropy reduction situation. For example, migration or suspend or
whatever might be interesting things to trigger. Heck, one could imagine
those coming through vmgenid at some point, which would then change the
semantics you're after for systemd.
Even in terms of reporting exclusively about external VM events, there's
a subtle thing to consider between clones/forks and rollbacks, as well
as migrations. Vmgenid kind of lumps it all together, and hopefully the
hypervisor notifies in a way consistent with what userspace was hoping
to learn about. (Right now, maybe we're doing what Hyper-V does, maybe,
but also maybe not; it's kind of loose.) So at some point, there's a
question about the limitations of vmgenid and the possible extensions of
it, or whether this will come in a different driver or virtual hardware,
and how.
Right now, this is mostly unexplored. The virtio-rng avenue was largest
step in terms of exploring this problem space, but there are obviously a
few directions to go, depending on what your primary concern is.
But all of that makes me think that exposing the particulars of this
virtual hardware driver to userspace is not the best option, or at least
not an option to rush into (or to trick Greg into), and will both limit
what we can do with it later, and potentially burden userspace with
having to check multiple different things with confusing interactions
down the road. So I think it's worth stepping back a bit and thinking
about what we actually want from this and what those semantics should
be.
I'd also love to hear from the QEMU guys on this and get their input. To
that end, I've added qemu and virtio mailing lists, as well as mst.
Also, I'd be interested to learn specifically what you (Amazon) want
this for and what the larger picture there is. I get the systemd case,
but I'm under the assumption you've got a different project in your
woods.
Jason
next prev parent reply other threads:[~2024-09-18 22:28 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-18 11:48 [PATCH] Revert "vmgenid: emit uevent when VMGENID updates" Jason A. Donenfeld
2024-04-18 12:46 ` Greg Kroah-Hartman
2024-04-22 7:51 ` [REGRESSION] " Alexander Graf
2024-04-23 1:21 ` Jason A. Donenfeld
2024-04-23 6:56 ` Alexander Graf
2024-04-23 12:23 ` Lennart Poettering
2024-04-26 11:33 ` Alexander Graf
2024-04-26 12:52 ` Jason A. Donenfeld
2024-04-26 13:43 ` Babis Chalios
2024-04-26 20:05 ` Alexander Graf
2024-04-29 9:04 ` Lennart Poettering
2024-05-03 10:14 ` Babis Chalios
2024-06-13 16:37 ` Alexander Graf
2024-09-17 18:04 ` Jason A. Donenfeld
2024-09-17 20:55 ` Alexander Graf
2024-09-18 22:27 ` Jason A. Donenfeld [this message]
2024-09-18 23:02 ` vm events, userspace, the vmgenid driver, and the future [was: the uevent revert thread] Alexander Graf
2024-04-26 14:20 ` [REGRESSION] Re: [PATCH] Revert "vmgenid: emit uevent when VMGENID updates" Linux regression tracking (Thorsten Leemhuis)
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=ZutT7bArzCwW5yyf@zx2c4.com \
--to=jason@zx2c4.com \
--cc=arnd@arndb.de \
--cc=bchalios@amazon.es \
--cc=brauner@kernel.org \
--cc=graf@amazon.com \
--cc=gregkh@linuxfoundation.org \
--cc=jann@thejh.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mikelley@microsoft.com \
--cc=mst@redhat.com \
--cc=mzxreary@0pointer.de \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rostedt@goodmis.org \
--cc=seanjc@google.com \
--cc=tytso@mit.edu \
--cc=virtio-dev@lists.oasis-open.org \
--cc=xmarcalx@amazon.co.uk \
/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