[libvirt] [PATCH v2 1/5] mdns: Set error when failing due to missing avahi

Martin Kletzander mkletzan at redhat.com
Thu Jun 4 17:35:08 UTC 2015


When building without avahi support, we used VIR_DEBUG() to note that to
the user.  However, functions that fail because of that (return NULL/-1)
did not set the error message.  This was the only file that forgot to do
such thing.

Signed-off-by: Martin Kletzander <mkletzan at redhat.com>
---
 src/rpc/virnetservermdns.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/rpc/virnetservermdns.c b/src/rpc/virnetservermdns.c
index 131968061c5f..7f12a2947363 100644
--- a/src/rpc/virnetservermdns.c
+++ b/src/rpc/virnetservermdns.c
@@ -617,14 +617,14 @@ static const char *unsupported = N_("avahi not available at build time");
 virNetServerMDNS *
 virNetServerMDNSNew(void)
 {
-    VIR_DEBUG("%s", _(unsupported));
+    virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _(unsupported));
     return NULL;
 }

 int
 virNetServerMDNSStart(virNetServerMDNS *mdns ATTRIBUTE_UNUSED)
 {
-    VIR_DEBUG("%s", _(unsupported));
+    virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _(unsupported));
     return -1;
 }

@@ -632,7 +632,7 @@ virNetServerMDNSGroupPtr
 virNetServerMDNSAddGroup(virNetServerMDNS *mdns ATTRIBUTE_UNUSED,
                          const char *name ATTRIBUTE_UNUSED)
 {
-    VIR_DEBUG("%s", _(unsupported));
+    virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _(unsupported));
     return NULL;
 }

@@ -648,7 +648,7 @@ virNetServerMDNSAddEntry(virNetServerMDNSGroupPtr group ATTRIBUTE_UNUSED,
                          const char *type ATTRIBUTE_UNUSED,
                          int port ATTRIBUTE_UNUSED)
 {
-    VIR_DEBUG("%s", _(unsupported));
+    virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _(unsupported));
     return NULL;
 }

-- 
2.4.2




More information about the libvir-list mailing list