From: Paul Durrant <pdurrant@amazon.com>
To: <xen-devel@lists.xenproject.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
Julien Grall <julien@xen.org>, Wei Liu <wl@xen.org>,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
George Dunlap <George.Dunlap@eu.citrix.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Paul Durrant <pdurrant@amazon.com>,
Ian Jackson <ian.jackson@eu.citrix.com>,
Jan Beulich <jbeulich@suse.com>
Subject: [Xen-devel] [PATCH 3/6] domctl: return EEXIST from XEN_DOMCTL_createdomain...
Date: Tue, 24 Dec 2019 13:04:13 +0000 [thread overview]
Message-ID: <20191224130416.3570-4-pdurrant@amazon.com> (raw)
In-Reply-To: <20191224130416.3570-1-pdurrant@amazon.com>
...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>
---
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Julien Grall <julien@xen.org>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Wei Liu <wl@xen.org>
---
xen/common/domctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 03d0226039..650310e874 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -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;
}
--
2.20.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2019-12-24 13:05 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-24 13:04 [Xen-devel] [PATCH 0/6] xl/libxl: allow creation of domains with a specified domid Paul Durrant
2019-12-24 13:04 ` [Xen-devel] [PATCH 1/6] libxl: add definition of INVALID_DOMID to the API Paul Durrant
2020-01-02 17:18 ` Ian Jackson
2019-12-24 13:04 ` [Xen-devel] [PATCH 2/6] libxl_create: make 'soft reset' explicit Paul Durrant
2020-01-02 17:22 ` Ian Jackson
2019-12-24 13:04 ` Paul Durrant [this message]
2020-01-02 17:22 ` [Xen-devel] [PATCH 3/6] domctl: return EEXIST from XEN_DOMCTL_createdomain Ian Jackson
2019-12-24 13:04 ` [Xen-devel] [PATCH 4/6] domctl: set XEN_DOMCTL_createdomain 'rover' if valid domid is specified Paul Durrant
2020-01-02 17:25 ` Ian Jackson
2020-01-03 9:11 ` Durrant, Paul
2020-01-02 17:30 ` Andrew Cooper
2019-12-24 13:04 ` [Xen-devel] [PATCH 5/6] libxl: allow creation of domains with specified or random domid Paul Durrant
2020-01-02 17:27 ` Ian Jackson
2020-01-03 9:19 ` Durrant, Paul
2020-01-03 19:24 ` Jason Andryuk
2019-12-24 13:04 ` [Xen-devel] [PATCH 6/6] xl: allow specified domain id to be used for create, restore and migrate Paul Durrant
2020-01-02 17:29 ` Ian Jackson
2020-01-03 9:23 ` Durrant, Paul
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191224130416.3570-4-pdurrant@amazon.com \
--to=pdurrant@amazon.com \
--cc=George.Dunlap@eu.citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=konrad.wilk@oracle.com \
--cc=sstabellini@kernel.org \
--cc=wl@xen.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.