[libvirt PATCH] conf: Fix error message in virNetworkForwardDefParseXML

Jiri Denemark posted 1 patch 3 weeks, 3 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/70facb04bd995daf3c1aacb3ff9563ef631f0a38.1706786197.git.jdenemar@redhat.com
src/conf/network_conf.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
[libvirt PATCH] conf: Fix error message in virNetworkForwardDefParseXML
Posted by Jiri Denemark 3 weeks, 3 days ago
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 src/conf/network_conf.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
index a2220c05a6..ef3415cd89 100644
--- a/src/conf/network_conf.c
+++ b/src/conf/network_conf.c
@@ -1362,8 +1362,9 @@ virNetworkForwardDefParseXML(const char *networkName,
 
     forwardDev = virXPathString("string(./@dev)", ctxt);
     if (forwardDev && (nForwardAddrs > 0 || nForwardPfs > 0)) {
-        virReportError(VIR_ERR_XML_ERROR, "%s",
-                       _("the <forward> 'dev' attribute cannot be used when <address> or <pf> sub-elements are present in network %1$s"));
+        virReportError(VIR_ERR_XML_ERROR,
+                       _("the <forward> 'dev' attribute cannot be used when <address> or <pf> sub-elements are present in network %1$s"),
+                       networkName);
         return -1;
     }
 
-- 
2.43.0
_______________________________________________
Devel mailing list -- devel@lists.libvirt.org
To unsubscribe send an email to devel-leave@lists.libvirt.org
Re: [libvirt PATCH] conf: Fix error message in virNetworkForwardDefParseXML
Posted by Peter Krempa 3 weeks, 3 days ago
On Thu, Feb 01, 2024 at 12:16:37 +0100, Jiri Denemark wrote:
> Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
> ---
>  src/conf/network_conf.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
> index a2220c05a6..ef3415cd89 100644
> --- a/src/conf/network_conf.c
> +++ b/src/conf/network_conf.c
> @@ -1362,8 +1362,9 @@ virNetworkForwardDefParseXML(const char *networkName,
>  
>      forwardDev = virXPathString("string(./@dev)", ctxt);
>      if (forwardDev && (nForwardAddrs > 0 || nForwardPfs > 0)) {
> -        virReportError(VIR_ERR_XML_ERROR, "%s",
> -                       _("the <forward> 'dev' attribute cannot be used when <address> or <pf> sub-elements are present in network %1$s"));
> +        virReportError(VIR_ERR_XML_ERROR,
> +                       _("the <forward> 'dev' attribute cannot be used when <address> or <pf> sub-elements are present in network %1$s"),
> +                       networkName);
>          return -1;
>      }

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
_______________________________________________
Devel mailing list -- devel@lists.libvirt.org
To unsubscribe send an email to devel-leave@lists.libvirt.org