All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony PERARD <anthony@xenproject.org>
To: Mykola Kvach <xakep.amatop@gmail.com>
Cc: xen-devel@lists.xenproject.org,
	Mykola Kvach <mykola_kvach@epam.com>,
	Anthony PERARD <anthony.perard@vates.tech>
Subject: Re: [PATCH v2] systemd: Add hooks to stop/start xen-watchdog on suspend/resume
Date: Fri, 25 Jul 2025 16:04:18 +0200	[thread overview]
Message-ID: <aIOO4kNKM1cyn6Hf@l14> (raw)
In-Reply-To: <b44966513abc729f44795c0d5012e1c5fd106477.1752783296.git.mykola_kvach@epam.com>

On Thu, Jul 17, 2025 at 11:16:58PM +0300, Mykola Kvach wrote:
> diff --git a/m4/systemd.m4 b/m4/systemd.m4
> index ab12ea313d..ee684d3391 100644
> --- a/m4/systemd.m4
> +++ b/m4/systemd.m4
> @@ -28,6 +28,12 @@ AC_DEFUN([AX_SYSTEMD_OPTIONS], [
>  		[set directory for systemd modules load files [PREFIX/lib/modules-load.d/]]),
>  		[SYSTEMD_MODULES_LOAD="$withval"], [SYSTEMD_MODULES_LOAD=""])
>  	AC_SUBST(SYSTEMD_MODULES_LOAD)
> +
> +	AC_ARG_WITH(systemd-sleep,
> +		AS_HELP_STRING([--with-systemd-sleep=DIR],
> +		[set directory for systemd sleep script files [PREFIX/lib/systemd/system-sleep/]]),
> +		[SYSTEMD_SLEEP_DIR="$withval"], [SYSTEMD_SLEEP_DIR=""])
> +	AC_SUBST(SYSTEMD_SLEEP_DIR)
>  ])
>  
>  AC_DEFUN([AX_ENABLE_SYSTEMD_OPTS], [
> @@ -69,6 +75,14 @@ AC_DEFUN([AX_CHECK_SYSTEMD_LIBS], [
>  	AS_IF([test "x$SYSTEMD_MODULES_LOAD" = x], [
>  	    AC_MSG_ERROR([SYSTEMD_MODULES_LOAD is unset])
>  	], [])
> +
> +	AS_IF([test "x$SYSTEMD_SLEEP_DIR" = x], [
> +	    SYSTEMD_SLEEP_DIR="\$(prefix)/lib/systemd/system-sleep/"

While reading this change, and systemd.m4, I notice a comment about
using pkg-config, well it's a comment about using it for $SYSTEMD_DIR,
but I believe it applies here too. It looks like we can replace this
hard-coded path by:

    PKG_CHECK_VAR([SYSTEMD_SLEEP_DIR], [systemd], [systemdsleepdir])

Which will query system-sleep path from the system. (This just run
`pkg-config --variable=systemdsleepdir systemd`, and store the result in
SYSTEMD_SLEEP_DIR) (The variable is now named "systemd_sleep_dir", but the
variable name without underscore is still available, and have been
available for longer.)

Is using PKG_CHECK_VAR would be fine with you?

> +	], [])
> +
> +	AS_IF([test "x$SYSTEMD_SLEEP_DIR" = x], [
> +	    AC_MSG_ERROR([SYSTEMD_SLEEP_DIR is unset])
> +	], [])

After changing to use PKG_CHECK_VAR, I think this patch would be good to
go, so: Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>
I can make the change on commit if that's ok.

And I need to remember to run `./autogen.sh` to regen the configure
scripts.

Thanks,

-- 
Anthony PERARD


  reply	other threads:[~2025-07-25 14:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-17 20:16 [PATCH v2] systemd: Add hooks to stop/start xen-watchdog on suspend/resume Mykola Kvach
2025-07-25 14:04 ` Anthony PERARD [this message]
2025-07-26  5:39   ` Mykola Kvach
2025-07-26 21:02 ` dmkhn
2025-08-05 16:30 ` Andrew Cooper
2025-12-04 23:48 ` [REGRESSION] " Andrew Cooper
2025-12-05 12:41   ` Mykola Kvach
2025-12-05 13:18   ` Mykola Kvach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aIOO4kNKM1cyn6Hf@l14 \
    --to=anthony@xenproject.org \
    --cc=anthony.perard@vates.tech \
    --cc=mykola_kvach@epam.com \
    --cc=xakep.amatop@gmail.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.