device: add support for parent devices

This allows device nesting, i.e. one device being opened inside another
one.
This commit is contained in:
Christian Kellner 2021-08-09 16:16:45 +02:00 committed by Tom Gundersen
parent 6ea5ce1836
commit 45d0594b1b
7 changed files with 128 additions and 11 deletions

View file

@ -45,10 +45,10 @@ def test_loopback_basic(tmpdir):
"size": size // 512 # size is in sectors / blocks
}
dev = devices.Device("loop", info, options)
dev = devices.Device("loop", info, None, options)
with host.ServiceManager() as mgr:
reply = dev.open(mgr, devpath, tree)
reply = dev.open(mgr, devpath, None, tree)
assert reply
assert reply["path"]