Change in vdsm[master]: hostdev/sr-iov: use device setup instead of detach

mzamazal at redhat.com mzamazal at redhat.com
Wed Apr 27 07:32:27 UTC 2016


Milan Zamazal has posted comments on this change.

Change subject: hostdev/sr-iov: use device setup instead of detach
......................................................................


Patch Set 13: Code-Review-1

(2 comments)

Documentation issues.

https://gerrit.ovirt.org/#/c/55137/13/vdsm/virt/vm.py
File vdsm/virt/vm.py:

Line 2135:             dev_object = vmdevices.hostdevice.HostDevice(self.conf, self.log,
Line 2136:                                                          **dev_spec)
Line 2137:             dev_objects.append(dev_object)
Line 2138:             try:
Line 2139:                 dev_object.setup()
HostDevice.setup docstring should be updated as well.
Line 2140:             except libvirt.libvirtError:
Line 2141:                 # We couldn't detach one of the devices. Halt.
Line 2142:                 self.log.exception('Could not detach a device from a host.')
Line 2143:                 return response.error('hostdevDetachErr')


https://gerrit.ovirt.org/#/c/55137/13/vdsm/virt/vmdevices/network.py
File vdsm/virt/vmdevices/network.py:

Line 181:     def setup(self):
Line 182:         """
Line 183:         Detach the device from the host. This method *must* be
Line 184:         called before getXML in order to populate _deviceParams.
Line 185:         """
I find this combination of the method name and the docstring confusing. I suggest rewording the docstring to emphasize the logical purpose of the method instead of the implementation. It should explain what the method is useful for; for instance if its only purpose is to be called before getXML, why isn't it called from getXML directly and is exposed as a public interface?
Line 186:         if self.is_hostdevice:
Line 187:             logging.debug('Detaching device %s from the host.' % self.device)
Line 188:             detach_detachable(self.hostdev)
Line 189: 


-- 
To view, visit https://gerrit.ovirt.org/55137
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I1c97af2ea9f17ef38f9dbb4f41e5f9d1da9eebaa
Gerrit-PatchSet: 13
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik <mpolednik at redhat.com>
Gerrit-Reviewer: Edward Haas <edwardh at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik <mpolednik at redhat.com>
Gerrit-Reviewer: Milan Zamazal <mzamazal at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list