7d47251 Iterate /sys/bus/ccwgroup/devices to tell if we should set up rd.znet

1 file Authored by coiby 2 years ago, Committed by kasong 2 years ago,
    Iterate /sys/bus/ccwgroup/devices to tell if we should set up rd.znet
    
    This patch fixes bz1941106 and bz1941905 which passed empty rd.znet to the
    kernel command line in the following cases,
     - The IBM (Z15) KVM guest uses virtio for all devices including network
       device, so there is no znet device for IBM KVM guest. So we can't
       assume a s390x machine always has a znet device.
     - When a bridged network is used, kexec-tools tries to obtain the znet
       configuration from the ifcfg script of the bridged network rather than
       from the ifcfg script of znet device.
    
    We can iterate /sys/bus/ccwgroup/devices to tell if there if there is
    a znet network device. By getting an ifname from znet, we can also avoid
    mistaking the slave netdev as a znet network device in a bridged network
    or bonded network.
    
    Note: This patch also assumes there is only one znet device as commit
    7148c0a30dfc48221eadf255e8a89619f98a8752 ("add s390x netdev setup")
    which greatly simplifies the code. According to IBM [1], there could be
    more than znet devices for a z/VM system and a z/VM system may have a
    non-znet network device like ConnectX. Since kdump_setup_znet was
    introduced in 2012 and so far there is no known customer complaint that
    invalidates this assumption I think it's safe to assume an IBM z/VM
    system only has one znet device. Besides, there is no z/VM system found
    on beaker to test the alternative scenarios.
    
    [1] https://bugzilla.redhat.com/show_bug.cgi?id=1941905#c13
    
    Signed-off-by: Coiby Xu <coxu@redhat.com>
    Acked-by: Kairui Song <kasong@redhat.com>
    
        
file modified
+33 -2