]> xenbits.xensource.com Git - people/sstabellini/xen-unstable.git/.git/commit
tools: Pass max_vcpus to XEN_DOMCTL_createdomain
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 27 Feb 2018 17:39:37 +0000 (17:39 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 31 Aug 2018 11:06:53 +0000 (12:06 +0100)
commit4737fa52ce868b51a97bd4f6ee932e040cb103bf
treefc8bdf7ca804fe3b715fb116011488837d5afe7c
parent580c458699e367bf427967844fa79086b60da675
tools: Pass max_vcpus to XEN_DOMCTL_createdomain

XEN_DOMCTL_max_vcpus is a mandatory hypercall, but nothing actually prevents a
toolstack from unpausing a domain with no vcpus.

Originally, d->vcpus[] was an embedded array in struct domain, but c/s
fb442e217 "x86_64: allow more vCPU-s per guest" in Xen 4.0 altered it to being
dynamically allocated.  A side effect of this is that d->vcpu[] is NULL until
XEN_DOMCTL_max_vcpus has completed, but a lot of hypercalls blindly
dereference it.

Even today, the behaviour of XEN_DOMCTL_max_vcpus is a mandatory singleton
call which can't change the number of vcpus once a value has been chosen.

In preparation to remote the hypercall, extend xen_domctl_createdomain with
the a max_vcpus field and arrange for all callers to pass the appropriate
value.  There is no change in construction behaviour yet, but later patches
will rearrange the hypervisor internals.

For the python stubs, extend the domain_create keyword list to take a
max_vcpus parameter, in lieu of deleting the pyxc_domain_max_vcpus function.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Acked-by: Christian Lindig <christian.lindig@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
tools/helpers/init-xenstore-domain.c
tools/libxl/libxl_create.c
tools/ocaml/libs/xc/xenctrl.ml
tools/ocaml/libs/xc/xenctrl.mli
tools/ocaml/libs/xc/xenctrl_stubs.c
tools/python/xen/lowlevel/xc/xc.c
xen/include/public/domctl.h