Change in vdsm[master]: vdsm: add support for hot(un)plug of pci-passthrough devices
Itamar Heim has posted comments on this change. Change subject: vdsm: add support for hot(un)plug of pci-passthrough devices .. Patch Set 3: ping -- To view, visit http://gerrit.ovirt.org/22523 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8fbf4a1d62789d9404e5977eb7eb01b17a1a43fb Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik Gerrit-Reviewer: Antoni Segura Puimedon Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Francesco Romani Gerrit-Reviewer: Itamar Heim Gerrit-Reviewer: Martin Polednik Gerrit-Reviewer: Michal Skrivanek Gerrit-Reviewer: Vinzenz Feenstra Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: add support for hot(un)plug of pci-passthrough devices
Martin Polednik has posted comments on this change. Change subject: vdsm: add support for hot(un)plug of pci-passthrough devices .. Patch Set 3: waiting for http://gerrit.ovirt.org/#/c/22462/ in case of changes -- To view, visit http://gerrit.ovirt.org/22523 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8fbf4a1d62789d9404e5977eb7eb01b17a1a43fb Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik Gerrit-Reviewer: Antoni Segura Puimedon Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Itamar Heim Gerrit-Reviewer: Martin Polednik Gerrit-Reviewer: Michal Skrivanek Gerrit-Reviewer: Vinzenz Feenstra Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: add support for hot(un)plug of pci-passthrough devices
Itamar Heim has posted comments on this change. Change subject: vdsm: add support for hot(un)plug of pci-passthrough devices .. Patch Set 3: ping -- To view, visit http://gerrit.ovirt.org/22523 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8fbf4a1d62789d9404e5977eb7eb01b17a1a43fb Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik Gerrit-Reviewer: Antoni Segura Puimedon Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Itamar Heim Gerrit-Reviewer: Martin Polednik Gerrit-Reviewer: Michal Skrivanek Gerrit-Reviewer: Vinzenz Feenstra Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: add support for hot(un)plug of pci-passthrough devices
oVirt Jenkins CI Server has posted comments on this change. Change subject: vdsm: add support for hot(un)plug of pci-passthrough devices .. Patch Set 3: Build Successful http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/6509/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/5616/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/6422/ : SUCCESS -- To view, visit http://gerrit.ovirt.org/22523 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8fbf4a1d62789d9404e5977eb7eb01b17a1a43fb Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik Gerrit-Reviewer: Antoni Segura Puimedon Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Martin Polednik Gerrit-Reviewer: Michal Skrivanek Gerrit-Reviewer: Vinzenz Feenstra Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: add support for hot(un)plug of pci-passthrough devices
Martin Polednik has posted comments on this change. Change subject: vdsm: add support for hot(un)plug of pci-passthrough devices .. Patch Set 2: (1 comment) File client/vdsClient.py Line 246: return self.ExecAndExit(self.s.hotunplugDisk(params)) Line 247: Line 248: def hotplugHostdev(self, args): Line 249: params = {'vmId': args[0], 'hostdevName': args[1]} Line 250: return self.ExecAndExit(self.s.hotplugNic(params)) noted, will be fixed in next patchset (same for below) Line 251: Line 252: def hotunplugHostdev(self, args): Line 253: params = {'vmId': args[0], 'hostdevName': args[2]} Line 254: return self.ExecAndExit(self.s.hotunplugNic(params)) -- To view, visit http://gerrit.ovirt.org/22523 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8fbf4a1d62789d9404e5977eb7eb01b17a1a43fb Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik Gerrit-Reviewer: Antoni Segura Puimedon Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Martin Polednik Gerrit-Reviewer: Michal Skrivanek Gerrit-Reviewer: Vinzenz Feenstra Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: add support for hot(un)plug of pci-passthrough devices
Vinzenz Feenstra has posted comments on this change. Change subject: vdsm: add support for hot(un)plug of pci-passthrough devices .. Patch Set 2: Code-Review-1 (2 comments) File client/vdsClient.py Line 246: return self.ExecAndExit(self.s.hotunplugDisk(params)) Line 247: Line 248: def hotplugHostdev(self, args): Line 249: params = {'vmId': args[0], 'hostdevName': args[1]} Line 250: return self.ExecAndExit(self.s.hotplugNic(params)) hotplugNic? Line 251: Line 252: def hotunplugHostdev(self, args): Line 253: params = {'vmId': args[0], 'hostdevName': args[2]} Line 254: return self.ExecAndExit(self.s.hotunplugNic(params)) Line 250: return self.ExecAndExit(self.s.hotplugNic(params)) Line 251: Line 252: def hotunplugHostdev(self, args): Line 253: params = {'vmId': args[0], 'hostdevName': args[2]} Line 254: return self.ExecAndExit(self.s.hotunplugNic(params)) hotunplugNic? Line 255: Line 256: def do_changeCD(self, args): Line 257: vmId = args[0] Line 258: file = self._parseDriveSpec(args[1]) -- To view, visit http://gerrit.ovirt.org/22523 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8fbf4a1d62789d9404e5977eb7eb01b17a1a43fb Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik Gerrit-Reviewer: Antoni Segura Puimedon Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Michal Skrivanek Gerrit-Reviewer: Vinzenz Feenstra Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: add support for hot(un)plug of pci-passthrough devices
oVirt Jenkins CI Server has posted comments on this change. Change subject: vdsm: add support for hot(un)plug of pci-passthrough devices .. Patch Set 2: Build Successful http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/6160/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/5373/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/6264/ : SUCCESS -- To view, visit http://gerrit.ovirt.org/22523 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8fbf4a1d62789d9404e5977eb7eb01b17a1a43fb Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik Gerrit-Reviewer: Antoni Segura Puimedon Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Michal Skrivanek Gerrit-Reviewer: Vinzenz Feenstra Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: add support for hot(un)plug of pci-passthrough devices
oVirt Jenkins CI Server has posted comments on this change. Change subject: vdsm: add support for hot(un)plug of pci-passthrough devices .. Patch Set 1: Build Successful http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/6159/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit_el/5372/ : SUCCESS http://jenkins.ovirt.org/job/vdsm_unit_tests_gerrit/6263/ : SUCCESS -- To view, visit http://gerrit.ovirt.org/22523 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8fbf4a1d62789d9404e5977eb7eb01b17a1a43fb Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Polednik Gerrit-Reviewer: Antoni Segura Puimedon Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Michal Skrivanek Gerrit-Reviewer: Vinzenz Feenstra Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: vdsm: add support for hot(un)plug of pci-passthrough devices
Martin Polednik has uploaded a new change for review. Change subject: vdsm: add support for hot(un)plug of pci-passthrough devices .. vdsm: add support for hot(un)plug of pci-passthrough devices Hot(un)plug ability for pci-passthrough devices is extremely important in order to allow for hotunplugging/migrating/hotplugging workflow as VM cannot be migrated with pci device attached. This patch implements the ability adding new API verbs: hotplugHostdev and hotunplugHostdev, which attempts to append/remove the device from domain XML and reports back the state. Change-Id: I8fbf4a1d62789d9404e5977eb7eb01b17a1a43fb Signed-off-by: Martin Polednik --- M client/vdsClient.py M vdsm/API.py M vdsm/BindingXMLRPC.py M vdsm/vm.py M vdsm_api/vdsmapi-schema.json 5 files changed, 166 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/23/22523/1 diff --git a/client/vdsClient.py b/client/vdsClient.py index d549500..f00180e 100644 --- a/client/vdsClient.py +++ b/client/vdsClient.py @@ -245,6 +245,14 @@ params = {'vmId': args[0], 'drive': drive} return self.ExecAndExit(self.s.hotunplugDisk(params)) +def hotplugHostdev(self, args): +params = {'vmId': args[0], 'hostdevName': args[1]} +return self.ExecAndExit(self.s.hotplugNic(params)) + +def hotunplugHostdev(self, args): +params = {'vmId': args[0], 'hostdevName': args[2]} +return self.ExecAndExit(self.s.hotunplugNic(params)) + def do_changeCD(self, args): vmId = args[0] file = self._parseDriveSpec(args[1]) diff --git a/vdsm/API.py b/vdsm/API.py index 44d5817..51eb506 100644 --- a/vdsm/API.py +++ b/vdsm/API.py @@ -456,6 +456,40 @@ return curVm.hotunplugDisk(params) +def hotplugHostdev(self, params): +try: +utils.validateMinimalKeySet(params, ('vmId', 'hostdevName')) +except ValueError: +self.log.error('Missing one of required parameters: vmId, ' + 'hostdevName') +return {'status': {'code': errCode['MissParam']['status']['code'], + 'message': 'Missing one of required ' + 'parameters: vmId, hostdevName'}} +try: +curVm = self._cif.vmContainer[self._UUID] +except KeyError: +self.log.warning("vm %s doesn't exist", self._UUID) +return errCode['noVM'] + +return curVm.hotplugHostdev(params) + +def hotunplugHostdev(self, params): +try: +utils.validateMinimalKeySet(params, ('vmId', 'hostdevName')) +except ValueError: +self.log.error('Missing one of required parameters: vmId, ' + 'hostdevName') +return {'status': {'code': errCode['MissParam']['status']['code'], + 'message': 'Missing one of required ' + 'parameters: vmId, hostdevName'}} +try: +curVm = self._cif.vmContainer[self._UUID] +except KeyError: +self.log.warning("vm %s doesn't exist", self._UUID) +return errCode['noVM'] + +return curVm.hotunplugHostdev(params) + def migrate(self, params): """ Migrate a VM to a remote host. diff --git a/vdsm/BindingXMLRPC.py b/vdsm/BindingXMLRPC.py index 5bcd84c..847ceaf 100644 --- a/vdsm/BindingXMLRPC.py +++ b/vdsm/BindingXMLRPC.py @@ -279,6 +279,14 @@ vm = API.VM(params['vmId']) return vm.hotunplugNic(params) +def vmHotplugHostdev(self, params): +vm = API.VM(params['vmId']) +return vm.hotplugHostdev(params) + +def vmHotunplugHostdev(self, params): +vm = API.VM(params['vmId']) +return vm.hotunplugHostdev(params) + def vmUpdateDevice(self, vmId, params): vm = API.VM(vmId) return vm.vmUpdateDevice(params) @@ -861,6 +869,8 @@ (self.vmHotunplugDisk, 'hotunplugDisk'), (self.vmHotplugNic, 'hotplugNic'), (self.vmHotunplugNic, 'hotunplugNic'), +(self.vmHotplugHostdev, 'hotplugHostdev'), +(self.vmHotunplugHostdev, 'hotunplugHostdev'), (self.vmUpdateDevice, 'vmUpdateDevice')) def getIrsMethods(self): diff --git a/vdsm/vm.py b/vdsm/vm.py index 90a6c0d..224bf7b 100644 --- a/vdsm/vm.py +++ b/vdsm/vm.py @@ -3183,6 +3183,84 @@ return {'status': doneCode, 'vmList': self.status()} +def hotplugHostdev(self, params): +hostdevName = params['hostdevName'] +hostdev = HostDevice(self.conf, self.log, **hostdevName) +hostdevXML = hostdev.getXML().toprettyxml(encoding='utf-8') +hostdev._deviceXML = hostdevXML +self.log.debug("Hotplug hostdev xml: %s", hostdevXML) + +try: +self._dom.attachDevice(hostdevXML) +exc