]> xenbits.xensource.com Git - libvirt.git/commitdiff
networkLookupByUUID: Improve error message
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 23 Feb 2015 14:05:44 +0000 (15:05 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 4 Mar 2015 09:07:59 +0000 (10:07 +0100)
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>
src/network/bridge_driver.c

index 1209609a9f71e1277e7f879fb04e86e69e66c1a6..5f02f7fa39023df2fc8c4cef22d25ab21ba35c34 100644 (file)
@@ -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;
     }