diff mbox series

[v6,3/6] public/xen.h: add a definition for a 'valid domid' mask

Message ID 20200219093754.2924-4-pdurrant@amazon.com (mailing list archive)
State Superseded
Headers show
Series xl/libxl: domid allocation/preservation changes | expand

Commit Message

Paul Durrant Feb. 19, 2020, 9:37 a.m. UTC
A subsequent patch will modify libxl to allow selection of a random domid
value when creating domains. Valid values are limited to a width of 15 bits,
so add an appropriate mask definition to the public header.

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>

v6:
 - New in v6 (split out from another patch)
---
 xen/include/public/xen.h | 3 +++
 1 file changed, 3 insertions(+)

Comments

Ian Jackson Feb. 20, 2020, 4:22 p.m. UTC | #1
Paul Durrant writes ("[PATCH v6 3/6] public/xen.h: add a definition for a 'valid domid' mask"):
> A subsequent patch will modify libxl to allow selection of a random domid
> value when creating domains. Valid values are limited to a width of 15 bits,
> so add an appropriate mask definition to the public header.

This is fine by me but I wonder if hypervisor maintainers would like
more rationale.

In the conversation where I asked you to split this out I wrote:

> >   This is useful for programs which need to [explanation],
> >   including for example, libxl, which is going to want to
> >   randomly generate domids.
> > 
> > Maybe it needs some explanation of why this belongs in the Xen
> > public headers rather than in some header available to libxc,
> > libxl and other tools stuff ?

Your commit message seems to me to explain the former but not the
latter.  I don't know if hypervisor maintainers want the latter.

Anyway,

Reviewed-by: Ian Jackson <ian.jackson@eu.citrix.com>

Thanks,
Ian.
diff mbox series

Patch

diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h
index d2198dffad..75b1619d0d 100644
--- a/xen/include/public/xen.h
+++ b/xen/include/public/xen.h
@@ -614,6 +614,9 @@  DEFINE_XEN_GUEST_HANDLE(mmuext_op_t);
 /* Idle domain. */
 #define DOMID_IDLE           xen_mk_uint(0x7FFF)
 
+/* Mask for valid domain id values */
+#define DOMID_MASK           xen_mk_uint(0x7FFF)
+
 #ifndef __ASSEMBLY__
 
 typedef uint16_t domid_t;