From: Mykola Kvach <mykola_kvach@epam.com>
The "xl resume" command was previously excluded from Arm builds because
system suspend/resume (e.g., SYSTEM_SUSPEND via vPSCI) was not
implemented. On x86, this command is used for resume.
This change enables compilation of `xl resume` on Arm regardless of the
underlying implementation status, making the tool available for testing
and future feature support. The relevant libxl infrastructure and handler
functions are already present and usable.
Note: This does not imply full system suspend/resume support on Arm.
The `xl suspend` command still does not work on Arm platforms.
Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
---
Changes in v7:
- dropped renaming of LIBXL_HAVE_NO_SUSPEND_RESUME macro
Changes in v6:
- Renamed macro from LIBXL_HAVE_NO_SUSPEND_RESUME to LIBXL_HAVE_NO_SUSPEND
to better reflect the scope of this change
- Applied cosmetic changes based on review feedback
---
tools/include/libxl.h | 1 -
tools/xl/xl.h | 4 ++--
tools/xl/xl_cmdtable.c | 4 ++--
tools/xl/xl_migrate.c | 2 +-
tools/xl/xl_saverestore.c | 2 +-
tools/xl/xl_vmcontrol.c | 12 ++++++------
6 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/tools/include/libxl.h b/tools/include/libxl.h
index d6b6e5d2dd..94fc0354be 100644
--- a/tools/include/libxl.h
+++ b/tools/include/libxl.h
@@ -1134,7 +1134,6 @@ typedef struct libxl__ctx libxl_ctx;
* restoring or migrating a domain. In this case the related functions
* should be expected to return failure. That is:
* - libxl_domain_suspend
- * - libxl_domain_resume
* - libxl_domain_remus_start
*/
#if defined(__arm__) || defined(__aarch64__)
diff --git a/tools/xl/xl.h b/tools/xl/xl.h
index 45745f0dbb..9233b73f85 100644
--- a/tools/xl/xl.h
+++ b/tools/xl/xl.h
@@ -65,7 +65,7 @@ static const char migrate_permission_to_go[]=
"domain is yours, you are cleared to unpause";
static const char migrate_report[]=
"my copy unpause results are as follows";
-#endif
+#endif /* !LIBXL_HAVE_NO_SUSPEND_RESUME */
/* followed by one byte:
* 0: everything went well, domain is running
@@ -130,8 +130,8 @@ int main_migrate_receive(int argc, char **argv);
int main_save(int argc, char **argv);
int main_migrate(int argc, char **argv);
int main_suspend(int argc, char **argv);
+#endif /* !LIBXL_HAVE_NO_SUSPEND_RESUME */
int main_resume(int argc, char **argv);
-#endif
int main_dump_core(int argc, char **argv);
int main_pause(int argc, char **argv);
int main_unpause(int argc, char **argv);
diff --git a/tools/xl/xl_cmdtable.c b/tools/xl/xl_cmdtable.c
index 06a0039718..bcb2d233cc 100644
--- a/tools/xl/xl_cmdtable.c
+++ b/tools/xl/xl_cmdtable.c
@@ -198,12 +198,12 @@ const struct cmd_spec cmd_table[] = {
"Suspend a domain to RAM",
"<Domain>",
},
+#endif /* !LIBXL_HAVE_NO_SUSPEND_RESUME */
{ "resume",
&main_resume, 0, 1,
"Resume a domain from RAM",
"<Domain>",
},
-#endif
{ "dump-core",
&main_dump_core, 0, 1,
"Core dump a domain",
@@ -548,7 +548,7 @@ const struct cmd_spec cmd_table[] = {
" checkpoint must be disabled.\n"
"-p Use COLO userspace proxy."
},
-#endif
+#endif /* !LIBXL_HAVE_NO_SUSPEND_RESUME */
{ "devd",
&main_devd, 0, 1,
"Daemon that listens for devices and launches backends",
diff --git a/tools/xl/xl_migrate.c b/tools/xl/xl_migrate.c
index b8594f44a5..4b4a379aa1 100644
--- a/tools/xl/xl_migrate.c
+++ b/tools/xl/xl_migrate.c
@@ -767,7 +767,7 @@ int main_remus(int argc, char **argv)
close(send_fd);
return EXIT_FAILURE;
}
-#endif
+#endif /* !LIBXL_HAVE_NO_SUSPEND_RESUME */
/*
diff --git a/tools/xl/xl_saverestore.c b/tools/xl/xl_saverestore.c
index 953d791d1a..747094ec7b 100644
--- a/tools/xl/xl_saverestore.c
+++ b/tools/xl/xl_saverestore.c
@@ -270,7 +270,7 @@ int main_save(int argc, char **argv)
return EXIT_SUCCESS;
}
-#endif /* LIBXL_HAVE_NO_SUSPEND_RESUME */
+#endif /* !LIBXL_HAVE_NO_SUSPEND_RESUME */
diff --git a/tools/xl/xl_vmcontrol.c b/tools/xl/xl_vmcontrol.c
index c813732838..93766f631b 100644
--- a/tools/xl/xl_vmcontrol.c
+++ b/tools/xl/xl_vmcontrol.c
@@ -38,11 +38,6 @@ static void suspend_domain(uint32_t domid)
libxl_domain_suspend_only(ctx, domid, NULL);
}
-static void resume_domain(uint32_t domid)
-{
- libxl_domain_resume(ctx, domid, 1, NULL);
-}
-
int main_suspend(int argc, char **argv)
{
int opt;
@@ -55,6 +50,12 @@ int main_suspend(int argc, char **argv)
return EXIT_SUCCESS;
}
+#endif /* !LIBXL_HAVE_NO_SUSPEND_RESUME */
+
+static void resume_domain(uint32_t domid)
+{
+ libxl_domain_resume(ctx, domid, 1, NULL);
+}
int main_resume(int argc, char **argv)
{
@@ -68,7 +69,6 @@ int main_resume(int argc, char **argv)
return EXIT_SUCCESS;
}
-#endif
static void pause_domain(uint32_t domid)
{
--
2.48.1
On Tue, Jul 29, 2025 at 11:52:12AM +0300, Mykola Kvach wrote: > From: Mykola Kvach <mykola_kvach@epam.com> > > The "xl resume" command was previously excluded from Arm builds because > system suspend/resume (e.g., SYSTEM_SUSPEND via vPSCI) was not > implemented. On x86, this command is used for resume. > > This change enables compilation of `xl resume` on Arm regardless of the > underlying implementation status, making the tool available for testing > and future feature support. The relevant libxl infrastructure and handler > functions are already present and usable. > > Note: This does not imply full system suspend/resume support on Arm. > The `xl suspend` command still does not work on Arm platforms. > > Signed-off-by: Mykola Kvach <mykola_kvach@epam.com> > --- > Changes in v7: > - dropped renaming of LIBXL_HAVE_NO_SUSPEND_RESUME macro Acked-by: Anthony PERARD <anthony.perard@vates.tech> Thanks, -- Anthony PERARD
© 2016 - 2025 Red Hat, Inc.