From 226094fbc483128c8888f4171c353aed738b8346 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Fri, 21 Jun 2019 08:28:17 +0200 Subject: [PATCH] error: Add VIR_ERR_DEPRECATED error code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allow a simple programatic check that a given feature is no longer supported by introducing a separate error code for this scenario. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- include/libvirt/virterror.h | 1 + src/util/virerror.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/include/libvirt/virterror.h b/include/libvirt/virterror.h index 102a2573bf..22bc3c2d27 100644 --- a/include/libvirt/virterror.h +++ b/include/libvirt/virterror.h @@ -329,6 +329,7 @@ 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 dfba8c5712..26f14ddd29 100644 --- a/src/util/virerror.c +++ b/src/util/virerror.c @@ -1235,6 +1235,10 @@ 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", + }, }; -- GitLab