提交 a8977b62 编写于 作者: D Daniel P. Berrange

Strip autogenerated vnetXXX interfaces

上级 4bfdb77a
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");
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册