mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 09:17:52 +03: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;
|
||||
}
|
||||
|
||||
if (privnet->def->bridge &&
|
||||
!(bridge = strdup(privnet->def->bridge))) {
|
||||
if (!(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);
|
||||
goto cleanup;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user