x86/hvm/ioreq: maintain an array of ioreq servers rather than a list
authorPaul Durrant <paul.durrant@citrix.com>
Wed, 21 Mar 2018 14:00:37 +0000 (14:00 +0000)
committerWei Liu <wei.liu2@citrix.com>
Tue, 3 Apr 2018 15:55:08 +0000 (16:55 +0100)
commit97a5a3e3016133334dc3200dfb04b142fbce9f59
tree0e740621f7b1b15023627a28929a2f445a529ebc
parent0efb20b6548936350609a0ee8abb9cef7eab18af
x86/hvm/ioreq: maintain an array of ioreq servers rather than a list

A subsequent patch will remove the current implicit limitation on creation
of ioreq servers which is due to the allocation of gfns for the ioreq
structures and buffered ioreq ring.

It will therefore be necessary to introduce an explicit limit and, since
this limit should be small, it simplifies the code to maintain an array of
that size rather than using a list.

Also, by reserving an array slot for the default server and populating
array slots early in create, the need to pass an 'is_default' boolean
to sub-functions can be avoided.

Some function return values are changed by this patch: Specifically, in
the case where the id of the default ioreq server is passed in, -EOPNOTSUPP
is now returned rather than -ENOENT.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/ioreq.c
xen/include/asm-x86/hvm/domain.h