Dan Kenigsberg has posted comments on this change.
Change subject: virt: devices: move device creation in a submodule ......................................................................
Patch Set 5: Code-Review-1
(1 comment)
https://gerrit.ovirt.org/#/c/38077/5//COMMIT_MSG Commit Message:
Line 6: Line 7: virt: devices: move device creation in a submodule Line 8: Line 9: In the Vm class, the vm devices are arranged in a Line 10: tree-like structure. the vmdevice object are kept in lists per device type, held together in a dictionary.
This is a very degenerate kind of tree. Its tree-ness is nothing more than an easy way to access all devices of a specicic type. It has nothing to do with device tree a-la libvirt's nodedev.
I think that we should hide this implementation detail, rather than cast it into a module name. How about defining a vmdevcontainer class, with a function like iter_by_type()? I think this would prove a more future-proof approach. Line 11: This patch moves the related code into a new Line 12: hwtree module into the vmdevices subpackages. Line 13: Line 14: Change-Id: If17cce15f653843848eea42b567a0e4454757cd1