Fix segfault if virtual network does not have a bridge name

This commit is contained in:
Cole Robinson 2008-12-11 14:57:45 +00:00
parent a3d570c7b9
commit 52037657dc
3 changed files with 12 additions and 3 deletions

View File

@ -1,3 +1,8 @@
Thu Dec 11 09:55:23 EST 2008 Cole Robinson <crobinso@redhat.com>
* src/netork_driver.c src/qemu_conf.c: Fix segfault if virtual
network does not have a bridge name.
Thu Dec 11 12:39:20 CET 2008 Daniel Veillard <veillard@redhat.com>
* src/domain_conf.c src/domain_conf.h src/qemu_conf.c

View File

@ -1182,6 +1182,13 @@ static char *networkGetBridgeName(virNetworkPtr net) {
goto cleanup;
}
if (!(network->def->bridge)) {
networkReportError(net->conn, NULL, net, VIR_ERR_INTERNAL_ERROR,
_("network '%s' does not have a bridge name."),
network->def->name);
goto cleanup;
}
bridge = strdup(network->def->bridge);
if (!bridge)
networkReportError(net->conn, NULL, net, VIR_ERR_NO_MEMORY,

View File

@ -549,9 +549,6 @@ qemudNetworkIfaceConnect(virConnectPtr conn,
virNetworkFree(network);
if (brname == NULL) {
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
_("Network '%s' is not active"),
net->data.network.name);
goto error;
}
} else if (net->type == VIR_DOMAIN_NET_TYPE_BRIDGE) {