Assaf Muller has uploaded a new change for review.
Change subject: Work in progress: First commit for custom device properties. ......................................................................
Work in progress: First commit for custom device properties.
1) All methods related to nic and disk hot plug and unplug in hooks.py and libvirtvm.py now pass the params dictionary onwards.
2) Added unit test 'deviceCustomProperties' under hooksTests.py, that verifies that a custom property sent to a hook is indeed available in that hook.
Change-Id: Id1684c3bcf8838b43c7856f3794f1bffd8c4b28c Signed-off-by: Assaf Muller amuller@redhat.com --- M tests/hooksTests.py M vdsm/hooks.py M vdsm/libvirtvm.py 3 files changed, 70 insertions(+), 31 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/24/13124/1
diff --git a/tests/hooksTests.py b/tests/hooksTests.py index f80f271..e32862d 100644 --- a/tests/hooksTests.py +++ b/tests/hooksTests.py @@ -103,3 +103,24 @@ os.unlink(sName) expectedRes = dict([(os.path.basename(sName), {'md5': md5})]) self.assertEqual(expectedRes, info) + + def test_deviceCustomProperties(self): + dirName = tempfile.mkdtemp() + script = tempfile.NamedTemporaryFile(dir=dirName, delete=False) + code = """#!/usr/bin/python + +import os +import hooking + +domXMLFile = file(os.environ['_hook_domxml'], 'a') +customProperty = os.environ['customProperty'] +domXMLFile.write(customProperty) + """ + + script.write(code) + os.chmod(script.name, 0775) + script.close() + + result = hooks._runHooksDir("oVirt", dirName, + params={'customProperty': ' rocks!'}) + self.assertEqual(result, "oVirt rocks!") diff --git a/vdsm/hooks.py b/vdsm/hooks.py index 95516a8..33faa6e 100644 --- a/vdsm/hooks.py +++ b/vdsm/hooks.py @@ -174,47 +174,54 @@ raiseError=False, params=params)
-def before_nic_hotplug(nicxml, vmconf={}): - return _runHooksDir(nicxml, 'before_nic_hotplug', vmconf=vmconf) +def before_nic_hotplug(nicxml, vmconf={}, params={}): + return _runHooksDir(nicxml, 'before_nic_hotplug', vmconf=vmconf, + params=params)
-def after_nic_hotplug(nicxml, vmconf={}): - return _runHooksDir(nicxml, 'after_nic_hotplug', vmconf=vmconf) +def after_nic_hotplug(nicxml, vmconf={}, params={}): + return _runHooksDir(nicxml, 'after_nic_hotplug', vmconf=vmconf, + params=params)
-def before_nic_hotunplug(nicxml, vmconf={}): - return _runHooksDir(nicxml, 'before_nic_hotunplug', vmconf=vmconf) +def before_nic_hotunplug(nicxml, vmconf={}, params={}): + return _runHooksDir(nicxml, 'before_nic_hotunplug', vmconf=vmconf, + params=params)
-def after_nic_hotunplug(nicxml, vmconf={}): +def after_nic_hotunplug(nicxml, vmconf={}, params={}): return _runHooksDir(nicxml, 'after_nic_hotunplug', vmconf=vmconf, - raiseError=False) + params=params, raiseError=False)
-def after_nic_hotplug_fail(nicxml, vmconf={}): +def after_nic_hotplug_fail(nicxml, vmconf={}, params={}): return _runHooksDir(nicxml, 'after_nic_hotplug_fail', vmconf=vmconf, - raiseError=False) + params=params, raiseError=False)
-def after_nic_hotunplug_fail(nicxml, vmconf={}): +def after_nic_hotunplug_fail(nicxml, vmconf={}, params={}): return _runHooksDir(nicxml, 'after_nic_hotunplug_fail', vmconf=vmconf, - raiseError=False) + params=params, raiseError=False)
-def before_disk_hotplug(domxml, vmconf={}): - return _runHooksDir(domxml, 'before_disk_hotplug', vmconf=vmconf) +def before_disk_hotplug(domxml, vmconf={}, params={}): + return _runHooksDir(domxml, 'before_disk_hotplug', vmconf=vmconf, + params=params)
-def after_disk_hotplug(domxml, vmconf={}): - return _runHooksDir(domxml, 'after_disk_hotplug', vmconf=vmconf) +def after_disk_hotplug(domxml, vmconf={}, params={}): + return _runHooksDir(domxml, 'after_disk_hotplug', vmconf=vmconf, + params=params)
-def before_disk_hotunplug(domxml, vmconf={}): - return _runHooksDir(domxml, 'before_disk_hotunplug', vmconf=vmconf) +def before_disk_hotunplug(domxml, vmconf={}, params={}): + return _runHooksDir(domxml, 'before_disk_hotunplug', vmconf=vmconf, + params=params)
-def after_disk_hotunplug(domxml, vmconf={}): - return _runHooksDir(domxml, 'after_disk_hotunplug', vmconf=vmconf) +def after_disk_hotunplug(domxml, vmconf={}, params={}): + return _runHooksDir(domxml, 'after_disk_hotunplug', vmconf=vmconf, + params=params)
def before_vdsm_start(): diff --git a/vdsm/libvirtvm.py b/vdsm/libvirtvm.py index 39d1b5b..f42e8b7 100644 --- a/vdsm/libvirtvm.py +++ b/vdsm/libvirtvm.py @@ -1501,14 +1501,16 @@ nicParams = params['nic'] nic = NetworkInterfaceDevice(self.conf, self.log, **nicParams) nicXml = nic.getXML().toprettyxml(encoding='utf-8') - nicXml = hooks.before_nic_hotplug(nicXml, self.conf) + nicXml = hooks.before_nic_hotplug(nicXml, self.conf, + params=params.get('custom', {})) self.log.debug("Hotplug NIC xml: %s", nicXml)
try: self._dom.attachDevice(nicXml) except libvirt.libvirtError as e: self.log.error("Hotplug failed", exc_info=True) - nicXml = hooks.after_nic_hotplug_fail(nicXml, self.conf) + nicXml = hooks.after_nic_hotplug_fail( + nicXml, self.conf, params=params.get('custom', {})) if e.get_error_code() == libvirt.VIR_ERR_NO_DOMAIN: return errCode['noVM'] return {'status': {'code': errCode['hotplugNic']['status']['code'], @@ -1522,7 +1524,8 @@ self.conf['devices'].append(nicParams) self.saveState() self._getUnderlyingNetworkInterfaceInfo() - hooks.after_nic_hotplug(nicXml, self.conf) + hooks.after_nic_hotplug(nicXml, self.conf, + params=params.get('custom', {}))
if hasattr(nic, 'portMirroring'): mirroredNetworks = [] @@ -1538,7 +1541,8 @@ self.log.error("setPortMirroring for network %s failed", network, exc_info=True) nicParams['portMirroring'] = mirroredNetworks - self.hotunplugNic({'nic': nicParams}) + self.hotunplugNic({'nic': nicParams}, + params=params.get('custom', {})) return {'status': {'code': errCode['hotplugNic']['status']['code'], 'message': e.message}} @@ -1679,7 +1683,8 @@ supervdsm.getProxy().unsetPortMirroring(network, nic.name)
nicXml = nic.getXML().toprettyxml(encoding='utf-8') - hooks.before_nic_hotunplug(nicXml, self.conf) + hooks.before_nic_hotunplug(nicXml, self.conf, + params=params.get('custom', {})) self.log.debug("Hotunplug NIC xml: %s", nicXml) else: self.log.error("Hotunplug NIC failed - NIC not found: %s", @@ -1715,12 +1720,14 @@ if nic: self._devices[vm.NIC_DEVICES].append(nic) self.saveState() - hooks.after_nic_hotunplug_fail(nicXml, self.conf) + hooks.after_nic_hotunplug_fail(nicXml, self.conf, + params=params.get('custom', {})) return { 'status': {'code': errCode['hotunplugNic']['status']['code'], 'message': e.message}}
- hooks.after_nic_hotunplug(nicXml, self.conf) + hooks.after_nic_hotunplug(nicXml, self.conf, + params=params.get('custom', {})) return {'status': doneCode, 'vmList': self.status()}
def hotplugDisk(self, params): @@ -1738,7 +1745,8 @@ driveXml = drive.getXML().toprettyxml(encoding='utf-8') self.log.debug("Hotplug disk xml: %s" % (driveXml))
- hooks.before_disk_hotplug(driveXml, self.conf) + hooks.before_disk_hotplug(driveXml, self.conf, + params=params.get('custom', {})) try: self._dom.attachDevice(driveXml) except libvirt.libvirtError as e: @@ -1758,7 +1766,8 @@ self.conf['devices'].append(diskParams) self.saveState() self._getUnderlyingDriveInfo() - hooks.after_disk_hotplug(driveXml, self.conf) + hooks.after_disk_hotplug(driveXml, self.conf, + params=params.get('custom', {}))
return {'status': doneCode, 'vmList': self.status()}
@@ -1800,7 +1809,8 @@
self.saveState()
- hooks.before_disk_hotunplug(driveXml, self.conf) + hooks.before_disk_hotunplug(driveXml, self.conf, + params=params.get('custom', {})) try: self._dom.detachDevice(driveXml) except libvirt.libvirtError as e: @@ -1817,7 +1827,8 @@ 'status': {'code': errCode['hotunplugDisk']['status']['code'], 'message': e.message}} else: - hooks.after_disk_hotunplug(driveXml, self.conf) + hooks.after_disk_hotunplug(driveXml, self.conf, + params=params.get('custom', {})) self._cleanup()
return {'status': doneCode, 'vmList': self.status()}
-- To view, visit http://gerrit.ovirt.org/13124 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange Gerrit-Change-Id: Id1684c3bcf8838b43c7856f3794f1bffd8c4b28c Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Assaf Muller amuller@redhat.com
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Work in progress: First commit for custom device properties. ......................................................................
Patch Set 1:
Build Started http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/1613/ (1/2)
-- To view, visit http://gerrit.ovirt.org/13124 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Id1684c3bcf8838b43c7856f3794f1bffd8c4b28c Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Assaf Muller amuller@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Work in progress: First commit for custom device properties. ......................................................................
Patch Set 1:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/1657/ (2/2)
-- To view, visit http://gerrit.ovirt.org/13124 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Id1684c3bcf8838b43c7856f3794f1bffd8c4b28c Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Assaf Muller amuller@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Work in progress: First commit for custom device properties. ......................................................................
Patch Set 1:
Build Successful
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/1613/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/1657/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/13124 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Id1684c3bcf8838b43c7856f3794f1bffd8c4b28c Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has posted comments on this change.
Change subject: Work in progress: First commit for custom device properties. ......................................................................
Patch Set 1: I would prefer that you didn't submit this
(1 inline comment)
nice! this turned out simpler than I thought!
I'm waiting to see what are your plans for before_vm_create... (that can be kept in a different patch, if you like).
.................................................... File tests/hooksTests.py Line 120: script.write(code) Line 121: os.chmod(script.name, 0775) Line 122: script.close() Line 123: Line 124: result = hooks._runHooksDir("oVirt", dirName, what does this adds over test_runHooksDir()?
how about testing your newly-tweaked before_nic_hotplug() here? Line 125: params={'customProperty': ' rocks!'})
-- To view, visit http://gerrit.ovirt.org/13124 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Id1684c3bcf8838b43c7856f3794f1bffd8c4b28c Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has posted comments on this change.
Change subject: Work in progress: First commit for custom device properties. ......................................................................
Patch Set 1:
and another thing - this patch adds variables into the env of various hooks scripts. This should be documented in vdsm/vdsmd.8.in.
-- To view, visit http://gerrit.ovirt.org/13124 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Id1684c3bcf8838b43c7856f3794f1bffd8c4b28c Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Assaf Muller has posted comments on this change.
Change subject: Work in progress: First commit for custom device properties. ......................................................................
Patch Set 1: (1 inline comment)
Replied to comment in code.
I will add the documentation changes in the upcoming patch set.
.................................................... File tests/hooksTests.py Line 120: script.write(code) Line 121: os.chmod(script.name, 0775) Line 122: script.close() Line 123: Line 124: result = hooks._runHooksDir("oVirt", dirName, test_runHooksDir does not test the availability of custom properties inside a hook.
As we discussed in person, there is no real advantage to calling before_nic_hotplug, as it is essentially the same as what's being done in this test already. Line 125: params={'customProperty': ' rocks!'})
-- To view, visit http://gerrit.ovirt.org/13124 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Id1684c3bcf8838b43c7856f3794f1bffd8c4b28c Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Work in progress: First commit for custom device properties. ......................................................................
Patch Set 2:
Build Started http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/1734/ (1/2)
-- To view, visit http://gerrit.ovirt.org/13124 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Id1684c3bcf8838b43c7856f3794f1bffd8c4b28c Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Work in progress: First commit for custom device properties. ......................................................................
Patch Set 2:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/1785/ (2/2)
-- To view, visit http://gerrit.ovirt.org/13124 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Id1684c3bcf8838b43c7856f3794f1bffd8c4b28c Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Work in progress: First commit for custom device properties. ......................................................................
Patch Set 2:
Build Successful
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/1734/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/1785/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/13124 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Id1684c3bcf8838b43c7856f3794f1bffd8c4b28c Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Assaf Muller has posted comments on this change.
Change subject: Work in progress: First commit for custom device properties. ......................................................................
Patch Set 2: I would prefer that you didn't submit this
Work in progress. Giving myself -1 for now until I decide this patch (And the subsequent dependees) are ready.
-- To view, visit http://gerrit.ovirt.org/13124 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Id1684c3bcf8838b43c7856f3794f1bffd8c4b28c Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Work in progress: First commit for custom device properties. ......................................................................
Patch Set 3:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/1794/ (1/2)
-- To view, visit http://gerrit.ovirt.org/13124 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Id1684c3bcf8838b43c7856f3794f1bffd8c4b28c Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Work in progress: First commit for custom device properties. ......................................................................
Patch Set 3:
Build Started http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/1743/ (2/2)
-- To view, visit http://gerrit.ovirt.org/13124 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Id1684c3bcf8838b43c7856f3794f1bffd8c4b28c Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Work in progress: First commit for custom device properties. ......................................................................
Patch Set 3:
Build Successful
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/1743/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/1794/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/13124 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Id1684c3bcf8838b43c7856f3794f1bffd8c4b28c Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has posted comments on this change.
Change subject: Work in progress: First commit for custom device properties. ......................................................................
Patch Set 3: I would prefer that you didn't submit this
(1 inline comment)
minor comment
.................................................... File vdsm/vdsmd.8.in Line 83: The environment of before_vm_set_ticket and after_vm_set_ticket hooks is augmented Line 84: with a set of params passed by the caller of setVmTicket. Line 85: Line 86: The environment of hooks specific to devices: Line 87: before_nic_hotplug, after_nic_hotplug, after_nic_hotplug_fail, please break these long line. Line 88: before_nic_hotunplug, after_nic_hotunplug, after_nic_unhotplug_fail, Line 89: before_disk_hotplug, after_disk_hotplug, Line 90: before_disk_hotunplug, after_disk_hotunplug. Line 91:
-- To view, visit http://gerrit.ovirt.org/13124 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Id1684c3bcf8838b43c7856f3794f1bffd8c4b28c Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Assaf Muller has posted comments on this change.
Change subject: Work in progress: First commit for custom device properties. ......................................................................
Patch Set 3: (1 inline comment)
Thanks. Coming up!
.................................................... File vdsm/vdsmd.8.in Line 83: The environment of before_vm_set_ticket and after_vm_set_ticket hooks is augmented Line 84: with a set of params passed by the caller of setVmTicket. Line 85: Line 86: The environment of hooks specific to devices: Line 87: before_nic_hotplug, after_nic_hotplug, after_nic_hotplug_fail, Done Line 88: before_nic_hotunplug, after_nic_hotunplug, after_nic_unhotplug_fail, Line 89: before_disk_hotplug, after_disk_hotplug, Line 90: before_disk_hotunplug, after_disk_hotunplug. Line 91:
-- To view, visit http://gerrit.ovirt.org/13124 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Id1684c3bcf8838b43c7856f3794f1bffd8c4b28c Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Custom properties per device. ......................................................................
Patch Set 4:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/1825/ (1/2)
-- To view, visit http://gerrit.ovirt.org/13124 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Id1684c3bcf8838b43c7856f3794f1bffd8c4b28c Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Custom properties per device. ......................................................................
Patch Set 4:
Build Started http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/1774/ (2/2)
-- To view, visit http://gerrit.ovirt.org/13124 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Id1684c3bcf8838b43c7856f3794f1bffd8c4b28c Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: Custom properties per device. ......................................................................
Patch Set 4:
Build Successful
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/1774/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/1825/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/13124 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Id1684c3bcf8838b43c7856f3794f1bffd8c4b28c Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has posted comments on this change.
Change subject: Custom properties per device. ......................................................................
Patch Set 4: Looks good to me, but someone else must approve
(1 inline comment)
.................................................... File vdsm/vdsmd.8.in Line 88: before_nic_hotunplug, after_nic_hotunplug, after_nic_unhotplug_fail, Line 89: before_disk_hotplug, after_disk_hotplug, Line 90: before_disk_hotunplug, after_disk_hotunplug. Line 91: Line 92: Are all augmented by custom properties specific to those devices, note the evil trailing space. Line 93: sent by the caller of the hook. For example if before_nic_hotplug is called Line 94: with custom: {qos: '0.5', color: 'red'} then qos and color will be directly Line 95: available as environment variables when before_nic_hotplug is called. Line 96:
-- To view, visit http://gerrit.ovirt.org/13124 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Id1684c3bcf8838b43c7856f3794f1bffd8c4b28c Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Assaf Muller has posted comments on this change.
Change subject: Custom properties per device. ......................................................................
Patch Set 4: Verified
Verified: Created fake\simple hooks for before and after nic hotplug, unplug and before and after disk hotplug and unplug. I called the hooks with custom properties and they were available in the hooks environment.
-- To view, visit http://gerrit.ovirt.org/13124 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Id1684c3bcf8838b43c7856f3794f1bffd8c4b28c Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has posted comments on this change.
Change subject: Custom properties per device. ......................................................................
Patch Set 4: Looks good to me, approved
-- To view, visit http://gerrit.ovirt.org/13124 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Id1684c3bcf8838b43c7856f3794f1bffd8c4b28c Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Dan Kenigsberg has submitted this change and it was merged.
Change subject: Custom properties per device. ......................................................................
Custom properties per device.
This is the first commit in a series of patches that will implement custom properties per device. The first commit deals with hot plugging and unplugging devices and enabling custom properties for those hook points.
Patch Set 1: 1) All methods related to nic and disk hot plug and unplug in hooks.py and libvirtvm.py now pass the params dictionary onwards.
2) Added unit test 'deviceCustomProperties' under hooksTests.py, that verifies that a custom property sent to a hook is indeed available in that hook.
Patch Set 2: Updated the man page to reflect the fact that custom properties are now exposed as environment variables to device hooks
Patch Set 3: Broke down long line in man page.
Change-Id: Id1684c3bcf8838b43c7856f3794f1bffd8c4b28c Signed-off-by: Assaf Muller amuller@redhat.com --- M tests/hooksTests.py M vdsm/hooks.py M vdsm/libvirtvm.py M vdsm/vdsmd.8.in 4 files changed, 81 insertions(+), 31 deletions(-)
Approvals: Assaf Muller: Verified Dan Kenigsberg: Looks good to me, approved
-- To view, visit http://gerrit.ovirt.org/13124 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: merged Gerrit-Change-Id: Id1684c3bcf8838b43c7856f3794f1bffd8c4b28c Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Antoni Segura Puimedon asegurap@redhat.com Gerrit-Reviewer: Assaf Muller amuller@redhat.com Gerrit-Reviewer: Dan Kenigsberg danken@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
vdsm-patches@lists.fedorahosted.org