[libvirt] [RFC 4/7] util: Introduce VIR_ERR_DEPRECATED_FEATURE

Andrea Bolognani posted 7 patches 4 years, 8 months ago
[libvirt] [RFC 4/7] util: Introduce VIR_ERR_DEPRECATED_FEATURE
Posted by Andrea Bolognani 4 years, 8 months ago
This error code will be used whenever the user triggers
execution of code that's been marked as deprecated.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
 include/libvirt/virterror.h | 1 +
 src/util/virerror.c         | 6 ++++++
 2 files changed, 7 insertions(+)

diff --git a/include/libvirt/virterror.h b/include/libvirt/virterror.h
index 57aadb8d16..780270c4f2 100644
--- a/include/libvirt/virterror.h
+++ b/include/libvirt/virterror.h
@@ -323,6 +323,7 @@ typedef enum {
     VIR_ERR_DEVICE_MISSING = 99,        /* fail to find the desired device */
     VIR_ERR_INVALID_NWFILTER_BINDING = 100,  /* invalid nwfilter binding */
     VIR_ERR_NO_NWFILTER_BINDING = 101,  /* no nwfilter binding */
+    VIR_ERR_DEPRECATED_FEATURE = 102, /* deprecated feature */
 } virErrorNumber;
 
 /**
diff --git a/src/util/virerror.c b/src/util/virerror.c
index 517e0bde28..f1ee47b309 100644
--- a/src/util/virerror.c
+++ b/src/util/virerror.c
@@ -1509,6 +1509,12 @@ virErrorMsg(virErrorNumber error, const char *info)
             else
                 errmsg = _("Network filter binding not found: %s");
             break;
+        case VIR_ERR_DEPRECATED_FEATURE:
+            if (info == NULL)
+                errmsg = _("Deprecated feature");
+            else
+                errmsg = _("Deprecated feature: %s");
+            break;
     }
     return errmsg;
 }
-- 
2.17.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list