提交 bf1afdd4 编写于 作者: M Michal Privoznik

networkLookupByUUID: Improve error message

We have this function networkObjFromNetwork() which for given
virNetworkPtr tries to find corresponding virNetworkObjPtr. If no
object is found, a nice error message is printed out:

  no network with matching uuid '$uuid' ($name)

Let's improve the error message produced by networkLookupByUUID to
follow that logic.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
上级 63889e0c
......@@ -2474,8 +2474,11 @@ static virNetworkPtr networkLookupByUUID(virConnectPtr conn,
network = virNetworkFindByUUID(&driver->networks, uuid);
networkDriverUnlock();
if (!network) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(uuid, uuidstr);
virReportError(VIR_ERR_NO_NETWORK,
"%s", _("no network with matching uuid"));
_("no network with matching uuid '%s'"),
uuidstr);
goto cleanup;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册