]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virNetDevOpenvswitchInterfaceStats: Add 'ifname' to error messages
authorPeter Krempa <pkrempa@redhat.com>
Tue, 28 Apr 2026 06:47:20 +0000 (08:47 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 5 May 2026 05:35:01 +0000 (07:35 +0200)
Report the interface name which caused the error.

Resolves: https://redhat.atlassian.net/browse/RHEL-170993
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
src/util/virnetdevopenvswitch.c

index 868d6d26bad7f2a9e3a4ff09daa42504b9706853..d6457f35a03ffe90b29b4a0ca3bbd798c493f73e 100644 (file)
@@ -403,8 +403,8 @@ virNetDevOpenvswitchInterfaceStats(const char *ifname,
         STREQ_NULLABLE(output, "")) {
         /* no ovs-vsctl or interface 'ifname' doesn't exists in ovs */
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Interface not found: %1$s"),
-                       NULLSTR(errbuf));
+                       _("Interface '%1$s' not found: %2$s"),
+                       ifname, NULLSTR(errbuf));
         return -1;
     }
 
@@ -419,8 +419,9 @@ virNetDevOpenvswitchInterfaceStats(const char *ifname,
         stats->tx_packets == -1 &&
         stats->tx_errs == -1 &&
         stats->tx_drop == -1) {
-        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-                       _("Interface doesn't have any statistics"));
+        virReportError(VIR_ERR_INTERNAL_ERROR,
+                       _("Interface '%1$s' doesn't have any statistics"),
+                       ifname);
         return -1;
     }