@@ -305,7 +305,7 @@ static void cf_check dump_domains(unsigned char key)
for ( i = 0 ; i < NR_DOMAIN_WATCHDOG_TIMERS; i++ )
if ( test_bit(i, &d->watchdog_inuse_map) )
printk(" watchdog %d expires in %d seconds\n",
- i, (u32)((d->watchdog_timer[i].expires - NOW()) >> 30));
+ i, (u32)((d->watchdog_timer[i].timer.expires - NOW()) >> 30));
arch_dump_domain_info(d);
@@ -1556,7 +1556,8 @@ static long domain_watchdog(struct domain *d, uint32_t id, uint32_t timeout)
{
if ( test_and_set_bit(id, &d->watchdog_inuse_map) )
continue;
- set_timer(&d->watchdog_timer[id], NOW() + SECONDS(timeout));
+ d->watchdog_timer[id].timeout = timeout;
+ set_timer(&d->watchdog_timer[id].timer, NOW() + SECONDS(timeout));
break;
}
spin_unlock(&d->watchdog_lock);
@@ -1572,12 +1573,12 @@ static long domain_watchdog(struct domain *d, uint32_t id, uint32_t timeout)
if ( timeout == 0 )
{
- stop_timer(&d->watchdog_timer[id]);
+ stop_timer(&d->watchdog_timer[id].timer);
clear_bit(id, &d->watchdog_inuse_map);
}
else
{
- set_timer(&d->watchdog_timer[id], NOW() + SECONDS(timeout));
+ set_timer(&d->watchdog_timer[id].timer, NOW() + SECONDS(timeout));
}
spin_unlock(&d->watchdog_lock);
@@ -1593,7 +1594,7 @@ void watchdog_domain_init(struct domain *d)
d->watchdog_inuse_map = 0;
for ( i = 0; i < NR_DOMAIN_WATCHDOG_TIMERS; i++ )
- init_timer(&d->watchdog_timer[i], domain_watchdog_timeout, d, 0);
+ init_timer(&d->watchdog_timer[i].timer, domain_watchdog_timeout, d, 0);
}
void watchdog_domain_destroy(struct domain *d)
@@ -1601,7 +1602,7 @@ void watchdog_domain_destroy(struct domain *d)
unsigned int i;
for ( i = 0; i < NR_DOMAIN_WATCHDOG_TIMERS; i++ )
- kill_timer(&d->watchdog_timer[i]);
+ kill_timer(&d->watchdog_timer[i].timer);
}
/*
@@ -24,6 +24,7 @@
#include <asm/current.h>
#include <xen/vpci.h>
#include <xen/wait.h>
+#include <xen/watchdog.h>
#include <public/xen.h>
#include <public/domctl.h>
#include <public/sysctl.h>
@@ -569,7 +570,7 @@ struct domain
#define NR_DOMAIN_WATCHDOG_TIMERS 2
spinlock_t watchdog_lock;
uint32_t watchdog_inuse_map;
- struct timer watchdog_timer[NR_DOMAIN_WATCHDOG_TIMERS];
+ struct watchdog_timer watchdog_timer[NR_DOMAIN_WATCHDOG_TIMERS];
struct rcu_head rcu;
@@ -8,6 +8,12 @@
#define __XEN_WATCHDOG_H__
#include <xen/types.h>
+#include <xen/timer.h>
+
+struct watchdog_timer {
+ struct timer timer;
+ uint32_t timeout;
+};
#ifdef CONFIG_WATCHDOG