[PATCH RFC 0/3] Reflect MAC change in live domain XML

Michal Privoznik mprivozn at redhat.com
Wed Jun 28 10:53:34 UTC 2023


These are RFC patches. I'd like to start a discussion on the following
problem:

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.

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



More information about the libvir-list mailing list