[PATCH v2] xen/common: Guard freeze/thaw_domains functions with CONFIG_SYSTEM_SUSPEND

Mykola Kvach posted 1 patch 4 months, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/b7f35a20342dace6e107c4c358514c304f0bf0dd.1750753310.git.mykola._5Fkvach@epam.com
xen/common/domain.c | 4 ++++
1 file changed, 4 insertions(+)
[PATCH v2] xen/common: Guard freeze/thaw_domains functions with CONFIG_SYSTEM_SUSPEND
Posted by Mykola Kvach 4 months, 1 week ago
From: Mykola Kvach <mykola_kvach@epam.com>

This patch adds CONFIG_SYSTEM_SUSPEND guards around freeze_domains
and thaw_domains functions.

This ensures they are only compiled into the hypervisor when the system
suspend functionality is enabled, aligning their inclusion with their
specific use case.

This addresses two Misra Rule 2.1 violations.

Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
Changes in v2: Mentioned that this patch fixes a MISRA rule violation
in the commit message after review, and added the Reviewed-by tag
---
 xen/common/domain.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/common/domain.c b/xen/common/domain.c
index 8c8f70347a..303c338ef2 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -2411,6 +2411,8 @@ domid_t get_initial_domain_id(void)
     return 0;
 }
 
+#ifdef CONFIG_SYSTEM_SUSPEND
+
 void freeze_domains(void)
 {
     struct domain *d;
@@ -2436,6 +2438,8 @@ void thaw_domains(void)
     rcu_read_unlock(&domlist_read_lock);
 }
 
+#endif /* CONFIG_SYSTEM_SUSPEND */
+
 /*
  * Local variables:
  * mode: C
-- 
2.48.1