Skip to contentSkip to conversation

xen/common: Guard freeze/thaw_domains functions with CONFIG_SYSTEM_SUSPEND

PATCH Superseded Mykola Kvach 2 participants 2 messages Jun 24, 2025

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/common: Guard freeze/thaw_domains functions with CONFIG_SYSTEM_SUSPEND

From: Mykola Kvach <[email protected]>

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.

---
 xen/common/domain.c | 4 ++++
 1 file changed, 4 insertions(+)
xen/common/domain.c +4 -0
index 8c8f70347a..303c338ef2 100644
@@ -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
Signature · 1 line
2.48.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Mykola Kvach

From: Mykola Kvach <[email protected]>

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.

Quoted 1 line

With the addition (happy to add while committing)

Jan