diff options
author | Eric Blake <eblake@redhat.com> | 2012-01-20 11:43:28 -0700 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2012-01-20 16:05:51 -0700 |
commit | 7b4e5693c13d5de1f0e14abda029e3148cbbe12f (patch) | |
tree | bdda5f04b656230e56d9290e8dd58eb6c9020aab /tests/cputest.c | |
parent | error: drop old-style error reporting (diff) | |
download | libvirt-7b4e5693c13d5de1f0e14abda029e3148cbbe12f.tar.gz libvirt-7b4e5693c13d5de1f0e14abda029e3148cbbe12f.tar.bz2 libvirt-7b4e5693c13d5de1f0e14abda029e3148cbbe12f.zip |
API: make declaration of _LAST enum values conditional
Although this is a public API break, it only affects users that
were compiling against *_LAST values, and can be trivially
worked around without impacting compilation against older
headers, by the user defining VIR_ENUM_SENTINELS before using
libvirt.h. It is not an ABI break, since enum values do not
appear as .so entry points. Meanwhile, it prevents users from
using non-stable enum values without explicitly acknowledging
the risk of doing so.
See this list discussion:
https://www.redhat.com/archives/libvir-list/2012-January/msg00804.html
* include/libvirt/libvirt.h.in: Hide all sentinels behind
LIBVIRT_ENUM_SENTINELS, and add missing sentinels.
* src/internal.h (VIR_DEPRECATED): Allow inclusion after
libvirt.h.
(LIBVIRT_ENUM_SENTINELS): Expose sentinels internally.
* daemon/libvirtd.h: Use the sentinels.
* src/remote/remote_protocol.x (includes): Don't expose sentinels.
* python/generator.py (enum): Likewise.
* tests/cputest.c (cpuTestCompResStr): Silence compiler warning.
* tools/virsh.c (vshDomainStateReasonToString)
(vshDomainControlStateToString): Likewise.
Diffstat (limited to 'tests/cputest.c')
-rw-r--r-- | tests/cputest.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/cputest.c b/tests/cputest.c index 938e08777..17e14f7d5 100644 --- a/tests/cputest.c +++ b/tests/cputest.c @@ -1,7 +1,7 @@ /* * cputest.c: Test the libvirtd internal CPU APIs * - * Copyright (C) 2010-2011 Red Hat, Inc. + * Copyright (C) 2010-2012 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -205,6 +205,7 @@ cpuTestCompResStr(virCPUCompareResult result) case VIR_CPU_COMPARE_INCOMPATIBLE: return "INCOMPATIBLE"; case VIR_CPU_COMPARE_IDENTICAL: return "IDENTICAL"; case VIR_CPU_COMPARE_SUPERSET: return "SUPERSET"; + case VIR_CPU_COMPARE_LAST: break; } return "unknown"; |