mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-26 22:45:17 +00:00
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: Michal Privoznik <mprivozn@redhat.com> (cherry picked from commit bf1afdd4911b496f12635b5bd17150f09864ee67)
This commit is contained in:
parent
91cf6052de
commit
2362e98273
@ -2474,8 +2474,11 @@ static virNetworkPtr networkLookupByUUID(virConnectPtr conn,
|
|||||||
network = virNetworkFindByUUID(&driver->networks, uuid);
|
network = virNetworkFindByUUID(&driver->networks, uuid);
|
||||||
networkDriverUnlock();
|
networkDriverUnlock();
|
||||||
if (!network) {
|
if (!network) {
|
||||||
|
char uuidstr[VIR_UUID_STRING_BUFLEN];
|
||||||
|
virUUIDFormat(uuid, uuidstr);
|
||||||
virReportError(VIR_ERR_NO_NETWORK,
|
virReportError(VIR_ERR_NO_NETWORK,
|
||||||
"%s", _("no network with matching uuid"));
|
_("no network with matching uuid '%s'"),
|
||||||
|
uuidstr);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user