diff options
| author | Lubomir Rintel <lkundrak@v3.sk> | 2018-11-06 16:05:37 +0100 |
|---|---|---|
| committer | Lubomir Rintel <lkundrak@v3.sk> | 2018-11-07 14:50:21 +0100 |
| commit | 32857a093b3ee4aca44e94dbf06f57fbd43d01cc (patch) | |
| tree | 410314e4fb15ae5328e228414f2c74b3d007c6a1 /contrib | |
| parent | bbb1a36020ff68865bfd55d8f387d6dba447e4d7 (diff) | |
| download | NetworkManager-32857a093b3ee4aca44e94dbf06f57fbd43d01cc.tar.gz | |
modemu: fall back to a virtual bus
This allows us to somehow work with no PCI (or USB for that matter), such
as some virtual machines. Old ModemManager doesn't like this though, but
there doesn't seem to be a way around it.
https://github.com/NetworkManager/NetworkManager/pull/246
Diffstat (limited to 'contrib')
| -rwxr-xr-x | contrib/test/modemu.pl | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/contrib/test/modemu.pl b/contrib/test/modemu.pl index e8ed116c38..27a4d28a5a 100755 --- a/contrib/test/modemu.pl +++ b/contrib/test/modemu.pl @@ -121,8 +121,16 @@ sub send_netlink die "Can't send a netlink message: $!" if $! and not $!{ECONNREFUSED}; } +my $devpath = '/devices/pci0000:00/0000:00:00.0'; +unless (-d "/sys/$devpath") { + # Create a virtual device. Older ModemManager likes a hotpluggable bus + # (USB, PCI), but there's none on an IBM POWER lpar... + warn "No PCI bus to use for parent. Don't expect this to work with ModemManager 1.6"; + $devpath = '/devices/virtual'; +} + my %props = ( - DEVPATH => "/devices/pci0000:00/0000:00:00.0/$name", + DEVPATH => "$devpath/$name", SUBSYSTEM => 'tty', DEVNAME => "/dev/$name", |
