]> xenbits.xensource.com Git - xen.git/commitdiff
domctl: return EEXIST from XEN_DOMCTL_createdomain...
authorPaul Durrant <pdurrant@amazon.com>
Fri, 3 Jan 2020 16:06:57 +0000 (17:06 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 3 Jan 2020 16:06:57 +0000 (17:06 +0100)
...if a specified domid is already in use.

XEN_DOMCTL_createdomain allows a domid to be specified by its caller and
will correctly fail if that domid is already in use. However the errno
returned in this case will be EINVAL, making it indistinguishable from
several other failures. Also a value of EINVAL does not seem appropriate
as the specified domid is valid [1] but just not (transiently) available.

[1] any invalid value passed in is ignored and causes Xen to choose an
    unused and valid value.

Signed-off-by: Paul Durrant <pdurrant@amazon.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
xen/common/domctl.c

index 03d022603979c1e6771362b64d392b6248460de8..650310e8742646d663250873c9351a75966e201b 100644 (file)
@@ -504,7 +504,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
         dom = op->domain;
         if ( (dom > 0) && (dom < DOMID_FIRST_RESERVED) )
         {
-            ret = -EINVAL;
+            ret = -EEXIST;
             if ( !is_free_domid(dom) )
                 break;
         }