From 53e9d118042bbcf5b82b1b077e6816601050ea3e Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Fri, 14 Oct 2011 18:08:04 +0100 Subject: Return -EINVAL when trying to kick/kill a nonexistent domain watchdog ... to be more in-line with the NR_DOMAIN_WATCHDOG_TIMERS check at the top of domain_watchdog(), and also to follow the timer_(delete|settime) POSIX API's EINVAL return value. Signed-off-by: Laszlo Ersek Also, replace EEXIST with ENOSPC when failing to allocate a new domain watchdog. Signed-off-by: Keir Fraser Committed-by: Keir Fraser --- xen/common/schedule.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'xen/common/schedule.c') diff --git a/xen/common/schedule.c b/xen/common/schedule.c index e909eec39d..95150c3149 100644 --- a/xen/common/schedule.c +++ b/xen/common/schedule.c @@ -754,14 +754,14 @@ static long domain_watchdog(struct domain *d, uint32_t id, uint32_t timeout) break; } spin_unlock(&d->watchdog_lock); - return id == NR_DOMAIN_WATCHDOG_TIMERS ? -EEXIST : id + 1; + return id == NR_DOMAIN_WATCHDOG_TIMERS ? -ENOSPC : id + 1; } id -= 1; if ( !test_bit(id, &d->watchdog_inuse_map) ) { spin_unlock(&d->watchdog_lock); - return -EEXIST; + return -EINVAL; } if ( timeout == 0 ) -- cgit v1.2.3