mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-11-02 11:21:12 +00:00
239322cbd4
The new listenNetwork attribute needs to learn an IP address based on a named network. This patch provides a function networkGetNetworkAddress which provides that. Some networks have an IP address explicitly in their configuration (ie, those with a forward type of "none", "route", or "nat"). For those, we can just return the IP address from the config. The rest will have a physical device associated with them (either via <bridge name='...'/>, <forward ... dev='...'/>, or possibly via a pool of interfaces inside the network's <forward> element) and we will need to ask the kernel for a current IP address of that device (via the newly added ifaceGetIPAddress) If networkGetNetworkAddress encounters an error while trying to learn the address for a network, it will return -1. In the case that libvirt has been compiled without the network driver, the call is a macro which reduces to -2. This allows differentiating between a failure of the network driver, and its complete absence.
11 lines
195 B
Plaintext
11 lines
195 B
Plaintext
#
|
|
# Network-specific symbols
|
|
#
|
|
|
|
# bridge_driver.h
|
|
networkAllocateActualDevice;
|
|
networkBuildDhcpDaemonCommandLine;
|
|
networkGetNetworkAddress;
|
|
networkNotifyActualDevice;
|
|
networkReleaseActualDevice;
|