[PATCH for-4.15] tools/libxendevicemodel: Strip __XEN_TOOLS__ header guard

Andrew Cooper posted 1 patch 3 years, 1 month ago
Test gitlab-ci passed
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20210304130319.10719-1-andrew.cooper3@citrix.com
tools/include/xendevicemodel.h | 4 ----
1 file changed, 4 deletions(-)
[PATCH for-4.15] tools/libxendevicemodel: Strip __XEN_TOOLS__ header guard
Posted by Andrew Cooper 3 years, 1 month ago
This is inappropriate for the header file of a standalone library with stable
API and ABI.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Ian Jackson <iwj@xenproject.org>
CC: Wei Liu <wl@xen.org>

Discovered when trying to actually remove the use of unstable libraries from a
trivial userspace emulator.  Current users of xendevicemodel.h inherit
__XEN_TOOLS__ from libxenctrl.h (or equiv).
---
 tools/include/xendevicemodel.h | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/tools/include/xendevicemodel.h b/tools/include/xendevicemodel.h
index 33698d67f3..797e0c6b29 100644
--- a/tools/include/xendevicemodel.h
+++ b/tools/include/xendevicemodel.h
@@ -17,8 +17,6 @@
 #ifndef XENDEVICEMODEL_H
 #define XENDEVICEMODEL_H
 
-#ifdef __XEN_TOOLS__
-
 #include <stdint.h>
 
 #include <xen/xen.h>
@@ -377,8 +375,6 @@ int xendevicemodel_nr_vcpus(
  */
 int xendevicemodel_restrict(xendevicemodel_handle *dmod, domid_t domid);
 
-#endif /* __XEN_TOOLS__ */
-
 #endif /* XENDEVICEMODEL_H */
 
 /*
-- 
2.11.0


Re: [PATCH for-4.15] tools/libxendevicemodel: Strip __XEN_TOOLS__ header guard
Posted by Andrew Cooper 3 years, 1 month ago
On 04/03/2021 13:03, Andrew Cooper wrote:
> This is inappropriate for the header file of a standalone library with stable
> API and ABI.
>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Ian Jackson <iwj@xenproject.org>
> CC: Wei Liu <wl@xen.org>
>
> Discovered when trying to actually remove the use of unstable libraries from a
> trivial userspace emulator.  Current users of xendevicemodel.h inherit
> __XEN_TOOLS__ from libxenctrl.h (or equiv).
> ---

... and this patch is broken.

But CI doesn't pick it up because we've also broken the header check
scripts as part of library refactoring.

The 4.13 header checks do work, and point out that there is yet another
set of bogus __XEN_TOOLS__ ifdef in the Xen public ABI, which hides the
ioserverid_t type and (rightly) breaks the build.

Which in turn proves that the header checks (for xendevicemodel.h at
least) never ever checked anything originally, because they didn't pass
__XEN_TOOLS__ in at the top and just saw an empty file.

~Andrew


Re: [PATCH for-4.15] tools/libxendevicemodel: Strip __XEN_TOOLS__ header guard
Posted by Ian Jackson 3 years, 1 month ago
Andrew Cooper writes ("[PATCH for-4.15] tools/libxendevicemodel: Strip __XEN_TOOLS__ header guard"):
> This is inappropriate for the header file of a standalone library with stable
> API and ABI.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Ian Jackson <iwj@xenproject.org>

Re: [PATCH for-4.15] tools/libxendevicemodel: Strip __XEN_TOOLS__ header guard
Posted by Ian Jackson 3 years, 1 month ago
Andrew Cooper writes ("[PATCH for-4.15] tools/libxendevicemodel: Strip __XEN_TOOLS__ header guard"):
> This is inappropriate for the header file of a standalone library with stable
> API and ABI.

wat

> Discovered when trying to actually remove the use of unstable libraries from a
> trivial userspace emulator.  Current users of xendevicemodel.h inherit
> __XEN_TOOLS__ from libxenctrl.h (or equiv).

Release-Acked-by: Ian Jackson <iwj@xenproject.org>