This has been on my TODO list for a while, and Paul's since 2019. Having
converted the console driver just to get PV guests booting, I figured I
should do this one while I still remember how.
The fact that net_cleanup() frees my NIC from underneath me confused
me for a while. Not entirely sure what's going on there. Other devices
seem to survive just because they aren't cleaned up at exit. But XenBus
devices really should be properly cleaned up on exit, because in some
cases they leave detritus in XenStore, which outlives QEMU. So "Don't
Do That Then" doesn't seem like it's the answer.
The default NIC handling is horrid (I mean, before I even looked at it)
but that isn't today's yak to shave...
David Woodhouse (4):
hw/xen: only remove peers of PCI NICs on unplug
hw/xen: update Xen PV NIC to XenDevice model
[WTF] avoid qemu_del_nic() in xen_netdev_unrealize() on shutdown
hw/i386/pc: support '-nic' for xen-net-device
hw/i386/pc.c | 11 ++-
hw/i386/pc_piix.c | 2 +-
hw/i386/pc_q35.c | 2 +-
hw/i386/xen/xen_platform.c | 9 ++-
hw/net/meson.build | 2 +-
hw/net/trace-events | 9 +++
hw/net/xen_nic.c | 434 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------
hw/xen/xen-bus.c | 4 +-
hw/xenpv/xen_machine_pv.c | 1 -
include/hw/i386/pc.h | 4 +-
include/hw/xen/xen-bus.h | 2 +-
11 files changed, 373 insertions(+), 107 deletions(-)