mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +00:00
Strip autogenerated vnetXXX interfaces
This commit is contained in:
parent
4bfdb77aae
commit
a8977b62ba
@ -1,3 +1,8 @@
|
||||
Wed Dec 5 10:07:00 EST 2007 Daniel P. Berrange <berrange@redhat.com>
|
||||
|
||||
* src/qemu_conf.c: Strip out NIC interfaces named vnetXXX since
|
||||
those are auto-generated names.
|
||||
|
||||
Wed Dec 5 13:48:00 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
|
||||
|
||||
* python/libvir.c, python/libvirt_wrap.h, qemud/qemud.c,
|
||||
|
@ -657,6 +657,11 @@ static int qemudParseInterfaceXML(virConnectPtr conn,
|
||||
(net->type == QEMUD_NET_BRIDGE)) &&
|
||||
xmlStrEqual(cur->name, BAD_CAST "target")) {
|
||||
ifname = xmlGetProp(cur, BAD_CAST "dev");
|
||||
if (STREQLEN("vnet", (const char*)ifname, 4)) {
|
||||
/* An auto-generated target name, blank it out */
|
||||
xmlFree(ifname);
|
||||
ifname = NULL;
|
||||
}
|
||||
} else if ((script == NULL) &&
|
||||
(net->type == QEMUD_NET_ETHERNET) &&
|
||||
xmlStrEqual(cur->name, BAD_CAST "script")) {
|
||||
@ -1411,6 +1416,7 @@ qemudNetworkIfaceConnect(virConnectPtr conn,
|
||||
}
|
||||
brname = network->bridge;
|
||||
if (net->dst.network.ifname[0] == '\0' ||
|
||||
STREQLEN(net->dst.network.ifname, "vnet", 4) ||
|
||||
strchr(net->dst.network.ifname, '%')) {
|
||||
strcpy(net->dst.network.ifname, "vnet%d");
|
||||
}
|
||||
@ -1418,6 +1424,7 @@ qemudNetworkIfaceConnect(virConnectPtr conn,
|
||||
} else if (net->type == QEMUD_NET_BRIDGE) {
|
||||
brname = net->dst.bridge.brname;
|
||||
if (net->dst.bridge.ifname[0] == '\0' ||
|
||||
STREQLEN(net->dst.bridge.ifname, "vnet", 4) ||
|
||||
strchr(net->dst.bridge.ifname, '%')) {
|
||||
strcpy(net->dst.bridge.ifname, "vnet%d");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user