[PATCH 1/2] virNetDevSetVfMac: Fix error message on invalid args

Michal Privoznik mprivozn at redhat.com
Fri Apr 22 12:15:46 UTC 2022


If virNetDevSetVfMac() is called with either @macaddr or
@allowRetry arguments NULL an error is reported, because this is
considered invalid use. However, the error message is not
informative as it could be.

Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
---
 src/util/virnetdev.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
index 1c15a475fa..5e60bf068f 100644
--- a/src/util/virnetdev.c
+++ b/src/util/virnetdev.c
@@ -1642,7 +1642,9 @@ virNetDevSetVfMac(const char *ifname, int vf,
     };
 
     if (macaddr == NULL || allowRetry == NULL) {
-        virReportError(EINVAL, "%s", _("Invalid parameters: %d"));
+        virReportError(EINVAL,
+                       _("Invalid parameters macaddr=%p allowRetry=%p"),
+                       macaddr, allowRetry);
         return -EINVAL;
     }
 
-- 
2.35.1



More information about the libvir-list mailing list