From: Michal Privoznik Date: Mon, 23 Feb 2015 14:05:44 +0000 (+0100) Subject: networkLookupByUUID: Improve error message X-Git-Tag: v1.2.13.1~62 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2362e98273719f86947cd6a1b549513f04ea0d22;p=thirdparty%2Flibvirt.git 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 (cherry picked from commit bf1afdd4911b496f12635b5bd17150f09864ee67) --- diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 1209609a9f..5f02f7fa39 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -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; }