Return -EINVAL when trying to kick/kill a nonexistent domain watchdog
authorKeir Fraser <keir@xen.org>
Fri, 14 Oct 2011 17:08:04 +0000 (18:08 +0100)
committerKeir Fraser <keir@xen.org>
Fri, 14 Oct 2011 17:08:04 +0000 (18:08 +0100)
... 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 <lersek@redhat.com>
Also, replace EEXIST with ENOSPC when failing to allocate a new
domain watchdog.

Signed-off-by: Keir Fraser <keir@xen.org>
Committed-by: Keir Fraser <keir@xen.org>
xen/common/schedule.c

index e909eec39d2e763ee027267a1333ac442125af05..95150c3149a72542ef17714b9863dc8053049914 100644 (file)
@@ -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 )