[PATCH] daemon: Treat logging of VIR_ERR_MULTIPLE_INTERFACES same as VIR_ERR_NO_INTERFACE

Peter Krempa posted 1 patch 9 months, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/242c2ab077d5901ccad1e1cf540d64d20f2cdeaa.1690963884.git.pkrempa@redhat.com
src/remote/remote_daemon.c | 1 +
1 file changed, 1 insertion(+)
[PATCH] daemon: Treat logging of VIR_ERR_MULTIPLE_INTERFACES same as VIR_ERR_NO_INTERFACE
Posted by Peter Krempa 9 months, 1 week ago
When a query for an interface via virInterfaceLookupByMACString finds
multiple interfaces an error is returned. Treat such error with the same
'debug' priority as we treat when the interface was not found to avoid
spamming logs with such configurations.

Closes: https://gitlab.com/libvirt/libvirt/-/issues/514
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 src/remote/remote_daemon.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/remote/remote_daemon.c b/src/remote/remote_daemon.c
index d880711c91..d4d999e53a 100644
--- a/src/remote/remote_daemon.c
+++ b/src/remote/remote_daemon.c
@@ -97,6 +97,7 @@ static int daemonErrorLogFilter(virErrorPtr err, int priority)
     case VIR_ERR_NO_STORAGE_VOL:
     case VIR_ERR_NO_NODE_DEVICE:
     case VIR_ERR_NO_INTERFACE:
+    case VIR_ERR_MULTIPLE_INTERFACES:
     case VIR_ERR_NO_NWFILTER:
     case VIR_ERR_NO_NWFILTER_BINDING:
     case VIR_ERR_NO_SECRET:
-- 
2.41.0
Re: [PATCH] daemon: Treat logging of VIR_ERR_MULTIPLE_INTERFACES same as VIR_ERR_NO_INTERFACE
Posted by Martin Kletzander 9 months, 1 week ago
On Wed, Aug 02, 2023 at 10:11:24AM +0200, Peter Krempa wrote:
>When a query for an interface via virInterfaceLookupByMACString finds
>multiple interfaces an error is returned. Treat such error with the same
>'debug' priority as we treat when the interface was not found to avoid
>spamming logs with such configurations.
>
>Closes: https://gitlab.com/libvirt/libvirt/-/issues/514
>Signed-off-by: Peter Krempa <pkrempa@redhat.com>

Reviewed-by: Martin Kletzander <mkletzan@redhat.com>

>---
> src/remote/remote_daemon.c | 1 +
> 1 file changed, 1 insertion(+)
>
>diff --git a/src/remote/remote_daemon.c b/src/remote/remote_daemon.c
>index d880711c91..d4d999e53a 100644
>--- a/src/remote/remote_daemon.c
>+++ b/src/remote/remote_daemon.c
>@@ -97,6 +97,7 @@ static int daemonErrorLogFilter(virErrorPtr err, int priority)
>     case VIR_ERR_NO_STORAGE_VOL:
>     case VIR_ERR_NO_NODE_DEVICE:
>     case VIR_ERR_NO_INTERFACE:
>+    case VIR_ERR_MULTIPLE_INTERFACES:
>     case VIR_ERR_NO_NWFILTER:
>     case VIR_ERR_NO_NWFILTER_BINDING:
>     case VIR_ERR_NO_SECRET:
>-- 
>2.41.0
>