mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
Remove type_sep parameter from qemuBuildHostNetStr
The last caller not passing a comma was removed by:
commit ad8a7c4f85
Author: Ján Tomko <jtomko@redhat.com>
CommitDate: 2018-04-12 17:17:16 +0200
qemu: deprecate QEMU_CAPS_NETDEV
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
d3f4fc8684
commit
e565b9cd0c
@ -3546,7 +3546,6 @@ qemuBuildNicDevStr(virDomainDefPtr def,
|
|||||||
char *
|
char *
|
||||||
qemuBuildHostNetStr(virDomainNetDefPtr net,
|
qemuBuildHostNetStr(virDomainNetDefPtr net,
|
||||||
virQEMUDriverPtr driver,
|
virQEMUDriverPtr driver,
|
||||||
char type_sep,
|
|
||||||
int vlan,
|
int vlan,
|
||||||
char **tapfd,
|
char **tapfd,
|
||||||
size_t tapfdSize,
|
size_t tapfdSize,
|
||||||
@ -3578,7 +3577,7 @@ qemuBuildHostNetStr(virDomainNetDefPtr net,
|
|||||||
case VIR_DOMAIN_NET_TYPE_NETWORK:
|
case VIR_DOMAIN_NET_TYPE_NETWORK:
|
||||||
case VIR_DOMAIN_NET_TYPE_DIRECT:
|
case VIR_DOMAIN_NET_TYPE_DIRECT:
|
||||||
case VIR_DOMAIN_NET_TYPE_ETHERNET:
|
case VIR_DOMAIN_NET_TYPE_ETHERNET:
|
||||||
virBufferAsprintf(&buf, "tap%c", type_sep);
|
virBufferAddLit(&buf, "tap,");
|
||||||
/* for one tapfd 'fd=' shall be used,
|
/* for one tapfd 'fd=' shall be used,
|
||||||
* for more than one 'fds=' is the right choice */
|
* for more than one 'fds=' is the right choice */
|
||||||
if (tapfdSize == 1) {
|
if (tapfdSize == 1) {
|
||||||
@ -3596,30 +3595,26 @@ qemuBuildHostNetStr(virDomainNetDefPtr net,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case VIR_DOMAIN_NET_TYPE_CLIENT:
|
case VIR_DOMAIN_NET_TYPE_CLIENT:
|
||||||
virBufferAsprintf(&buf, "socket%cconnect=%s:%d,",
|
virBufferAsprintf(&buf, "socket,connect=%s:%d,",
|
||||||
type_sep,
|
|
||||||
net->data.socket.address,
|
net->data.socket.address,
|
||||||
net->data.socket.port);
|
net->data.socket.port);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VIR_DOMAIN_NET_TYPE_SERVER:
|
case VIR_DOMAIN_NET_TYPE_SERVER:
|
||||||
virBufferAsprintf(&buf, "socket%clisten=%s:%d,",
|
virBufferAsprintf(&buf, "socket,listen=%s:%d,",
|
||||||
type_sep,
|
|
||||||
net->data.socket.address ? net->data.socket.address
|
net->data.socket.address ? net->data.socket.address
|
||||||
: "",
|
: "",
|
||||||
net->data.socket.port);
|
net->data.socket.port);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VIR_DOMAIN_NET_TYPE_MCAST:
|
case VIR_DOMAIN_NET_TYPE_MCAST:
|
||||||
virBufferAsprintf(&buf, "socket%cmcast=%s:%d,",
|
virBufferAsprintf(&buf, "socket,mcast=%s:%d,",
|
||||||
type_sep,
|
|
||||||
net->data.socket.address,
|
net->data.socket.address,
|
||||||
net->data.socket.port);
|
net->data.socket.port);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VIR_DOMAIN_NET_TYPE_UDP:
|
case VIR_DOMAIN_NET_TYPE_UDP:
|
||||||
virBufferAsprintf(&buf, "socket%cudp=%s:%d,localaddr=%s:%d,",
|
virBufferAsprintf(&buf, "socket,udp=%s:%d,localaddr=%s:%d,",
|
||||||
type_sep,
|
|
||||||
net->data.socket.address,
|
net->data.socket.address,
|
||||||
net->data.socket.port,
|
net->data.socket.port,
|
||||||
net->data.socket.localaddr,
|
net->data.socket.localaddr,
|
||||||
@ -3627,7 +3622,7 @@ qemuBuildHostNetStr(virDomainNetDefPtr net,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case VIR_DOMAIN_NET_TYPE_USER:
|
case VIR_DOMAIN_NET_TYPE_USER:
|
||||||
virBufferAsprintf(&buf, "user%c", type_sep);
|
virBufferAddLit(&buf, "user,");
|
||||||
for (i = 0; i < net->guestIP.nips; i++) {
|
for (i = 0; i < net->guestIP.nips; i++) {
|
||||||
const virNetDevIPAddr *ip = net->guestIP.ips[i];
|
const virNetDevIPAddr *ip = net->guestIP.ips[i];
|
||||||
const char *prefix = "";
|
const char *prefix = "";
|
||||||
@ -3649,12 +3644,11 @@ qemuBuildHostNetStr(virDomainNetDefPtr net,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case VIR_DOMAIN_NET_TYPE_INTERNAL:
|
case VIR_DOMAIN_NET_TYPE_INTERNAL:
|
||||||
virBufferAsprintf(&buf, "user%c", type_sep);
|
virBufferAddLit(&buf, "user,");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VIR_DOMAIN_NET_TYPE_VHOSTUSER:
|
case VIR_DOMAIN_NET_TYPE_VHOSTUSER:
|
||||||
virBufferAsprintf(&buf, "vhost-user%cchardev=char%s,",
|
virBufferAsprintf(&buf, "vhost-user,chardev=char%s,",
|
||||||
type_sep,
|
|
||||||
net->info.alias);
|
net->info.alias);
|
||||||
if (net->driver.virtio.queues > 1)
|
if (net->driver.virtio.queues > 1)
|
||||||
virBufferAsprintf(&buf, "queues=%u,",
|
virBufferAsprintf(&buf, "queues=%u,",
|
||||||
@ -8086,7 +8080,7 @@ qemuBuildVhostuserCommandLine(virQEMUDriverPtr driver,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!(netdev = qemuBuildHostNetStr(net, driver,
|
if (!(netdev = qemuBuildHostNetStr(net, driver,
|
||||||
',', -1,
|
-1,
|
||||||
NULL, 0, NULL, 0)))
|
NULL, 0, NULL, 0)))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
@ -8387,7 +8381,7 @@ qemuBuildInterfaceCommandLine(virQEMUDriverPtr driver,
|
|||||||
|
|
||||||
if (qemuDomainSupportsNicdev(def, net)) {
|
if (qemuDomainSupportsNicdev(def, net)) {
|
||||||
if (!(host = qemuBuildHostNetStr(net, driver,
|
if (!(host = qemuBuildHostNetStr(net, driver,
|
||||||
',', vlan,
|
vlan,
|
||||||
tapfdName, tapfdSize,
|
tapfdName, tapfdSize,
|
||||||
vhostfdName, vhostfdSize)))
|
vhostfdName, vhostfdSize)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
@ -8403,7 +8397,7 @@ qemuBuildInterfaceCommandLine(virQEMUDriverPtr driver,
|
|||||||
virCommandAddArgList(cmd, "-net", nic, NULL);
|
virCommandAddArgList(cmd, "-net", nic, NULL);
|
||||||
|
|
||||||
if (!(host = qemuBuildHostNetStr(net, driver,
|
if (!(host = qemuBuildHostNetStr(net, driver,
|
||||||
',', vlan,
|
vlan,
|
||||||
tapfdName, tapfdSize,
|
tapfdName, tapfdSize,
|
||||||
vhostfdName, vhostfdSize)))
|
vhostfdName, vhostfdSize)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
@ -80,7 +80,6 @@ qemuBuildChrDeviceStr(char **deviceStr,
|
|||||||
/* With vlan == -1, use netdev syntax, else old hostnet */
|
/* With vlan == -1, use netdev syntax, else old hostnet */
|
||||||
char *qemuBuildHostNetStr(virDomainNetDefPtr net,
|
char *qemuBuildHostNetStr(virDomainNetDefPtr net,
|
||||||
virQEMUDriverPtr driver,
|
virQEMUDriverPtr driver,
|
||||||
char type_sep,
|
|
||||||
int vlan,
|
int vlan,
|
||||||
char **tapfd,
|
char **tapfd,
|
||||||
size_t tapfdSize,
|
size_t tapfdSize,
|
||||||
|
@ -1120,7 +1120,7 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!(netstr = qemuBuildHostNetStr(net, driver,
|
if (!(netstr = qemuBuildHostNetStr(net, driver,
|
||||||
',', -1,
|
-1,
|
||||||
tapfdName, tapfdSize,
|
tapfdName, tapfdSize,
|
||||||
vhostfdName, vhostfdSize)))
|
vhostfdName, vhostfdSize)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
Loading…
Reference in New Issue
Block a user