s390x/css: Add an algorithm to find a free chpid
commit6c15e9bfb687f40cc92759536ef2a918fb04349b
authorJing Liu <liujbjl@linux.vnet.ibm.com>
Mon, 19 Sep 2016 07:10:43 +0000 (19 09:10 +0200)
committerCornelia Huck <cornelia.huck@de.ibm.com>
Thu, 4 May 2017 08:34:37 +0000 (4 10:34 +0200)
treed64cdf7abcede90f1a5709122e0886400a9c85ed
parentae92cbd542086a508343dd88fd3b980f3be1b3af
s390x/css: Add an algorithm to find a free chpid

This introduces a function named css_find_free_chpid() to find a
free channel path. Because virtio-ccw device used zero as its
channel path number, it would be sensible to skip the reserved one
and search upwards.

Signed-off-by: Jing Liu <liujbjl@linux.vnet.ibm.com>
Reviewed-by: QingFeng Hao <haoqf@linux.vnet.ibm.com>
Reviewed-by: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
hw/s390x/css.c
include/hw/s390x/css.h