[libvirt] [PATCH] Consistently use 'CANCELED' spelling in public API

Most constant names in libvirt public API are using the 'CANCELED' spelling, except for VIR_DOMAIN_JOB_CANCELLED and VIR_ERR_AUTH_CANCELLED. This commit changes the spelling used by these 2 symbols to make it consistant with the rest of the API. For backwards compatibility, 2 #define are introduced using the old spelling (with 2 'L'). Signed-off-by: Christophe Fergeau <cfergeau@redhat.com> --- include/libvirt/libvirt.h.in | 10 +++++++++- include/libvirt/virterror.h | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in index 52ac95d..91efa8c 100644 --- a/include/libvirt/libvirt.h.in +++ b/include/libvirt/libvirt.h.in @@ -4031,13 +4031,21 @@ typedef enum { VIR_DOMAIN_JOB_UNBOUNDED = 2, /* Job without a finite completion time */ VIR_DOMAIN_JOB_COMPLETED = 3, /* Job has finished, but isn't cleaned up */ VIR_DOMAIN_JOB_FAILED = 4, /* Job hit error, but isn't cleaned up */ - VIR_DOMAIN_JOB_CANCELLED = 5, /* Job was aborted, but isn't cleaned up */ + VIR_DOMAIN_JOB_CANCELED = 5, /* Job was aborted, but isn't cleaned up */ #ifdef VIR_ENUM_SENTINELS VIR_DOMAIN_JOB_LAST #endif } virDomainJobType; +/** + * VIR_DOMAIN_JOB_CANCELLED: + * + * Deprecated name for VIR_DOMAIN_JOB_CANCELED. Provided for backwards + * compatibility. + */ +#define VIR_DOMAIN_JOB_CANCELLED VIR_DOMAIN_JOB_CANCELED + typedef struct _virDomainJobInfo virDomainJobInfo; typedef virDomainJobInfo *virDomainJobInfoPtr; struct _virDomainJobInfo { diff --git a/include/libvirt/virterror.h b/include/libvirt/virterror.h index c1960c8..b525f96 100644 --- a/include/libvirt/virterror.h +++ b/include/libvirt/virterror.h @@ -282,7 +282,7 @@ typedef enum { risky domain snapshot revert */ VIR_ERR_OPERATION_ABORTED = 78, /* operation on a domain was canceled/aborted by user */ - VIR_ERR_AUTH_CANCELLED = 79, /* authentication cancelled */ + VIR_ERR_AUTH_CANCELED = 79, /* authentication cancelled */ VIR_ERR_NO_DOMAIN_METADATA = 80, /* The metadata is not present */ VIR_ERR_MIGRATE_UNSAFE = 81, /* Migration is not safe */ VIR_ERR_OVERFLOW = 82, /* integer overflow */ @@ -299,6 +299,14 @@ typedef enum { } virErrorNumber; /** + * VIR_ERR_AUTH_CANCELLED: + * + * Deprecated name for VIR_ERR_AUTH_CANCELED. Provided for backwards + * compatibility. + */ +#define VIR_ERR_AUTH_CANCELLED VIR_ERR_AUTH_CANCELED + +/** * virErrorFunc: * @userData: user provided data for the error callback * @error: the error being raised. -- 1.8.3.1

On Mon, Aug 19, 2013 at 11:44:39AM +0200, Christophe Fergeau wrote:
Most constant names in libvirt public API are using the 'CANCELED' spelling, except for VIR_DOMAIN_JOB_CANCELLED and VIR_ERR_AUTH_CANCELLED.
This commit changes the spelling used by these 2 symbols to make it consistant with the rest of the API. For backwards compatibility, 2 #define are introduced using the old spelling (with 2 'L').
Signed-off-by: Christophe Fergeau <cfergeau@redhat.com> --- include/libvirt/libvirt.h.in | 10 +++++++++- include/libvirt/virterror.h | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-)
This has been proposed before, but rejected. Although the misspelling sucks, it doesn't really cause any serious pain to apps. Any app that used the new spelling would be needlessly tieing itself to new libvirt. So IMHO it better to just live with this. Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On Mon, Aug 19, 2013 at 10:53:28AM +0100, Daniel P. Berrange wrote:
On Mon, Aug 19, 2013 at 11:44:39AM +0200, Christophe Fergeau wrote:
Most constant names in libvirt public API are using the 'CANCELED' spelling, except for VIR_DOMAIN_JOB_CANCELLED and VIR_ERR_AUTH_CANCELLED.
This commit changes the spelling used by these 2 symbols to make it consistant with the rest of the API. For backwards compatibility, 2 #define are introduced using the old spelling (with 2 'L').
Signed-off-by: Christophe Fergeau <cfergeau@redhat.com> --- include/libvirt/libvirt.h.in | 10 +++++++++- include/libvirt/virterror.h | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-)
This has been proposed before, but rejected. Although the misspelling sucks, it doesn't really cause any serious pain to apps. Any app that used the new spelling would be needlessly tieing itself to new libvirt. So IMHO it better to just live with this.
Yup, does not cause pain, but this makes the API look less polished than it could. One can also argue that the tieing to a new libvirt would be compile-time only, and easy to workaround. Anyway, I'm fine with dropping this patch, especially as this has already been discussed. Christophe
participants (2)
-
Christophe Fergeau
-
Daniel P. Berrange