Dan Kenigsberg has submitted this change and it was merged. Change subject: hostdev: move pci device code to separate class ......................................................................
hostdev: move pci device code to separate class At present, we use a single class to contain all three host devices - PCI, USB and SCSI. Although they look mostly the same at first, there are multiple hidden differences between the devices. The differences range from simple XML inconsistency to a critical driver specific requirements. The patch itself does not improve the code, possibly makes it worse by itself because it only extracts PCI device related code to standalone class but, does not use the class anywhere. Idea behind this approach is that we can safely isolate device code for each device without breaking the generic hostdev code we have now. When the devices are separated, we can dynamically create appropriate class from HostDevice "factory". The end result is slight code duplication (not really avoidable in devices) but extreme readability improvement. Examples of device differences: * different padding and base in libvirt addressing for PCI and USB, SCSI, * no guest address for USB devices is generated by libvirt, * SCSI is addressed by it's source address and adapter, as opposed to source address only in PCI and USB[1], * PCI devices should not be reattached, other devices should[2], * XML itself. [1] Implies unfortunate bug that SCSI host devices can't be hot-plugged. [2] This is true only because reattach, in it's current version, does more then just reattach the device. It modifies the permissions on the udev device by creating udev rule. Change-Id: I6bceb93c2434ff827406bbf4ee0af30f5726f6af Signed-off-by: Martin Polednik <mpoled...@redhat.com> Reviewed-on: https://gerrit.ovirt.org/57956 Reviewed-by: Milan Zamazal <mzama...@redhat.com> Continuous-Integration: Jenkins CI Reviewed-by: Francesco Romani <from...@redhat.com> --- M vdsm/virt/vmdevices/hostdevice.py 1 file changed, 114 insertions(+), 0 deletions(-) Approvals: Jenkins CI: Passed CI tests Francesco Romani: Looks good to me, approved Martin Polednik: Verified Milan Zamazal: Looks good to me, but someone else must approve -- To view, visit https://gerrit.ovirt.org/57956 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6bceb93c2434ff827406bbf4ee0af30f5726f6af Gerrit-PatchSet: 16 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik <mpoled...@redhat.com> Gerrit-Reviewer: Dan Kenigsberg <dan...@redhat.com> Gerrit-Reviewer: Francesco Romani <from...@redhat.com> Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Martin Betak <mbe...@redhat.com> Gerrit-Reviewer: Martin Polednik <mpoled...@redhat.com> Gerrit-Reviewer: Milan Zamazal <mzama...@redhat.com> Gerrit-Reviewer: Tomas Golembiovsky <tgole...@redhat.com> Gerrit-Reviewer: gerrit-hooks <automat...@ovirt.org> _______________________________________________ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/admin/lists/vdsm-patches@lists.fedorahosted.org