mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-22 01:21:53 -06:00
s390-bios: Extend find_dev() for non-virtio devices
We need a method for finding the subchannel of a dasd device. Let's modify find_dev to handle this since it mostly does what we need. Up to this point find_dev has been specific to only virtio devices. Signed-off-by: Jason J. Herne <jjherne@linux.ibm.com> Acked-by: Halil Pasic <pasic@linux.vnet.ibm.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Message-Id: <1554388475-18329-11-git-send-email-jjherne@linux.ibm.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
parent
86c58705bb
commit
930072d2bf
1 changed files with 11 additions and 5 deletions
|
@ -52,6 +52,12 @@ unsigned int get_loadparm_index(void)
|
||||||
return atoui(loadparm_str);
|
return atoui(loadparm_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Find the subchannel connected to the given device (dev_no) and fill in the
|
||||||
|
* subchannel information block (schib) with the connected subchannel's info.
|
||||||
|
* NOTE: The global variable blk_schid is updated to contain the subchannel
|
||||||
|
* information.
|
||||||
|
*/
|
||||||
static bool find_dev(Schib *schib, int dev_no)
|
static bool find_dev(Schib *schib, int dev_no)
|
||||||
{
|
{
|
||||||
int i, r;
|
int i, r;
|
||||||
|
@ -65,15 +71,15 @@ static bool find_dev(Schib *schib, int dev_no)
|
||||||
if (!schib->pmcw.dnv) {
|
if (!schib->pmcw.dnv) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!virtio_is_supported(blk_schid)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
/* Skip net devices since no IPLB is created and therefore no
|
/* Skip net devices since no IPLB is created and therefore no
|
||||||
* no network bootloader has been loaded
|
* network bootloader has been loaded
|
||||||
*/
|
*/
|
||||||
if (virtio_get_device_type() == VIRTIO_ID_NET && dev_no < 0) {
|
if (virtio_is_supported(blk_schid) &&
|
||||||
|
virtio_get_device_type() == VIRTIO_ID_NET && dev_no < 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((dev_no < 0) || (schib->pmcw.dev == dev_no)) {
|
if ((dev_no < 0) || (schib->pmcw.dev == dev_no)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue