On Wed, Jun 28, 2023 at 12:53:34PM +0200, Michal Privoznik wrote:
These are RFC patches. I'd like to start a discussion on the
following
problem:
We need to decide if we want to inform users in the live XML that the
MAC changed (no matter the setting of trustGuestRxFilters), idea below.
We could then add a flag to virDomainInterfaceAddresses() that switches
to the other MAC address.
A mgmt application has info tied to an <interface/> (stored
elsewhere,
not important right now). And they use basically the only piece of
information that's visible in both host and guest: MAC address. No, user
aliases are not visible in the guest. Therefore, when they query the
guest-agent (e.g. via 'virsh domifaddr --source agent') they can
reconstruct their knowledge on NICs.
But there's a catch - if user decides to change MAC address form inside
of the VM. Then the only link between host and guest is broken.
Now, we could make the guest-agent report both current and permanent MAC
address. But unfortunately, libvirt's virDomainInterfaceAddresses() is
not prepared for that.
Now, I don't recall why we decided to not update MAC address in the live
XML on change, but maybe somebody else does. Or we can pass the event
from QEMU to the mgmt application so that it can update its state.
Could that be that referring to the interface would be troublesome? Can
we add something like "current MAC address" in case it was changed?
Michal Prívozník (3):
qemu: Reflect MAC address change in live domain XML
Introduce NIC_MAC_CHANGE event
qemu: Emit NIC_MAC_CHANGE event
examples/c/misc/event-test.c | 14 +++++
include/libvirt/libvirt-domain.h | 28 +++++++++
src/conf/domain_event.c | 93 +++++++++++++++++++++++++++++
src/conf/domain_event.h | 12 ++++
src/libvirt_private.syms | 2 +
src/qemu/qemu_domain.c | 34 ++++++++++-
src/qemu/qemu_domain.h | 3 +-
src/qemu/qemu_driver.c | 11 ++--
src/qemu/qemu_process.c | 2 +-
src/remote/remote_daemon_dispatch.c | 32 ++++++++++
src/remote/remote_driver.c | 34 +++++++++++
src/remote/remote_protocol.x | 17 +++++-
tools/virsh-domain-event.c | 20 +++++++
13 files changed, 294 insertions(+), 8 deletions(-)
--
2.39.3