Jan Beulich
2012-Sep-11 12:48 UTC
[PATCH 3/3] x86/hvm: mark save/restore registration code __init
Signed-off-by: Jan Beulich <jbeulich@suse.com>
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -995,7 +995,7 @@ static int hvm_load_cpu_xsave_states(str
/* We need variable length data chunk for xsave area, hence customized
* declaration other than HVM_REGISTER_SAVE_RESTORE.
*/
-static int __hvm_register_CPU_XSAVE_save_and_restore(void)
+static int __init __hvm_register_CPU_XSAVE_save_and_restore(void)
{
hvm_register_savevm(CPU_XSAVE_CODE,
"CPU_XSAVE",
--- a/xen/common/hvm/save.c
+++ b/xen/common/hvm/save.c
@@ -40,11 +40,11 @@ static struct {
} hvm_sr_handlers [HVM_SAVE_CODE_MAX + 1] = {{NULL, NULL,
"<?>"},};
/* Init-time function to add entries to that list */
-void hvm_register_savevm(uint16_t typecode,
- const char *name,
- hvm_save_handler save_state,
- hvm_load_handler load_state,
- size_t size, int kind)
+void __init hvm_register_savevm(uint16_t typecode,
+ const char *name,
+ hvm_save_handler save_state,
+ hvm_load_handler load_state,
+ size_t size, int kind)
{
ASSERT(typecode <= HVM_SAVE_CODE_MAX);
ASSERT(hvm_sr_handlers[typecode].save == NULL);
--- a/xen/include/xen/hvm/save.h
+++ b/xen/include/xen/hvm/save.h
@@ -19,6 +19,7 @@
#define __XEN_HVM_SAVE_H__
#include <xen/types.h>
+#include <xen/init.h>
#include <public/xen.h>
#include <public/hvm/save.h>
@@ -108,7 +109,7 @@ void hvm_register_savevm(uint16_t typeco
/* Syntactic sugar around that function: specify the max number of
* saves, and this calculates the size of buffer needed */
#define HVM_REGISTER_SAVE_RESTORE(_x, _save, _load, _num, _k) \
-static int __hvm_register_##_x##_save_and_restore(void) \
+static int __init __hvm_register_##_x##_save_and_restore(void) \
{ \
hvm_register_savevm(HVM_SAVE_CODE(_x), \
#_x, \
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel