On 17/05/2024 12:07 am, Marek Marczykowski-Górecki wrote: > On Thu, May 16, 2024 at 07:58:02PM +0100, Andrew Cooper wrote: >> ... in order to avoid linking against the whole of libsystemd. >> >> Only minimal changes to the upstream copy, to function as a drop-in >> replacement for sd_notify() and as a header-only library. > Maybe add explicit link to the original source?
Well, it is in the top of the file... > diff --git a/tools/include/xen-sd-notify.h > b/tools/include/xen-sd-notify.h new file mode 100644 index > 000000000000..eda9d8b22d9e --- /dev/null +++ > b/tools/include/xen-sd-notify.h @@ -0,0 +1,98 @@ +/* > SPDX-License-Identifier: MIT-0 */ + +/* + * Implement the systemd > notify protocol without external dependencies. + * Supports both > readiness notification on startup and on reloading, + * according to > the protocol defined at: + * > https://www.freedesktop.org/software/systemd/man/latest/sd_notify.html+ > * This protocol is guaranteed to be stable as per: + * > https://systemd.io/PORTABILITY_AND_STABILITY/+ * >> +static inline void xen_sd_closep(int *fd) { > Static inline is one of the changes vs upstream, and gitlab-ci is not > happy about it: > > /builds/xen-project/patchew/xen/tools/xenstored/../../tools/include/xen-sd-notify.h:45:3: > error: cleanup argument not a function > 45 | int __attribute__((cleanup(sd_closep))) fd = -1; > | ^~~ > Yes - victim of a last minute refactor. I've fixed it up locally. ~Andrew