Skip to content

Commit 6ffa171

Browse files
Sebastien Boeufbryteise
authored andcommitted
ch: Fix host IP assignment
Cloud Hypervisor's network option "ip" refers to the host IP address a user wants to set. The libvirt implementation should follow that by retrieving IP addresses from hostIP structure instead of guestIP. Signed-off-by: Sebastien Boeuf <[email protected]>
1 parent 3a246c5 commit 6ffa171

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ch/ch_monitor.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,8 @@ virCHMonitorBuildNetJson(virDomainObjPtr vm, virJSONValuePtr nets, virDomainNetD
319319

320320
switch (netType) {
321321
case VIR_DOMAIN_NET_TYPE_ETHERNET:
322-
if (netdef->guestIP.nips == 1) {
323-
const virNetDevIPAddr *ip = netdef->guestIP.ips[0];
322+
if (netdef->hostIP.nips == 1) {
323+
const virNetDevIPAddr *ip = netdef->hostIP.ips[0];
324324
g_autofree char *addr = NULL;
325325
virSocketAddr netmask;
326326
g_autofree char *netmaskStr = NULL;

0 commit comments

Comments
 (0)