From 7b4630f16f2c8bc15f2c6aa43bc9c2da67f63912 Mon Sep 17 00:00:00 2001 From: Cathy Avery Date: Tue, 13 Nov 2012 10:05:58 -0500 Subject: [PATCH] Added suspend and resume support Orabug: 14801157 The ovmapi driver was not supporting power management suspend and resume and therefore was not supporting vm migration. Added call backs to support syscore_ops suspend and resume. Signed-off-by: Cathy Avery --- drivers/xen/ovmapi.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/drivers/xen/ovmapi.c b/drivers/xen/ovmapi.c index a44a98371d6fc..09470b63a77de 100644 --- a/drivers/xen/ovmapi.c +++ b/drivers/xen/ovmapi.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -54,6 +55,7 @@ static struct kmem_cache *event_cache; static struct notifier_block xenstore_notifier; static struct ovmapi_information ovmapi_info; + #define DGBLVL_OFF 0 #define DGBLVL_ERROR 1 #define DGBLVL_WARNING 2 @@ -1074,6 +1076,28 @@ static int ovmapi_init_watcher(struct notifier_block *notifier, return NOTIFY_DONE; } +static int ovmapi_syscore_suspend(void) +{ + + return 0; +} + + +static void ovmapi_syscore_resume(void) +{ + + + ovmapi_info.last_read_message = 0; + ovmapi_info.last_write_message = 0; + + +} + +static struct syscore_ops ovmapi_syscore_ops = { + .suspend = ovmapi_syscore_suspend, + .resume = ovmapi_syscore_resume, +}; + static const struct file_operations ovmapi_fops = { .owner = THIS_MODULE, .open = ovmapi_open, @@ -1103,6 +1127,7 @@ static int __init ovmapi_init(void) return ret; } + name_cache = kmem_cache_create("name_cache", OVMM_MAX_NAME_LEN, 0, 0, NULL); value_cache = kmem_cache_create("value_cache", OVMM_MAX_VALUE_LEN, @@ -1122,6 +1147,7 @@ static int __init ovmapi_init(void) xenstore_notifier.notifier_call = ovmapi_init_watcher; ovmapi_info.event_counter = 0; register_xenstore_notifier(&xenstore_notifier); + register_syscore_ops(&ovmapi_syscore_ops); return 0; } -- 2.50.1