One usage of function domain_resume() is in domain resume domctl-op, and
the other is in domain_soft_reset(), which is already guarded with
CONFIG_MGMT_HYPERCALLS.
So we could wrap domain_resume() with CONFIG_MGMT_HYPERCALLS. Otherwise
it will become unreachable codes when MGMT_HYPERCALLS=n and hence violating
Misra rule 2.1.
Signed-off-by: Penny Zheng <Penny.Zheng@amd.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
---
v1 -> v2:
- new commit
---
v2 -> v3:
- remove transient wrapping around XEN_DOMCTL_resumedomain-case
- address "violating Misra rule 2.1" in commit message
---
xen/common/domain.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 678e81b400..34e2e501dc 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -1351,6 +1351,7 @@ int domain_shutdown(struct domain *d, u8 reason)
return 0;
}
+#ifdef CONFIG_MGMT_HYPERCALLS
void domain_resume(struct domain *d)
{
struct vcpu *v;
@@ -1377,6 +1378,7 @@ void domain_resume(struct domain *d)
domain_unpause(d);
}
+#endif /* CONFIG_MGMT_HYPERCALLS */
int vcpu_start_shutdown_deferral(struct vcpu *v)
{
--
2.34.1