Change in vdsm[master]: net libvirt ovs: sync libvirt with running_config
by automation@ovirt.org
gerrit-hooks has posted comments on this change.
Change subject: net libvirt ovs: sync libvirt with running_config
......................................................................
Patch Set 3:
* Update tracker: IGNORE, no Bug-Url found
* Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url.
* Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
--
To view, visit https://gerrit.ovirt.org/65096
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I20314c3899796bc87b441894a24c382e46458e2a
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Petr Horáček <phoracek(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: No
7 years, 7 months
Change in vdsm[master]: Correct API schema to align with runtime schema
by akrejcir@redhat.com
Andrej Krejcir has uploaded a new change for review.
Change subject: Correct API schema to align with runtime schema
......................................................................
Correct API schema to align with runtime schema
Change-Id: Ia1b5e90831fd0e4d9e897baaae4afb68f22e3877
Bug-Url: https://bugzilla.redhat.com/1348255
Signed-off-by: Andrej Krejcir <akrejcir(a)redhat.com>
---
M lib/api/vdsm-api.yml
M lib/vdsm/jsonrpcvdscli.py
M lib/vdsm/rpc/Bridge.py
3 files changed, 33 insertions(+), 37 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/77/64477/1
diff --git a/lib/api/vdsm-api.yml b/lib/api/vdsm-api.yml
index c7ab7f5..1f1d569 100644
--- a/lib/api/vdsm-api.yml
+++ b/lib/api/vdsm-api.yml
@@ -2120,35 +2120,35 @@
description: I/O tune parameters for the VM disk device.
name: VmDiskDeviceIoTuneParams
properties:
- - defaultvalue: needs updating
- description: Write throughput limit in bytes per
- second.
- name: write_bytes_sec
- type: uint
-
- - defaultvalue: needs updating
- description: Read I/O operations limit per second.
- name: read_iops_sec
- type: uint
-
- - defaultvalue: needs updating
- description: Read throughput limit in bytes per
- second.
- name: read_bytes_sec
- type: uint
-
- - defaultvalue: needs updating
+ - defaultvalue: 0 - means unlimited
description: Total throughput limit in bytes per
second.
name: total_bytes_sec
type: uint
- - defaultvalue: needs updating
+ - defaultvalue: 0 - means unlimited
+ description: Read throughput limit in bytes per
+ second.
+ name: read_bytes_sec
+ type: uint
+
+ - defaultvalue: 0 - means unlimited
+ description: Write throughput limit in bytes per
+ second.
+ name: write_bytes_sec
+ type: uint
+
+ - defaultvalue: 0 - means unlimited
description: Total I/O operations limit per second.
name: total_iops_sec
type: uint
- - defaultvalue: needs updating
+ - defaultvalue: 0 - means unlimited
+ description: Read I/O operations limit per second.
+ name: read_iops_sec
+ type: uint
+
+ - defaultvalue: 0 - means unlimited
description: Write I/O operations limit per second.
name: write_iops_sec
type: uint
@@ -2577,20 +2577,6 @@
type: *VmDeviceAddress
type: object
- HotplugMemoryParams: &HotplugMemoryParams
- added: '3.6'
- description: Parameters for VM.hotplugMemory.
- name: HotplugMemoryParams
- properties:
- - description: The UUID of the VM to modify
- name: vmId
- type: *UUID
-
- - description: The memory device specification
- name: memory
- type: *VmMemoryDevice
- type: object
-
VmInterfaceDeviceSpecParams: &VmInterfaceDeviceSpecParams
added: '3.1'
description: Additional VM interface device parameters.
@@ -2841,6 +2827,10 @@
- description: The amount of pages to scan during one cycle.
name: pages_to_scan
+ type: int
+
+ - description:
+ name: merge_across_nodes
type: int
type: object
@@ -9771,9 +9761,10 @@
name: vmID
type: *UUID
- - description: The VM UUID and memory device information
- name: params
- type: *HotplugMemoryParams
+ - description: The memory device specification
+ name: memory
+ type: *VmMemoryDevice
+
return:
description: The VM definition, as updated
type: *VmDefinition
diff --git a/lib/vdsm/jsonrpcvdscli.py b/lib/vdsm/jsonrpcvdscli.py
index e276f86..c228e77 100644
--- a/lib/vdsm/jsonrpcvdscli.py
+++ b/lib/vdsm/jsonrpcvdscli.py
@@ -89,6 +89,7 @@
'hotplugNic': 'VM.hotplugNic',
'hotunplugDisk': 'VM.hotunplugDisk',
'hotunplugNic': 'VM.hotunplugNic',
+ 'hotplugMemory': 'VM.hotplugMemory',
'list': 'Host.getVMList',
'migrate': 'VM.migrate',
'migrateStatus': 'VM.getMigrationStatus',
@@ -99,7 +100,9 @@
'setBalloonTarget': 'VM.setBalloonTarget',
'setCpuTunePeriod': 'VM.setCpuTunePeriod',
'setCpuTuneQuota': 'VM.setCpuTuneQuota',
+ 'setNumberOfCpus': 'VM.setNumberOfCpus',
'setKsmTune': 'Host.setKsmTune',
+ 'setHaMaintenanceMode': 'Host.setHaMaintenanceMode',
'setMOMPolicy': 'Host.setMOMPolicy',
'setSafeNetworkConfig': 'Host.setSafeNetworkConfig',
'setupNetworks': 'Host.setupNetworks',
diff --git a/lib/vdsm/rpc/Bridge.py b/lib/vdsm/rpc/Bridge.py
index 5dedcc0..ceed1f9 100644
--- a/lib/vdsm/rpc/Bridge.py
+++ b/lib/vdsm/rpc/Bridge.py
@@ -356,6 +356,7 @@
'Host_getAllVmStats': {'ret': 'statsList'},
'Host_setupNetworks': {'ret': 'status'},
'Host_setKsmTune': {'ret': 'status'},
+ 'Host_setHaMaintenanceMode': {'ret': 'status'},
'Image_cloneStructure': {'ret': 'uuid'},
'Image_delete': {'ret': 'uuid'},
'Image_deleteVolumes': {'ret': 'uuid'},
@@ -415,6 +416,7 @@
'VM_setIoTune': {'ret': 'status'},
'VM_setBalloonTarget': {'ret': 'status'},
'VM_updateDevice': {'ret': 'vmList'},
+ 'VM_updateVmPolicy': {'ret': 'status'},
'Volume_copy': {'ret': 'uuid'},
'Volume_create': {'ret': 'uuid'},
'Volume_delete': {'ret': 'uuid'},
--
To view, visit https://gerrit.ovirt.org/64477
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia1b5e90831fd0e4d9e897baaae4afb68f22e3877
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Andrej Krejcir <akrejcir(a)redhat.com>
7 years, 7 months
Change in vdsm[master]: draft: migration plugin proposal - draft 102
by mmirecki@redhat.com
Marcin Mirecki has uploaded a new change for review.
Change subject: draft: migration plugin proposal - draft 102
......................................................................
draft: migration plugin proposal - draft 102
Just a draft to show the idea, not verified
Change-Id: Ia0fb056c4b4732505d567385546e78048c37d140
Signed-off-by: mirecki <mmirecki(a)redhat.com>
---
M vdsm/virt/vm_migrate_hook.py
A vdsm/virt/vm_migrate_plugins/__init__.py
A vdsm/virt/vm_migrate_plugins/external_network_plugin.py
A vdsm/virt/vm_migrate_plugins/openstack_network_plugin.py
A vdsm/virt/vm_migrate_plugins/vm_fex_plugin.py
5 files changed, 161 insertions(+), 11 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/86/64186/1
diff --git a/vdsm/virt/vm_migrate_hook.py b/vdsm/virt/vm_migrate_hook.py
index 633e4f0..dd276f5 100755
--- a/vdsm/virt/vm_migrate_hook.py
+++ b/vdsm/virt/vm_migrate_hook.py
@@ -28,6 +28,8 @@
from vdsm.config import config
from vdsm.network import api as net_api
+import vm_migrate_plugins
+
_DEBUG_MODE = False
LOG_FILE = '/tmp/libvirthook_ovs_migrate.log'
@@ -82,24 +84,28 @@
def _set_bridge_interfaces(devices, target_vm_conf):
- target_vm_nets_by_vnic_mac = {dev['macAddr']: dev['network']
- for dev in target_vm_conf['devices']
- if dev.get('type') == 'interface'}
+ target_vm_conf_by_mac = {dev['macAddr']: dev
+ for dev in target_vm_conf['devices']
+ if dev.get('type') == 'interface'}
+
for interface in devices.findall('interface'):
if interface.get('type') == 'bridge':
- _bind_iface_to_bridge(interface, target_vm_nets_by_vnic_mac)
+ _bind_iface_to_bridge(interface, target_vm_conf_by_mac)
-def _bind_iface_to_bridge(interface, target_vm_nets_by_vnic_mac):
+def _bind_iface_to_bridge(interface, target_vm_conf_by_mac):
elem_macaddr = interface.find('mac')
mac_addr = elem_macaddr.get('address')
- target_vm_net = target_vm_nets_by_vnic_mac[mac_addr]
- target_ovs_bridge = net_api.ovs_bridge(target_vm_net)
- if target_ovs_bridge:
- _bind_iface_to_ovs_bridge(interface, target_ovs_bridge, target_vm_net)
- else:
- _bind_iface_to_linux_bridge(interface, target_vm_net)
+ interface_conf = target_vm_conf_by_mac[mac_addr]
+ target_vm_net = interface_conf['network']
+ if not vm_migrate_plugins.skip_processing(interface, interface_conf):
+ target_ovs_bridge = net_api.ovs_bridge(target_vm_net)
+ if target_ovs_bridge:
+ _bind_iface_to_ovs_bridge(interface, target_ovs_bridge,
+ target_vm_net)
+ else:
+ _bind_iface_to_linux_bridge(interface, target_vm_net)
def _bind_iface_to_ovs_bridge(interface, target_ovs_bridge, target_vm_net):
diff --git a/vdsm/virt/vm_migrate_plugins/__init__.py b/vdsm/virt/vm_migrate_plugins/__init__.py
new file mode 100644
index 0000000..6c81eee
--- /dev/null
+++ b/vdsm/virt/vm_migrate_plugins/__init__.py
@@ -0,0 +1,43 @@
+# Copyright 2016 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# Refer to the README and COPYING files for full details of the license
+#
+
+import abc
+from importlib import import_module
+from pkgutil import iter_modules
+
+import six
+
+
+_DRIVERS = []
+
+
+def skip_processing(domxml, device_conf):
+ for driver in _DRIVERS:
+ driver.create().skip_processing(domxml, device_conf)
+
+
+class VmMigratePlugin():
+
+ @abc.abstractmethod
+ def skip_processing(self, domxml, device_conf):
+ return False
+
+
+for _, module, _ in iter_modules([__path__[0]]):
+ _DRIVERS.append(import_module('{}.{}'.format(__name__, module)))
diff --git a/vdsm/virt/vm_migrate_plugins/external_network_plugin.py b/vdsm/virt/vm_migrate_plugins/external_network_plugin.py
new file mode 100644
index 0000000..6beb0b2
--- /dev/null
+++ b/vdsm/virt/vm_migrate_plugins/external_network_plugin.py
@@ -0,0 +1,35 @@
+#!/usr/bin/env python
+# Copyright 2016 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# Refer to the README and COPYING files for full details of the license
+#
+
+from . import VmMigratePlugin
+
+
+class ExternalNetworkPlugin(VmMigratePlugin):
+
+ EXTERNAL_NETWORK = 'EXTERNAL_NETWORK'
+
+ def skip_processing(self, domxml, conf):
+ custom = conf.get('custom')
+ return custom.get('provider_type') == self.EXTERNAL_NETWORK \
+ if custom else False
+
+
+def create():
+ return ExternalNetworkPlugin()
diff --git a/vdsm/virt/vm_migrate_plugins/openstack_network_plugin.py b/vdsm/virt/vm_migrate_plugins/openstack_network_plugin.py
new file mode 100644
index 0000000..50bd3d2
--- /dev/null
+++ b/vdsm/virt/vm_migrate_plugins/openstack_network_plugin.py
@@ -0,0 +1,35 @@
+#!/usr/bin/env python
+# Copyright 2016 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# Refer to the README and COPYING files for full details of the license
+#
+
+from . import VmMigratePlugin
+
+
+class OpenstackNetworkPlugin(VmMigratePlugin):
+
+ OPENSTACK_NETWORK = 'OPENSTACK_NETWORK'
+
+ def skip_processing(self, domxml, conf):
+ custom = conf.get('custom')
+ return custom.get('provider_type') == self.OPENSTACK_NETWORK \
+ if custom else False
+
+
+def create():
+ return OpenstackNetworkPlugin()
diff --git a/vdsm/virt/vm_migrate_plugins/vm_fex_plugin.py b/vdsm/virt/vm_migrate_plugins/vm_fex_plugin.py
new file mode 100644
index 0000000..3661290
--- /dev/null
+++ b/vdsm/virt/vm_migrate_plugins/vm_fex_plugin.py
@@ -0,0 +1,31 @@
+#!/usr/bin/env python
+# Copyright 2016 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# Refer to the README and COPYING files for full details of the license
+#
+
+from . import VmMigratePlugin
+
+
+class VmFexPlugin(VmMigratePlugin):
+
+ def skip_processing(self, domxml, conf):
+ return conf.get('vmfex') is not None
+
+
+def create():
+ return VmFexPlugin()
--
To view, visit https://gerrit.ovirt.org/64186
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia0fb056c4b4732505d567385546e78048c37d140
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Marcin Mirecki <mmirecki(a)redhat.com>
7 years, 7 months
Change in vdsm[master]: draft: vm_migration_libvirt_hook_plugins
by mmirecki@redhat.com
Marcin Mirecki has uploaded a new change for review.
Change subject: draft: vm_migration_libvirt_hook_plugins
......................................................................
draft: vm_migration_libvirt_hook_plugins
Quick draft for vm migration libvirt hook plugins
Change-Id: I7e13a94fa28968e37cd2d4d99fe540c8b762f7cc
Signed-off-by: mirecki <mmirecki(a)redhat.com>
---
M vdsm/virt/vm_migrate_hook.py
A vdsm/virt/vm_migrate_plugins/__init__.py
2 files changed, 72 insertions(+), 11 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/01/64001/1
diff --git a/vdsm/virt/vm_migrate_hook.py b/vdsm/virt/vm_migrate_hook.py
index 633e4f0..063fdd0 100755
--- a/vdsm/virt/vm_migrate_hook.py
+++ b/vdsm/virt/vm_migrate_hook.py
@@ -28,6 +28,8 @@
from vdsm.config import config
from vdsm.network import api as net_api
+import vm_migrate_plugins
+
_DEBUG_MODE = False
LOG_FILE = '/tmp/libvirthook_ovs_migrate.log'
@@ -82,24 +84,29 @@
def _set_bridge_interfaces(devices, target_vm_conf):
- target_vm_nets_by_vnic_mac = {dev['macAddr']: dev['network']
- for dev in target_vm_conf['devices']
- if dev.get('type') == 'interface'}
+ target_vm_conf_by_mac = {dev['macAddr']: dev
+ for dev in target_vm_conf['devices']
+ if dev.get('type') == 'interface'}
+
for interface in devices.findall('interface'):
if interface.get('type') == 'bridge':
- _bind_iface_to_bridge(interface, target_vm_nets_by_vnic_mac)
+ _bind_iface_to_bridge(interface, target_vm_conf_by_mac)
-def _bind_iface_to_bridge(interface, target_vm_nets_by_vnic_mac):
+def _bind_iface_to_bridge(interface, target_vm_conf_by_mac):
elem_macaddr = interface.find('mac')
mac_addr = elem_macaddr.get('address')
- target_vm_net = target_vm_nets_by_vnic_mac[mac_addr]
- target_ovs_bridge = net_api.ovs_bridge(target_vm_net)
- if target_ovs_bridge:
- _bind_iface_to_ovs_bridge(interface, target_ovs_bridge, target_vm_net)
- else:
- _bind_iface_to_linux_bridge(interface, target_vm_net)
+ interface_conf = target_vm_conf_by_mac[mac_addr]
+ target_vm_net = interface_conf['network']
+ if vm_migrate_plugins.do_default_processing(interface, interface_conf):
+ target_ovs_bridge = net_api.ovs_bridge(target_vm_net)
+ if target_ovs_bridge:
+ _bind_iface_to_ovs_bridge(interface, target_ovs_bridge,
+ target_vm_net)
+ else:
+ _bind_iface_to_linux_bridge(interface, target_vm_net)
+ vm_migrate_plugins.process(interface, interface_conf)
def _bind_iface_to_ovs_bridge(interface, target_ovs_bridge, target_vm_net):
diff --git a/vdsm/virt/vm_migrate_plugins/__init__.py b/vdsm/virt/vm_migrate_plugins/__init__.py
new file mode 100644
index 0000000..3e4b090
--- /dev/null
+++ b/vdsm/virt/vm_migrate_plugins/__init__.py
@@ -0,0 +1,54 @@
+# Copyright 2016 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# Refer to the README and COPYING files for full details of the license
+#
+
+import abc
+from importlib import import_module
+from pkgutil import iter_modules
+
+import six
+
+
+_DRIVERS = []
+
+
+def do_default_processing(domxml, device_conf):
+ result = True
+ for driver in _DRIVERS:
+ result = result and driver.create().do_default_processing(domxml,
+ device_conf)
+ return result
+
+
+def process(domxml, device_conf):
+ for driver in _DRIVERS:
+ driver.create().process(domxml, device_conf)
+
+
+class VmMigrateDriver():
+
+ @abc.abstractmethod
+ def do_default_processing(self, domxml, device_conf):
+ pass
+
+ @abc.abstractmethod
+ def process(self, domxml, device_conf):
+ pass
+
+for _, module, _ in iter_modules([__path__[0]]):
+ _DRIVERS.append(import_module('{}.{}'.format(__name__, module)))
--
To view, visit https://gerrit.ovirt.org/64001
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7e13a94fa28968e37cd2d4d99fe540c8b762f7cc
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Marcin Mirecki <mmirecki(a)redhat.com>
7 years, 7 months
Change in vdsm[master]: network: supervdsm: configure container networks
by automation@ovirt.org
gerrit-hooks has posted comments on this change.
Change subject: network: supervdsm: configure container networks
......................................................................
Patch Set 44:
* Update tracker: IGNORE, no Bug-Url found
* Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url.
* Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
--
To view, visit https://gerrit.ovirt.org/54998
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I338ca2d3abb0b1447c5a18c97afb9e14314f4107
Gerrit-PatchSet: 44
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: No
7 years, 7 months
Change in vdsm[master]: vdsm: virt: add optional container support
by automation@ovirt.org
gerrit-hooks has posted comments on this change.
Change subject: vdsm: virt: add optional container support
......................................................................
Patch Set 51:
* Update tracker: IGNORE, no Bug-Url found
* Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url.
* Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
--
To view, visit https://gerrit.ovirt.org/53820
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Id236a30a5c875994c037b8d00c7463bceaab143f
Gerrit-PatchSet: 51
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: No
7 years, 7 months
Change in vdsm[master]: supervdsm: expose systemd utilities
by automation@ovirt.org
gerrit-hooks has posted comments on this change.
Change subject: supervdsm: expose systemd utilities
......................................................................
Patch Set 31:
* Update tracker: IGNORE, no Bug-Url found
* Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url.
* Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.6', 'ovirt-4.0'])
--
To view, visit https://gerrit.ovirt.org/56491
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I38e9a346da784fc200a82d9e5d9fdf665e752987
Gerrit-PatchSet: 31
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Milan Zamazal <mzamazal(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>
Gerrit-HasComments: No
7 years, 7 months
Change in vdsm[master]: cleanup: Remove dead code from storageServer.py
by alitke@redhat.com
Adam Litke has uploaded a new change for review.
Change subject: cleanup: Remove dead code from storageServer.py
......................................................................
cleanup: Remove dead code from storageServer.py
While reviewing some schema fixes I noticed that we have a lot of dead
code in storageServer.py which was misleading how parameters are
structured when connecting storage. Remove this unused code.
Change-Id: I7c442e73c6eca16384c3cdd53478b182affe1097
Signed-off-by: Adam Litke <alitke(a)redhat.com>
---
M vdsm/storage/storageServer.py
1 file changed, 0 insertions(+), 64 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/71/65071/1
diff --git a/vdsm/storage/storageServer.py b/vdsm/storage/storageServer.py
index 1c2bc11..4bc5de9 100644
--- a/vdsm/storage/storageServer.py
+++ b/vdsm/storage/storageServer.py
@@ -24,7 +24,6 @@
import os
import socket
from collections import namedtuple
-from functools import partial
import six
import sys
@@ -44,10 +43,6 @@
import gluster.cli
-class UnsupportedAuthenticationMethod(RuntimeError):
- pass
-
-
IscsiConnectionParameters = namedtuple("IscsiConnectionParameters",
"target, iface, credentials")
@@ -65,65 +60,6 @@
FcpConnectionParameters = namedtuple("FcpConnectionParameters", "")
ConnectionInfo = namedtuple("ConnectionInfo", "type, params")
-
-
-def _credentialAssembly(credInfo):
- authMethod = credInfo.get('type', 'chap').lower()
- if authMethod != 'chap':
- raise UnsupportedAuthenticationMethod(authMethod)
-
- params = credInfo.get('params', {})
- username = params.get('username', None)
- password = params.get('password', None)
- return iscsi.ChapCredentials(username, password)
-
-
-def _iscsiParameterAssembly(d):
- port = d['portal'].get('port', iscsi.ISCSI_DEFAULT_PORT)
- host = d['portal']['host']
- portal = iscsi.IscsiPortal(host, port)
- iqn = d['iqn']
- tpgt = d.get('tpgt', 1)
- target = iscsi.IscsiTarget(portal, tpgt, iqn)
- iface = iscsi.IscsiInterface(d.get('iface', 'default'))
- credInfo = d.get('credentials', None)
- cred = None
- if credInfo:
- cred = _credentialAssembly(credInfo)
-
- return IscsiConnectionParameters(target, iface, cred)
-
-
-def _namedtupleAssembly(nt, d):
- d = d.copy()
- for field in nt._fields:
- if field not in d:
- d[field] = None
-
- return nt(**d)
-
-_posixFsParameterAssembly = partial(_namedtupleAssembly,
- PosixFsConnectionParameters)
-_glusterFsParameterAssembly = partial(_namedtupleAssembly,
- GlusterFsConnectionParameters)
-_nfsParamerterAssembly = partial(_namedtupleAssembly, NfsConnectionParameters)
-_localFsParameterAssembly = partial(_namedtupleAssembly,
- LocaFsConnectionParameters)
-
-
-_TYPE_NT_MAPPING = {
- 'iscsi': _iscsiParameterAssembly,
- 'sharedfs': _posixFsParameterAssembly,
- 'posixfs': _posixFsParameterAssembly,
- 'glusterfs': _glusterFsParameterAssembly,
- 'nfs': _nfsParamerterAssembly,
- 'localfs': _localFsParameterAssembly}
-
-
-def dict2conInfo(d):
- conType = d['type']
- params = _TYPE_NT_MAPPING[conType](d.get('params', {}))
- return ConnectionInfo(conType, params)
class ExampleConnection(object):
--
To view, visit https://gerrit.ovirt.org/65071
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7c442e73c6eca16384c3cdd53478b182affe1097
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <alitke(a)redhat.com>
7 years, 7 months
Change in vdsm[master]: resourceManager: Make ResourceMananger private
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: resourceManager: Make ResourceMananger private
......................................................................
resourceManager: Make ResourceMananger private
Just to make sure that nobody will try to create its own instance
somewhere.
Change-Id: I35c3cffb4e1af8aa0f238c3501a82b975d56c2c3
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M tests/storage_resourcemanager_test.py
M vdsm/storage/resourceManager.py
2 files changed, 4 insertions(+), 4 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/38/65038/1
diff --git a/tests/storage_resourcemanager_test.py b/tests/storage_resourcemanager_test.py
index 5859f61..d324670 100644
--- a/tests/storage_resourcemanager_test.py
+++ b/tests/storage_resourcemanager_test.py
@@ -115,9 +115,9 @@
def manager():
"""
- Create fresh ResourceManager instance for testing.
+ Create fresh _ResourceManager instance for testing.
"""
- manager = rm.ResourceManager()
+ manager = rm._ResourceManager()
manager.registerNamespace("storage", rm.SimpleResourceFactory())
manager.registerNamespace("null", NullResourceFactory())
manager.registerNamespace("string", StringResourceFactory())
diff --git a/vdsm/storage/resourceManager.py b/vdsm/storage/resourceManager.py
index a3b0c0e..20aa06c 100644
--- a/vdsm/storage/resourceManager.py
+++ b/vdsm/storage/resourceManager.py
@@ -330,7 +330,7 @@
repr(self.__wrappedObject) if self.isValid else None)
-class ResourceManager(object):
+class _ResourceManager(object):
"""
Manages all the resources in the application.
@@ -1007,7 +1007,7 @@
# The single resource manager - this instance is monkeypatched by the tests.
-_manager = ResourceManager()
+_manager = _ResourceManager()
# Public api - client should use only these to manage resources.
--
To view, visit https://gerrit.ovirt.org/65038
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I35c3cffb4e1af8aa0f238c3501a82b975d56c2c3
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
7 years, 7 months
Change in vdsm[master]: resourceManager: Get rid of getInstance
by Nir Soffer
Nir Soffer has uploaded a new change for review.
Change subject: resourceManager: Get rid of getInstance
......................................................................
resourceManager: Get rid of getInstance
The single instance of ResourceManager is created in import time,
eliminating the clumsy getInstance mechanism.
Internal callers in the resourceManager module are using now the module
interface directly.
Change-Id: I136ab52f15332f43f2b0ecd9e9a2ff7b558df87a
Signed-off-by: Nir Soffer <nsoffer(a)redhat.com>
---
M tests/storage_resourcemanager_test.py
M vdsm/storage/resourceManager.py
2 files changed, 57 insertions(+), 87 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/37/65037/1
diff --git a/tests/storage_resourcemanager_test.py b/tests/storage_resourcemanager_test.py
index 8ff65c8..5859f61 100644
--- a/tests/storage_resourcemanager_test.py
+++ b/tests/storage_resourcemanager_test.py
@@ -130,19 +130,13 @@
class ResourceManagerTests(TestCaseBase):
- @MonkeyPatch(rm.ResourceManager, "_instance", manager())
+ @MonkeyPatch(rm, "_manager", manager())
def testErrorInFactory(self):
req = rm._registerResource(
"error", "resource", rm.EXCLUSIVE, lambda req, res: 1)
self.assertTrue(req.canceled())
- @MonkeyPatch(rm.ResourceManager, "_instance", manager())
- def testSingleton(self):
- a = rm.ResourceManager.getInstance()
- b = rm.ResourceManager.getInstance()
- self.assertEquals(id(a), id(b))
-
- @MonkeyPatch(rm.ResourceManager, "_instance", manager())
+ @MonkeyPatch(rm, "_manager", manager())
def testRegisterInvalidNamespace(self):
try:
rm.registerNamespace("I.HEART.DOTS", rm.SimpleResourceFactory())
@@ -151,7 +145,7 @@
self.fail("Managed to register an invalid namespace")
- @MonkeyPatch(rm.ResourceManager, "_instance", manager())
+ @MonkeyPatch(rm, "_manager", manager())
def testFailCreateAfterSwitch(self):
resources = []
@@ -166,30 +160,30 @@
self.assertTrue(sharedReq1.canceled())
self.assertEquals(resources[0], None)
- @MonkeyPatch(rm.ResourceManager, "_instance", manager())
+ @MonkeyPatch(rm, "_manager", manager())
def testReregisterNamespace(self):
self.assertRaises((ValueError, KeyError), rm.registerNamespace,
"storage", rm.SimpleResourceFactory())
- @MonkeyPatch(rm.ResourceManager, "_instance", manager())
+ @MonkeyPatch(rm, "_manager", manager())
def testResourceSwitchLockTypeFail(self):
self.testResourceLockSwitch("switchfail")
- @MonkeyPatch(rm.ResourceManager, "_instance", manager())
+ @MonkeyPatch(rm, "_manager", manager())
def testRequestInvalidResource(self):
self.assertRaises(ValueError, rm.acquireResource,
"storage", "DOT.DOT", rm.SHARED)
self.assertRaises(ValueError, rm.acquireResource,
"DOT.DOT", "resource", rm.SHARED)
- @MonkeyPatch(rm.ResourceManager, "_instance", manager())
+ @MonkeyPatch(rm, "_manager", manager())
def testReleaseInvalidResource(self):
self.assertRaises(ValueError, rm.releaseResource,
"DONT_EXIST", "resource")
self.assertRaises(ValueError, rm.releaseResource, "storage",
"DOT")
- @MonkeyPatch(rm.ResourceManager, "_instance", manager())
+ @MonkeyPatch(rm, "_manager", manager())
def testResourceWrapper(self):
s = StringIO
with rm.acquireResource("string", "test", rm.EXCLUSIVE) as resource:
@@ -198,7 +192,7 @@
continue
self.assertTrue(hasattr(resource, attr))
- @MonkeyPatch(rm.ResourceManager, "_instance", manager())
+ @MonkeyPatch(rm, "_manager", manager())
def testAccessAttributeNotExposedByWrapper(self):
with rm.acquireResource("string", "test", rm.EXCLUSIVE) as resource:
try:
@@ -212,7 +206,7 @@
self.fail("Managed to access an attribute not exposed by wrapper")
- @MonkeyPatch(rm.ResourceManager, "_instance", manager())
+ @MonkeyPatch(rm, "_manager", manager())
def testAccessAttributeNotExposedByRequestRef(self):
resources = []
@@ -233,7 +227,7 @@
self.fail("Managed to access an attribute not exposed by wrapper")
- @MonkeyPatch(rm.ResourceManager, "_instance", manager())
+ @MonkeyPatch(rm, "_manager", manager())
def testRequestRefStr(self):
resources = []
@@ -247,7 +241,7 @@
req.wait()
resources[0].release()
- @MonkeyPatch(rm.ResourceManager, "_instance", manager())
+ @MonkeyPatch(rm, "_manager", manager())
def testRequestRefCmp(self):
resources = []
requests = []
@@ -278,7 +272,7 @@
self.assertNotEqual(req1, "STUFF")
- @MonkeyPatch(rm.ResourceManager, "_instance", manager())
+ @MonkeyPatch(rm, "_manager", manager())
def testRequestRecancel(self):
resources = []
@@ -295,7 +289,7 @@
blocker.release()
- @MonkeyPatch(rm.ResourceManager, "_instance", manager())
+ @MonkeyPatch(rm, "_manager", manager())
def testRequestRegrant(self):
resources = []
@@ -306,7 +300,7 @@
req.grant()
self.assertRaises(rm.RequestAlreadyProcessedError, req.grant)
- @MonkeyPatch(rm.ResourceManager, "_instance", manager())
+ @MonkeyPatch(rm, "_manager", manager())
def testRequestWithBadCallbackOnCancel(self):
def callback(req, res):
raise Exception("BUY MILK!")
@@ -319,7 +313,7 @@
blocker.release()
- @MonkeyPatch(rm.ResourceManager, "_instance", manager())
+ @MonkeyPatch(rm, "_manager", manager())
def testRequestWithBadCallbackOnGrant(self):
def callback(req, res):
res.release()
@@ -329,13 +323,13 @@
"string", "resource", rm.EXCLUSIVE, callback)
req.wait()
- @MonkeyPatch(rm.ResourceManager, "_instance", manager())
+ @MonkeyPatch(rm, "_manager", manager())
def testRereleaseResource(self):
res = rm.acquireResource("string", "resource", rm.EXCLUSIVE)
res.release()
res.release()
- @MonkeyPatch(rm.ResourceManager, "_instance", manager())
+ @MonkeyPatch(rm, "_manager", manager())
def testCancelExclusiveBetweenShared(self):
resources = []
@@ -379,11 +373,11 @@
while len(resources) > 0:
resources.pop().release()
- @MonkeyPatch(rm.ResourceManager, "_instance", manager())
+ @MonkeyPatch(rm, "_manager", manager())
def testCrashOnSwitch(self):
self.testResourceLockSwitch("crashy")
- @MonkeyPatch(rm.ResourceManager, "_instance", manager())
+ @MonkeyPatch(rm, "_manager", manager())
def testResourceLockSwitch(self, namespace="string"):
resources = []
@@ -424,7 +418,7 @@
hash(exclusive3)
hash(sharedReq3)
- @MonkeyPatch(rm.ResourceManager, "_instance", manager())
+ @MonkeyPatch(rm, "_manager", manager())
def testResourceAcquireTimeout(self):
exclusive1 = rm.acquireResource("string", "resource", rm.EXCLUSIVE)
self.assertRaises(rm.RequestTimedOutError,
@@ -432,12 +426,12 @@
rm.EXCLUSIVE, 1)
exclusive1.release()
- @MonkeyPatch(rm.ResourceManager, "_instance", manager())
+ @MonkeyPatch(rm, "_manager", manager())
def testResourceAcquireInvalidTimeout(self):
self.assertRaises(TypeError, rm.acquireResource, "string",
"resource", rm.EXCLUSIVE, "A")
- @MonkeyPatch(rm.ResourceManager, "_instance", manager())
+ @MonkeyPatch(rm, "_manager", manager())
def testResourceInvalidation(self):
resource = rm.acquireResource("string", "test", rm.EXCLUSIVE)
try:
@@ -447,11 +441,11 @@
resource.release()
self.assertRaises(Exception, resource.write, "test")
- @MonkeyPatch(rm.ResourceManager, "_instance", manager())
+ @MonkeyPatch(rm, "_manager", manager())
def testForceRegisterNamespace(self):
rm.registerNamespace("storage", rm.SimpleResourceFactory(), True)
- @MonkeyPatch(rm.ResourceManager, "_instance", manager())
+ @MonkeyPatch(rm, "_manager", manager())
def testResourceAutorelease(self):
self.log.info("Acquiring resource", extra={'resource': "bob"})
res = rm.acquireResource("storage", "resource", rm.SHARED)
@@ -471,7 +465,7 @@
break
time.sleep(1)
- @MonkeyPatch(rm.ResourceManager, "_instance", manager())
+ @MonkeyPatch(rm, "_manager", manager())
def testAcquireResourceShared(self):
res1 = rm.acquireResource("storage", "resource", rm.SHARED)
res2 = rm.acquireResource("storage", "resource", rm.SHARED, 10)
@@ -479,7 +473,7 @@
res1.release()
res2.release()
- @MonkeyPatch(rm.ResourceManager, "_instance", manager())
+ @MonkeyPatch(rm, "_manager", manager())
def testResourceStatuses(self):
self.assertEquals(rm._getResourceStatus("storage", "resource"),
rm.LockState.free)
@@ -499,7 +493,7 @@
self.fail("Managed to get status on a non existing resource")
- @MonkeyPatch(rm.ResourceManager, "_instance", manager())
+ @MonkeyPatch(rm, "_manager", manager())
def testAcquireNonExistingResource(self):
try:
rm.acquireResource("null", "resource", rm.EXCLUSIVE)
@@ -508,7 +502,7 @@
self.fail("Managed to get status on a non existing resource")
- @MonkeyPatch(rm.ResourceManager, "_instance", manager())
+ @MonkeyPatch(rm, "_manager", manager())
def testAcquireResourceExclusive(self):
resources = []
@@ -548,7 +542,7 @@
self.assertTrue(exclusiveReq2.granted())
resources.pop().release() # exclusiveReq 2
- @MonkeyPatch(rm.ResourceManager, "_instance", manager())
+ @MonkeyPatch(rm, "_manager", manager())
def testCancelRequest(self):
resources = []
@@ -575,7 +569,7 @@
self.assertTrue(exclusiveReq3.granted())
resources.pop().release() # exclusiveReq 3
- @MonkeyPatch(rm.ResourceManager, "_instance", manager())
+ @MonkeyPatch(rm, "_manager", manager())
@slowtest
@stresstest
def testStressTest(self):
@@ -697,19 +691,18 @@
self.assertFalse(a < b)
self.assertFalse(b < a)
+ @MonkeyPatch(rm, "_manager", FakeResourceManager())
def test_acquire_release(self):
- fake_rm = FakeResourceManager()
-
lock = rm.ResourceManagerLock('ns_A', 'name_A', rm.SHARED)
- lock._rm = fake_rm
expected = []
lock.acquire()
expected.append(('acquireResource',
- (lock.ns, lock.name, lock.mode), {}))
- self.assertEqual(expected, fake_rm.__calls__)
+ (lock.ns, lock.name, lock.mode),
+ {"timeout": None}))
+ self.assertEqual(expected, rm._manager.__calls__)
lock.release()
expected.append(('releaseResource', (lock.ns, lock.name), {}))
- self.assertEqual(expected, fake_rm.__calls__)
+ self.assertEqual(expected, rm._manager.__calls__)
def test_repr(self):
mode = rm.SHARED
diff --git a/vdsm/storage/resourceManager.py b/vdsm/storage/resourceManager.py
index 5bb4550..a3b0c0e 100644
--- a/vdsm/storage/resourceManager.py
+++ b/vdsm/storage/resourceManager.py
@@ -292,13 +292,11 @@
"ignored.")
return
- ResourceManager.getInstance().releaseResource(self.namespace,
- self.name)
+ releaseResource(self.namespace, self.name)
self._isValid = False
def getStatus(self):
- return ResourceManager.getInstance().getResourceStatus(self.namespace,
- self.name)
+ return _getResourceStatus(self.namespace, self.name)
def __enter__(self):
return self
@@ -318,7 +316,7 @@
# might try to acquire the lock in a locked context and reach a
# deadlock. This is why I need to use a timer. It will defer
# the operation and use a different context.
- ResourceManager.getInstance().releaseResource(namespace, name)
+ releaseResource(namespace, name)
t = concurrent.thread(
release,
args=(self._log, self.namespace, self.name),
@@ -336,30 +334,16 @@
"""
Manages all the resources in the application.
- This class is a singleton. use `getInstance()` to get the global instance
+ This class is for internal usage only, clients should use the module
+ interface.
"""
_log = logging.getLogger("storage.ResourceManager")
_namespaceValidator = re.compile(r"^[\w\d_-]+$")
_resourceNameValidator = re.compile(r"^[^\s.]+$")
- _instance = None
- _singletonLock = threading.Lock()
-
def __init__(self):
self._syncRoot = rwlock.RWLock()
self._namespaces = {}
-
- @classmethod
- def getInstance(cls):
- """
- Get the global resource manager
- """
- if cls._instance is None:
- with cls._singletonLock:
- if cls._instance is None:
- cls._instance = ResourceManager()
-
- return cls._instance
def registerNamespace(self, namespace, factory, force=False):
if not self._namespaceValidator.match(namespace):
@@ -782,8 +766,6 @@
if raiseonfailure is None:
raiseonfailure = self.raiseonfailure
- manager = ResourceManager.getInstance()
-
if timeout_ms is not None:
timeout = timeout_ms / 1000.0
@@ -796,8 +778,8 @@
"already acquired" % (self, fullName))
try:
- resource = manager.acquireResource(namespace, name,
- locktype, timeout)
+ resource = acquireResource(namespace, name, locktype,
+ timeout)
self.resources[resource.fullName] = resource
if hasattr(self.ownerobject, "resourceAcquired"):
@@ -844,8 +826,6 @@
raise ValueError("Owner %s: acquire: resource %s is already "
"acquired" % (self, fullName))
- manager = ResourceManager.getInstance()
-
self.lock.acquire()
try:
if fullName in self.requests:
@@ -853,8 +833,8 @@
(fullName, self))
try:
- request = manager.registerResource(namespace, name, locktype,
- self._onRequestFinished)
+ request = _registerResource(namespace, name, locktype,
+ self._onRequestFinished)
except ValueError as ex:
self.log.debug("%s: request for '%s' could not be processed "
"(%s)", self, fullName, ex)
@@ -1002,7 +982,6 @@
self._ns = ns
self._name = name
self._mode = mode
- self._rm = ResourceManager.getInstance()
@property
def ns(self):
@@ -1017,45 +996,43 @@
return self._mode
def acquire(self):
- res = self._rm.acquireResource(self.ns, self.name, self.mode)
+ res = acquireResource(self.ns, self.name, self.mode)
# Locks are released by default then the last reference is garbage
# collected. Since we don't need the reference we'll just disable
# autoRelease.
res.autoRelease = False
def release(self):
- self._rm.releaseResource(self.ns, self.name)
+ releaseResource(self.ns, self.name)
+
+
+# The single resource manager - this instance is monkeypatched by the tests.
+_manager = ResourceManager()
# Public api - client should use only these to manage resources.
def registerNamespace(namespace, factory, force=False):
- manager = ResourceManager.getInstance()
- manager.registerNamespace(namespace, factory, force=force)
+ _manager.registerNamespace(namespace, factory, force=force)
def unregisterNamespace(namespace):
- manager = ResourceManager.getInstance()
- manager.unregisterNamespace(namespace)
+ _manager.unregisterNamespace(namespace)
def acquireResource(namespace, name, lockType, timeout=None):
- manager = ResourceManager.getInstance()
- return manager.acquireResource(namespace, name, lockType, timeout=timeout)
+ return _manager.acquireResource(namespace, name, lockType, timeout=timeout)
def releaseResource(namespace, name):
- manager = ResourceManager.getInstance()
- manager.releaseResource(namespace, name)
+ _manager.releaseResource(namespace, name)
# Private apis for the tests - clients should never use these!
def _registerResource(namespace, name, lockType, callback):
- manager = ResourceManager.getInstance()
- return manager.registerResource(namespace, name, lockType, callback)
+ return _manager.registerResource(namespace, name, lockType, callback)
def _getResourceStatus(namespace, name):
- manager = ResourceManager.getInstance()
- return manager.getResourceStatus(namespace, name)
+ return _manager.getResourceStatus(namespace, name)
--
To view, visit https://gerrit.ovirt.org/65037
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I136ab52f15332f43f2b0ecd9e9a2ff7b558df87a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer(a)redhat.com>
7 years, 7 months