Add `wait_ready` nic config keys for IPv4/IPv6 routes
Now that we have the ready status for instances, it would be very convenient if we could make the ipv4.routes.external and ipv6.routes.external to be conditional on the instance being in a ready state.
Easiest would be to introduce ipv4.routes.external.wait_ready and ipv6.routes.external.wait_ready or similar and add logic so when the instance goes to the ready state, those routes get added (either to the host or BGP) and if the instance is to revert to running state, those routes should be pulled.
This would then allow services to put a post-start/pre-stop action which will set or unset the ready state, making it so no traffic is dispatched to an instance which isn't ready for it.
@tomponline thoughts?
@stgraber yes I think we could use the device's Register() function (which is already used to initialise bgp routes for running instances on LXD startup) to also register for notification by instance state changes (similar to what unixRegisterHandler() and unixHotplugRegisterHandler() do for those respective device types).