Fabian Deutsch has uploaded a new change for review.
Change subject: vdsm-tool: Ensure that the vdsm uuid is a string
......................................................................
vdsm-tool: Ensure that the vdsm uuid is a string
Change-Id: I3c1f341dd66a468cf704158789e158f6d61f1d98
Signed-off-by: Fabian Deutsch <fabiand(a)fedoraproject.org>
---
M lib/vdsm/tool/register.py
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/70/46970/1
diff --git a/lib/vdsm/tool/register.py b/lib/vdsm/tool/register.py
index 47c8412..ae8fecd 100644
--- a/lib/vdsm/tool/register.py
+++ b/lib/vdsm/tool/register.py
@@ -271,8 +271,8 @@
os.unlink(__VDSM_ID)
if not os.path.exists(__VDSM_ID):
- with open(__VDSM_ID, 'w') as f:
- f.write(self.uuid)
+ with open(__VDSM_ID, 'wt') as f:
+ f.write(str(self.uuid))
if utils.isOvirtNode():
from ovirt.node.utils.fs import Config
--
To view, visit https://gerrit.ovirt.org/46970
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3c1f341dd66a468cf704158789e158f6d61f1d98
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand(a)redhat.com>
automation(a)ovirt.org has posted comments on this change.
Change subject: lib: grub2 module
......................................................................
Patch Set 5:
* 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.5', 'ovirt-3.4', 'ovirt-3.3'])
--
To view, visit https://gerrit.ovirt.org/47946
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I9e7e0b327882f64196a71fe20dcbd99017b80800
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Betak <mbetak(a)redhat.com>
Gerrit-Reviewer: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Michal Skrivanek <mskrivan(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: No
Martin Polednik has posted comments on this change.
Change subject: lib: grub2 module
......................................................................
Patch Set 3:
(3 comments)
https://gerrit.ovirt.org/#/c/47946/3/lib/vdsm/grub2.py
File lib/vdsm/grub2.py:
Line 45: return "Process failed with rc=%d out=%r err=%r" % (
Line 46: self.rc, self.out, self.err)
Line 47:
Line 48:
Line 49: def mkconfig(args):
> please add docstrings to functions. No need to document every parameter or
Added. No wiki yet, let me think about it.
Line 50: cmd = [_GRUB2_MKCONFIG.cmd]
Line 51: cmd.extend(args)
Line 52: rc, out, err = utils.execCmd(_GRUB2_MKCONFIG, raw=True)
Line 53: if rc != 0:
Line 160:
Line 161: device_vendor = device_vendor.lstrip('0x')
Line 162: device_product = device_product.lstrip('0x')
Line 163:
Line 164: if stub_ids:
> does the ordering matter? can we use a set?
Possibly!
Line 165: for vendor, product in stub_ids:
Line 166: if device_vendor == vendor and device_product == product:
Line 167: return
Line 168:
https://gerrit.ovirt.org/#/c/47946/3/tests/grub2Tests.py
File tests/grub2Tests.py:
Line 71: def testAddMultipleStubs(self):
Line 72: with tempfile.NamedTemporaryFile() as f:
Line 73: grub2.add_to_stub(
Line 74: ['cafe', '0xdead', '0xf00d', 'b002'],
Line 75: ['0xbeef', 'feed', '0xc00l', 'fa11'],
> I missed this reviewing the code! so question: why is it helpful to support
Discussed with engine, that will be the approach for next revision.
Line 76: cfg_source=self._test_file('grub2_default.out'),
Line 77: cfg_dest=f.name)
Line 78:
Line 79: data = f.read()
--
To view, visit https://gerrit.ovirt.org/47946
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I9e7e0b327882f64196a71fe20dcbd99017b80800
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Betak <mbetak(a)redhat.com>
Gerrit-Reviewer: Martin Polednik <mpolednik(a)redhat.com>
Gerrit-Reviewer: Michal Skrivanek <mskrivan(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-HasComments: Yes
Piotr Kliczewski has uploaded a new change for review.
Change subject: init: run configure --force on upgrade from ovirt-3.5
......................................................................
init: run configure --force on upgrade from ovirt-3.5
In case we upgrade from ovirt-3.5 we now run configure --force to make
sure that vdsm is configured properly.
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1276736
Change-Id: I9044d10dc5252f2407eccbbf82cd7589638b44ea
Signed-off-by: pkliczewski <piotr.kliczewski(a)gmail.com>
---
M init/vdsmd_init_common.sh.in
1 file changed, 2 insertions(+), 6 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/94/48194/1
diff --git a/init/vdsmd_init_common.sh.in b/init/vdsmd_init_common.sh.in
index 503b88e..1f24ff1 100644
--- a/init/vdsmd_init_common.sh.in
+++ b/init/vdsmd_init_common.sh.in
@@ -254,13 +254,9 @@
local upgraded_ver_file="@VDSMLIBDIR@/upgraded_version"
if [ -f "${upgraded_ver_file}" ]; then
local ret=0
- if grep -q '^vdsm-4\.10\.' "${upgraded_ver_file}"; then
- # REQUIRED_FOR upgrade from vdsm-4.10.x
+ if grep -q -E '^vdsm-4\.10\.|^vdsm-4\.16\.' "${upgraded_ver_file}"; then
+ # REQUIRED_FOR upgrade from vdsm-4.10.x or vdsm-4.16.z
"$VDSM_TOOL" configure --force
- ret=$?
- elif grep -q '^vdsm-4\.16\.' "${upgraded_ver_file}"; then
- # REQUIRED_FOR upgrade from vdsm-4.16.z
- "$VDSM_TOOL" configure --module multipath
ret=$?
fi
[ "${ret}" -eq 0 ] && rm -f "${upgraded_ver_file}"
--
To view, visit https://gerrit.ovirt.org/48194
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9044d10dc5252f2407eccbbf82cd7589638b44ea
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski(a)gmail.com>
Ido Barkan has uploaded a new change for review.
Change subject: net: fake sriov device hook
......................................................................
net: fake sriov device hook
This hook fakes both getVdsCaps and hostdevListByCaps to make VDSM
report devices and capabilities of an SR-IOV capable host.
Change-Id: Ic661e152adf6365962b5d9fd215277b36bc49383
Signed-off-by: Ido Barkan <ibarkan(a)redhat.com>
---
M configure.ac
M contrib/shell_helper
M vdsm.spec.in
M vdsm_hooks/Makefile.am
A vdsm_hooks/fakesriov/Makefile.am
A vdsm_hooks/fakesriov/after_get_caps.py
A vdsm_hooks/fakesriov/after_hostdev_list_by_caps.py
7 files changed, 185 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/47/47847/1
diff --git a/configure.ac b/configure.ac
index 068c4b5..e68f1b4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -369,6 +369,7 @@
vdsm_hooks/diskunmap/Makefile
vdsm_hooks/ethtool_options/Makefile
vdsm_hooks/extnet/Makefile
+ vdsm_hooks/fakesriov/Makefile
vdsm_hooks/fakevmstats/Makefile
vdsm_hooks/faqemu/Makefile
vdsm_hooks/fileinject/Makefile
diff --git a/contrib/shell_helper b/contrib/shell_helper
index 7dc2984..6b6314a 100755
--- a/contrib/shell_helper
+++ b/contrib/shell_helper
@@ -10,7 +10,7 @@
_latest_rpms() {
local VERSION=$(_latest_version)
- find ~/rpmbuild/RPMS/ -iname "*$VERSION*.rpm" | egrep "vdsm-[0-9]|python|cli|xmlrpc|jsonrpc|tests|infra"
+ find ~/rpmbuild/RPMS/ -iname "*$VERSION*.rpm" | egrep "vdsm-[0-9]|python|cli|xmlrpc|jsonrpc|tests|infra|api"
}
vdsm_configure_force() {
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 3d6b51a..3c49487 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -430,6 +430,14 @@
To enable this hook on your host, set vars.fake_vmstats_enable=true in your
/etc/vdsm/vdsm.conf.
+%package hook-fakesriov
+Summary: Generate fake SR-IOV dsvices
+Requires: %{name}
+
+%description hook-fakesriov
+Hook intercepts reported host device by hostdevListByCaps and adds
+1 fake sriov devices and 2 fake virtual function devices
+
%package hook-fileinject
Summary: Allow uploading file to VMs disk
Requires: python-libguestfs
@@ -1273,6 +1281,11 @@
%defattr(-, root, root, -)
%{_libexecdir}/%{vdsm_name}/hooks/after_get_all_vm_stats/10_fakevmstats
+%files hook-fakesriov
+%defattr(-, root, root, -)
+%{_libexecdir}/%{vdsm_name}/hooks/after_hostdev_list_by_caps/10_fakesriov
+%{_libexecdir}/%{vdsm_name}/hooks/after_get_caps/10_fakesriov
+
%files hook-fileinject
%defattr(-, root, root, -)
%{_libexecdir}/%{vdsm_name}/hooks/before_vm_start/50_fileinject
diff --git a/vdsm_hooks/Makefile.am b/vdsm_hooks/Makefile.am
index 0573b2c..dda39bc 100644
--- a/vdsm_hooks/Makefile.am
+++ b/vdsm_hooks/Makefile.am
@@ -40,6 +40,7 @@
diskunmap \
extnet \
fileinject \
+ fakesriov \
fakevmstats \
floppy \
hostusb \
diff --git a/vdsm_hooks/fakesriov/Makefile.am b/vdsm_hooks/fakesriov/Makefile.am
new file mode 100644
index 0000000..2d6bc8d
--- /dev/null
+++ b/vdsm_hooks/fakesriov/Makefile.am
@@ -0,0 +1,40 @@
+#
+# Copyright 2015 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
+#
+
+include $(top_srcdir)/build-aux/Makefile.subs
+
+CLEANFILES = \
+ config.log
+
+EXTRA_DIST = \
+ after_hostdev_list_by_caps.py \
+ after_get_caps.py
+
+install-data-local:
+ $(MKDIR_P) $(DESTDIR)$(vdsmhooksdir)/after_hostdev_list_by_caps
+ $(INSTALL_SCRIPT) $(srcdir)/after_hostdev_list_by_caps.py \
+ $(DESTDIR)$(vdsmhooksdir)/after_hostdev_list_by_caps/10_fakesriov
+ $(MKDIR_P) $(DESTDIR)$(vdsmhooksdir)/after_get_caps
+ $(INSTALL_SCRIPT) $(srcdir)/after_get_caps.py \
+ $(DESTDIR)$(vdsmhooksdir)/after_get_caps/10_fakesriov
+
+uninstall-local:
+ $(RM) $(DESTDIR)$(vdsmhooksdir)/after_hostdev_list_by_caps/10_fakesriov
+ $(RM) $(DESTDIR)$(vdsmhooksdir)/after_get_caps/10_fakesriov
diff --git a/vdsm_hooks/fakesriov/after_get_caps.py b/vdsm_hooks/fakesriov/after_get_caps.py
new file mode 100644
index 0000000..38dbb39
--- /dev/null
+++ b/vdsm_hooks/fakesriov/after_get_caps.py
@@ -0,0 +1,57 @@
+#!/usr/bin/python
+#
+# Copyright 2015 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 hooking
+
+_PASSTHROUGH_SUPPORT = {
+ 'hostdevPassthrough': True}
+_NICS = {
+ 'enp2s0f0': {
+ 'addr': '', 'cfg': {'BOOTPROTO': 'none', 'BRIDGE': 'ovirtmgmt',
+ 'DEVICE': 'enp2s0f0',
+ 'HWADDR': '78:e7:d1:e4:8f:16', 'IPV6INIT': 'no',
+ 'MTU': '1500', 'NM_CONTROLLED': 'no',
+ 'ONBOOT': 'yes'}, 'dhcpv4': False, 'dhcpv6': False,
+ 'gateway': '', 'hwaddr': '78:e7:d1:e4:8f:16', 'ipv4addrs': [],
+ 'ipv6addrs': ['fe80::7ae7:d1ff:fee4:8f16/64'], 'ipv6gateway': '::',
+ 'mtu': '1500', 'netmask': '', 'speed': 1000},
+ 'enp2s16': {'addr': '', 'cfg': {'BOOTPROTO': 'none', 'DEVICE': 'enp2s16',
+ 'HWADDR': 'be:b8:2b:a8:15:bf', 'MTU': '1500',
+ 'NM_CONTROLLED': 'no', 'ONBOOT': 'yes'},
+ 'dhcpv4': False, 'dhcpv6': False, 'gateway': '',
+ 'hwaddr': 'aa:8c:31:98:8a:9a', 'ipv4addrs': [],
+ 'ipv6addrs': [], 'ipv6gateway': '::', 'mtu': '1500',
+ 'netmask': '', 'speed': 0},
+ 'enp2s16f2': {'addr': '', 'cfg': {'BOOTPROTO': 'none', 'BRIDGE': 'net',
+ 'DEVICE': 'enp2s16f2',
+ 'HWADDR': '26:83:76:ec:08:6b',
+ 'IPV6INIT': 'no', 'MTU': '1500',
+ 'NM_CONTROLLED': 'no', 'ONBOOT': 'yes'},
+ 'dhcpv4': False, 'dhcpv6': False, 'gateway': '',
+ 'hwaddr': 'ce:1f:0b:d1:ca:93', 'ipv4addrs': [],
+ 'ipv6addrs': [], 'ipv6gateway': '::', 'mtu': '1500',
+ 'netmask': '', 'speed': 0}}
+
+if __name__ == '__main__':
+ caps = hooking.read_json()
+ caps.update(_PASSTHROUGH_SUPPORT)
+ caps['nics'].update(_NICS)
+ hooking.write_json(caps)
diff --git a/vdsm_hooks/fakesriov/after_hostdev_list_by_caps.py b/vdsm_hooks/fakesriov/after_hostdev_list_by_caps.py
new file mode 100644
index 0000000..2db7ffe
--- /dev/null
+++ b/vdsm_hooks/fakesriov/after_hostdev_list_by_caps.py
@@ -0,0 +1,72 @@
+#!/usr/bin/python
+#
+# Copyright 2015 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 hooking
+
+_FAKE_SRIOV = {
+ # sriov device
+ 'pci_0000_02_00_0': {
+ 'params': {
+ 'address': {'bus': '2', 'domain': '0', 'function': '0',
+ 'slot': '0'},
+ 'capability': 'pci', 'iommu_group': '15',
+ 'parent': 'pci_0000_00_03_0',
+ 'product': '82576 Gigabit Network Connection',
+ 'product_id': '0x10e7', 'totalvfs': 7,
+ 'vendor': 'Intel Corporation', 'vendor_id': '0x8086'}},
+ # sriov net device
+ 'net_enp2s0f0_78_e7_d1_e4_8f_16': {
+ 'params': {
+ 'capability': 'net', 'interface': 'enp2s0f0',
+ 'parent': 'pci_0000_02_00_0'}},
+ # vf1
+ 'pci_0000_02_10_0': {
+ 'params': {
+ 'address': {'bus': '2', 'domain': '0', 'function': '0',
+ 'slot': '16'},
+ 'capability': 'pci', 'iommu_group': '23',
+ 'parent': 'pci_0000_00_03_0', 'physfn': 'pci_0000_02_00_0',
+ 'product': '82576 Virtual Function', 'product_id': '0x10ca',
+ 'vendor': 'Intel Corporation', 'vendor_id': '0x8086'}},
+ # vf1 net device
+ 'net_enp2s16_aa_8c_31_98_8a_9a': {
+ 'params': {
+ 'capability': 'net', 'interface': 'enp2s16',
+ 'parent': 'pci_0000_02_10_0'}},
+ # vf2
+ 'pci_0000_02_10_2': {
+ 'params': {
+ 'address': {'bus': '2', 'domain': '0', 'function': '2',
+ 'slot': '16'},
+ 'capability': 'pci', 'iommu_group': '24',
+ 'parent': 'pci_0000_00_03_0', 'physfn': 'pci_0000_02_00_0',
+ 'product': '82576 Virtual Function', 'product_id': '0x10ca',
+ 'vendor': 'Intel Corporation', 'vendor_id': '0x8086'}},
+ # vf2 net device
+ 'net_enp2s16f2_ce_1f_0b_d1_ca_93': {
+ 'params': {
+ 'capability': 'net', 'interface': 'enp2s16f2',
+ 'parent': 'pci_0000_02_10_2'}}}
+
+if __name__ == '__main__':
+ host_devices = hooking.read_json()
+ host_devices.update(_FAKE_SRIOV)
+ hooking.write_json(host_devices)
--
To view, visit https://gerrit.ovirt.org/47847
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic661e152adf6365962b5d9fd215277b36bc49383
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ido Barkan <ibarkan(a)redhat.com>