Folks,
I am working on upstreaming network support for ch driver. Like qemu driver,ch
driver invokes steps in qemuInterfaceEthernetConnect,
qemuInterfaceBridgeConnect methods to connect tap devices to appropriate
host backends.
Current implementation clones aboves methods to ch_interface files and
uses them. I'd like to drop driver specific args from above methods and
move them to a common place so that qemu and ch drivers can share above
methods.
int
virInterfaceEthernetConnect(virDomainDef *def,
virDomainNetDef *net,
ebtablesContext *ebtables,
bool macFilter,
bool privileged,
int *tapfd,
size_t tapfdSize)
I started with `qemuInterfaceEthernetConnect` and modified the signature as
shown above. I initially tried putting `virInterfaceEthernetConnect` in
'src/util' but that caused a lot of cross inclusions. Above definition pulls in
domain_conf.h, domain_nwfilter.h, domain_audit.h and more headers, into utils
which causes cross inclusion.
I later created interface/interface_connect.{c,h} files and moved the methods to
these files. This would require driver code to include
interface/interface_connect.h, which seemed better than above cross inclusion
scenario.
Do you see any issues with moving above methods to interface/interface_connect.x
files? Any other ideas on how to reorg above methods so that they can be shared
by qemu and ch drivers?
Praveen