I have a system where I spawn a single libvirt daemon process in the default network namespace.
Once the daemon is running, I create and start VMs using the virDomainDefineXML API (defines a VM or "domain” but does not boot it) followed by the virDomainCreate API (boot the VM).
Now, I am trying to create these VMs in generic network namespaces provided by the user e.g., /var/run/netns/<my-network-namespace>.
While searching the libvirt documentation (i.e.,
https://libvirt.org/formatdomain.html), I couldn't find any configuration options, which would support this network namespace specification via the domain XML APIs.
Is there any way to accomplish this with the domain XML APIs?
If not, what's the recommended approach to allow a libvirt client to request the libvirt server to create and boot VMs in distinct network namespaces?