[libvirt] [PATCH 2/4] Revert "error: Add VIR_ERR_DEPRECATED error code"

Daniel P. Berrangé posted 4 patches 6 years, 7 months ago
There is a newer version of this series
[libvirt] [PATCH 2/4] Revert "error: Add VIR_ERR_DEPRECATED error code"
Posted by Daniel P. Berrangé 6 years, 7 months ago
This reverts commit 226094fbc483128c8888f4171c353aed738b8346.

A deprecation is a warning to something that use of a feature is
being discouraged. By definition it is not an error condition to
continue to use a deprecated feature.

A VIR_ERR_DEPRECATED constant thus makes no conceptual sense. For
features which are entirely absent we already document that the
VIR_ERR_NO_SUPPORT code will be used. There is no need to distinguish
between a feature which never existed and a feature which previously
existed and was since removed.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 include/libvirt/virterror.h | 1 -
 src/util/virerror.c         | 4 ----
 2 files changed, 5 deletions(-)

diff --git a/include/libvirt/virterror.h b/include/libvirt/virterror.h
index 22bc3c2d27..102a2573bf 100644
--- a/include/libvirt/virterror.h
+++ b/include/libvirt/virterror.h
@@ -329,7 +329,6 @@ typedef enum {
     VIR_ERR_INVALID_NETWORK_PORT = 105, /* invalid network port object */
     VIR_ERR_NETWORK_PORT_EXIST = 106,   /* the network port already exist */
     VIR_ERR_NO_NETWORK_PORT = 107,      /* network port not found */
-    VIR_ERR_DEPRECATED = 108,           /* configuration or operation is no longer supported */
 
 # ifdef VIR_ENUM_SENTINELS
     VIR_ERR_NUMBER_LAST
diff --git a/src/util/virerror.c b/src/util/virerror.c
index 26f14ddd29..dfba8c5712 100644
--- a/src/util/virerror.c
+++ b/src/util/virerror.c
@@ -1235,10 +1235,6 @@ const virErrorMsgTuple virErrorMsgStrings[VIR_ERR_NUMBER_LAST] = {
     [VIR_ERR_NO_NETWORK_PORT] = {
         N_("network port not found"),
         N_("network port not found: %s") },
-    [VIR_ERR_DEPRECATED] = {
-        N_("operation or configuration no longer supported"),
-        "%s",
-    },
 };
 
 
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 2/4] Revert "error: Add VIR_ERR_DEPRECATED error code"
Posted by Ján Tomko 6 years, 7 months ago
On Wed, Jun 26, 2019 at 04:54:41PM +0100, Daniel P. Berrangé wrote:
>This reverts commit 226094fbc483128c8888f4171c353aed738b8346.
>
>A deprecation is a warning to something that use of a feature is
>being discouraged. By definition it is not an error condition to
>continue to use a deprecated feature.
>

Makes sense that from an app's PoV it's the same

>A VIR_ERR_DEPRECATED constant thus makes no conceptual sense. For
>features which are entirely absent we already document that the
>VIR_ERR_NO_SUPPORT code will be used. There is no need to distinguish
>between a feature which never existed and a feature which previously
>existed and was since removed.
>
>Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
>---
> include/libvirt/virterror.h | 1 -
> src/util/virerror.c         | 4 ----
> 2 files changed, 5 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

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