Openvz --ipadd can be provided multiple times
Vzctl man page says that --ipadd can be provided multiple times to add several IP addresses. Looping over the configured ip addresses to add one --ipadd for each. This would even handle the multiple IPs handled by openvz_conf.c
This commit is contained in:
parent
bbf1eafa57
commit
a4e8639068
@ -905,9 +905,13 @@ openvzDomainSetNetwork(virConnectPtr conn, const char *vpsid,
|
|||||||
virCommandAddArgBuffer(cmd, &buf);
|
virCommandAddArgBuffer(cmd, &buf);
|
||||||
} else if (net->type == VIR_DOMAIN_NET_TYPE_ETHERNET &&
|
} else if (net->type == VIR_DOMAIN_NET_TYPE_ETHERNET &&
|
||||||
net->nips > 0) {
|
net->nips > 0) {
|
||||||
|
size_t i;
|
||||||
|
|
||||||
/* --ipadd ip */
|
/* --ipadd ip */
|
||||||
char *ipStr = virSocketAddrFormat(&net->ips[0]->address);
|
for (i = 0; i < net->nips; i++) {
|
||||||
virCommandAddArgList(cmd, "--ipadd", ipStr, NULL);
|
char *ipStr = virSocketAddrFormat(&net->ips[i]->address);
|
||||||
|
virCommandAddArgList(cmd, "--ipadd", ipStr, NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: processing NAT and physical device */
|
/* TODO: processing NAT and physical device */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user