mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 07:59:00 +00:00
test: Throw a proper error in GetBridgeName
Throw error in GetBridgeName if net has no bridge. Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
parent
ee8240b295
commit
3c4b8a7706
@ -2546,8 +2546,14 @@ static char *testNetworkGetBridgeName(virNetworkPtr network) {
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (privnet->def->bridge &&
|
if (!(privnet->def->bridge)) {
|
||||||
!(bridge = strdup(privnet->def->bridge))) {
|
testError(network->conn, VIR_ERR_INTERNAL_ERROR,
|
||||||
|
_("network '%s' does not have a bridge name."),
|
||||||
|
privnet->def->name);
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(bridge = strdup(privnet->def->bridge))) {
|
||||||
virReportOOMError(network->conn);
|
virReportOOMError(network->conn);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user