提交 3c4b8a77 编写于 作者: C Cole Robinson

test: Throw a proper error in GetBridgeName

Throw error in GetBridgeName if net has no bridge.
Signed-off-by: NCole Robinson <crobinso@redhat.com>
上级 ee8240b2
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册