diff mbox series

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

Message ID 20210304130319.10719-1-andrew.cooper3@citrix.com (mailing list archive)
State New, archived
Headers show
Series [for-4.15] tools/libxendevicemodel: Strip __XEN_TOOLS__ header guard | expand

Commit Message

Andrew Cooper March 4, 2021, 1:03 p.m. UTC
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(-)

Comments

Ian Jackson March 4, 2021, 1:42 p.m. UTC | #1
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>
Ian Jackson March 4, 2021, 2:14 p.m. UTC | #2
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>
Andrew Cooper March 4, 2021, 10:24 p.m. UTC | #3
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
diff mbox series

Patch

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 */
 
 /*