Marcin Mirecki has uploaded a new change for review. Change subject: vm: renaming device unplug related function ......................................................................
vm: renaming device unplug related function Renaming function related to unplugging a device to contain 'device' instead of 'drive' Change-Id: I3ab2b22e2a79507cde77addf28f29b80bde9e24d Signed-off-by: Marcin Mirecki <[email protected]> --- M tests/vmTests.py M vdsm/virt/vm.py 2 files changed, 8 insertions(+), 8 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/38/49038/1 diff --git a/tests/vmTests.py b/tests/vmTests.py index 74b3241..8b137a2 100644 --- a/tests/vmTests.py +++ b/tests/vmTests.py @@ -1264,7 +1264,7 @@ testvm = TestingVm(fake.Domain()) testvm._dom = FakeVmDom(self.DRIVE_XML, times_to_return_matching=99) - self.assertRaises(HotunplugTimeout, testvm._waitForDriveRemoval, + self.assertRaises(HotunplugTimeout, testvm._waitForDeviceRemoval, drive) @MonkeyPatch(config, 'getint', lambda x, y: 0) @@ -1273,7 +1273,7 @@ testvm = TestingVm(fake.Domain()) testvm._dom = FakeVmDom(self.DRIVE_XML) - testvm._waitForDriveRemoval(drive) + testvm._waitForDeviceRemoval(drive) @MonkeyPatch(config, 'getint', lambda x, y: 0) def test_wait_for_drive_removal_removed_on_x_check(self): @@ -1281,7 +1281,7 @@ testvm = TestingVm(fake.Domain()) testvm._dom = FakeVmDom(self.DRIVE_XML, times_to_return_matching=2) - testvm._waitForDriveRemoval(drive) + testvm._waitForDeviceRemoval(drive) self.assertEqual(testvm._dom._result_count, 2) diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py index f882734..8da0f3c 100644 --- a/vdsm/virt/vm.py +++ b/vdsm/virt/vm.py @@ -2237,7 +2237,7 @@ try: self._dom.detachDevice(nicXml) - self._waitForDriveRemoval(nic) + self._waitForDeviceRemoval(nic) except HotunplugTimeout as e: self.log.error("%s", e) return response.error('hotunplugNic', "%s" % e) @@ -2640,7 +2640,7 @@ params=drive.custom) try: self._dom.detachDevice(driveXml) - self._waitForDriveRemoval(drive) + self._waitForDeviceRemoval(drive) except HotunplugTimeout as e: self.log.error("%s", e) return response.error('hotunplugDisk', "%s" % e) @@ -2666,7 +2666,7 @@ return {'status': doneCode, 'vmList': self.status()} - def _waitForDriveRemoval(self, device): + def _waitForDeviceRemoval(self, device): """ As stated in libvirt documentary, after detaching a device using virDomainDetachDeviceFlags, we need to verify that this device @@ -2688,13 +2688,13 @@ deadline = (utils.monotonic_time() + config.getint('vars', 'hotunplug_timeout')) sleep_time = config.getint('vars', 'hotunplug_sleep_time') - while self._isDriveAttached(device): + while self._isDeviceAttached(device): time.sleep(sleep_time) if utils.monotonic_time() > deadline: raise HotunplugTimeout("Timeout detaching device %s" % device.name) - def _isDriveAttached(self, device): + def _isDeviceAttached(self, device): root = ET.fromstring(self._dom.XMLDesc(0)) return bool(root.findall(device.xpath)) -- To view, visit https://gerrit.ovirt.org/49038 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3ab2b22e2a79507cde77addf28f29b80bde9e24d Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Marcin Mirecki <[email protected]> _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
