Deepak C Shetty has uploaded a new change for review.
Change subject: tests: Honour PYTHONPATH if set on the host
......................................................................
tests: Honour PYTHONPATH if set on the host
run_tests_local.sh doesn't honour PYTHONPATH if it was set.
This causes issues with the tests (sometimes) if user was using
a custom path for say libvirt ( running from a git src, rather
than installed rpm path). This path add $PYTHONPATH to the
script to fix the issue.
Change-Id: Ia4a3ac4d238da59abf558b628fa34cae90006b6e
Signed-off-by: Deepak C Shetty <deepakcs(a)linux.vnet.ibm.com>
---
M tests/run_tests_local.sh.in
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/48/7648/1
diff --git a/tests/run_tests_local.sh.in b/tests/run_tests_local.sh.in
index c4bc5c8..bb43538 100644
--- a/tests/run_tests_local.sh.in
+++ b/tests/run_tests_local.sh.in
@@ -1,2 +1,2 @@
#!/bin/sh
-PYTHONDONTWRITEBYTECODE=1 LC_ALL=C PYTHONPATH="@builddir@/vdsm:@top_srcdir@/vdsm:@top_srcdir@/vdsm_cli" @PYTHON@ @top_srcdir@/tests/testrunner.py --local-modules $@
+PYTHONDONTWRITEBYTECODE=1 LC_ALL=C PYTHONPATH="$PYTHONPATH:@builddir@/vdsm:@top_srcdir@/vdsm:@top_srcdir@/vdsm_cli" @PYTHON@ @top_srcdir@/tests/testrunner.py --local-modules $@
--
To view, visit http://gerrit.ovirt.org/7648
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia4a3ac4d238da59abf558b628fa34cae90006b6e
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Deepak C Shetty <deepakcs(a)linux.vnet.ibm.com>
Moti Asayag has uploaded a new change for review.
Change subject: BZ#811807 Define network filter on libvirt
......................................................................
BZ#811807 Define network filter on libvirt
The patch defines custom network filter on libvirt in order to control
the VM traffic. The custom filter is being set when VDSM service is
being started.
Change-Id: I9f1708385dec6a87bc404e4ab25c4da8ab8a8acc
Signed-off-by: Moti Asayag <masayag(a)redhat.com>
---
M vdsm.spec.in
M vdsm/Makefile.am
A vdsm/nwfilter.py
M vdsm/vdsmd.init.in
4 files changed, 120 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/54/7354/1
diff --git a/vdsm.spec.in b/vdsm.spec.in
index 892eee3..6af8a14 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -577,6 +577,7 @@
%{_datadir}/%{vdsm_name}/vdsm-store-net-config
%{_datadir}/%{vdsm_name}/vm.py*
%{_datadir}/%{vdsm_name}/write-net-config
+%attr (755,vdsm,kvm) %{_datadir}/%{vdsm_name}/nwfilter.py*
%config(noreplace) %{_sysconfdir}/%{vdsm_name}/logger.conf
%config(noreplace) %{_sysconfdir}/%{vdsm_name}/mom.conf
%config(noreplace) %{_sysconfdir}/%{vdsm_name}/mom.policy
diff --git a/vdsm/Makefile.am b/vdsm/Makefile.am
index 5992cfa..1a6d446 100644
--- a/vdsm/Makefile.am
+++ b/vdsm/Makefile.am
@@ -52,7 +52,8 @@
tc.py \
vdsmDebugPlugin.py \
vmChannels.py \
- vm.py
+ vm.py \
+ nwfilter.py
dist_vdsmpylib_PYTHON = \
__init__.py \
diff --git a/vdsm/nwfilter.py b/vdsm/nwfilter.py
new file mode 100755
index 0000000..0be7568
--- /dev/null
+++ b/vdsm/nwfilter.py
@@ -0,0 +1,101 @@
+#! /usr/bin/python
+# Copyright 2012 IBM, 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 libvirt
+import logging
+from vdsm import libvirtconnection
+
+
+def main():
+ """
+ Defines network filters on libvirt
+ """
+ conn = libvirtconnection.get()
+ defineNwFilter(conn, NoMacSpoofingFilter())
+ try:
+ conn.close()
+ except:
+ pass
+
+def defineNwFilter(conn, nwFilter):
+ """
+ define vdsm network filter on libvirt to control VM traffic
+ """
+
+ filter = None
+ filterName = nwFilter.filterName
+ filterXml = nwFilter.buildFilterXml()
+
+ try:
+ filter = conn.nwfilterLookupByName(filterName)
+ except libvirt.libvirtError:
+ logging.debug("No such filter: %s" % (filterName))
+
+ if filter:
+ logging.debug("Undefine filter %s" % (filter.name()))
+ try:
+ filter.undefine()
+ except libvirt.libvirtError:
+ # Ignore failure if filter already exists. Failure might occur when
+ # attempting to remove a filter which is being used by running VMs
+ pass
+ try:
+ nwFilter = conn.nwfilterDefineXML(filterXml)
+ except libvirt.libvirtError:
+ logging.error("Failed to define filter %s" % (filterName))
+ raise
+ else:
+ logging.debug("Filter %s was defined" % (nwFilter.name()))
+
+
+class VdsmNwFilter(object):
+ """
+ Base class for custom network filters
+ """
+
+ def __init__(self, name):
+ self.filterName = name
+
+ def getFilterXml(self):
+ raise NotImplementedError("Should have implemented this")
+
+ def buildFilterXml(self):
+ return self.getFilterXml() % self.filterName
+
+
+class NoMacSpoofingFilter(VdsmNwFilter):
+ """
+ Class defines the vdsm-no-mac-spoofing filter which is comprised of
+ two libvirt OOB filters: no-mac-spoofing and no-arp-mac-spoofing
+ """
+
+ def __init__(self):
+ VdsmNwFilter.__init__(self, 'vdsm-no-mac-spoofing')
+
+ def getFilterXml(self):
+ return '''<filter name='%s' chain='root'>
+ <!-- preventing MAC spoofing -->
+ <filterref filter='no-mac-spoofing'/>
+ <!-- preventing ARP MAC spoofing -->
+ <filterref filter='no-arp-mac-spoofing'/>
+ </filter> '''
+
+if __name__ == '__main__':
+ main()
diff --git a/vdsm/vdsmd.init.in b/vdsm/vdsmd.init.in
index d34b48d..70d4cd9 100755
--- a/vdsm/vdsmd.init.in
+++ b/vdsm/vdsmd.init.in
@@ -440,6 +440,20 @@
startout=`/sbin/initctl start libvirtd 2>&1`
if [[ "$?" -eq 0 || "$startout" =~ .*already\ running.* ]];
then
+
+ # Begin workaround
+ # Libvirt reports its service status as responsive despite its socket
+ # is not yet ready. Once issue fixed on libvirt, this WA shouls be removed.
+ for i in {1..20}
+ do
+ if pgrep libvirtd > /dev/null 2>&1;
+ then
+ return 0
+ fi
+ sleep 1
+ done
+ # End workaround
+
return 0
else
echo "$startout" >&2
@@ -469,6 +483,8 @@
return $ret_val
fi
+ @VDSMDIR@/nwfilter.py
+
@VDSMDIR@/vdsm-restore-net-config
load_needed_modules
mk_data_center
--
To view, visit http://gerrit.ovirt.org/7354
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9f1708385dec6a87bc404e4ab25c4da8ab8a8acc
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Moti Asayag <masayag(a)redhat.com>
Federico Simoncelli has uploaded a new change for review.
Change subject: [WIP] Upgrade a data domain on attachSD when required
......................................................................
[WIP] Upgrade a data domain on attachSD when required
RHBZ: 844367
Signed-off-by: Federico Simoncelli <fsimonce(a)redhat.com>
Change-ID: I65dfd6dd339569fbaf276f3942a001c174423b1a
---
M vdsm/storage/sp.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/44/7444/1
diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py
index da403d9..4d2e0cf 100644
--- a/vdsm/storage/sp.py
+++ b/vdsm/storage/sp.py
@@ -935,7 +935,7 @@
# If you remove this condition, remove it from
# public_createStoragePool too.
- if dom.isData() and domVers != mstVers:
+ if dom.isData() and domVers > mstVers:
raise se.MixedSDVersionError(dom.sdUUID, domVers,
self.masterDomain.sdUUID, mstVers)
--
To view, visit http://gerrit.ovirt.org/7444
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I65dfd6dd339569fbaf276f3942a001c174423b1a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
Royce Lv has uploaded a new change for review.
Change subject: avoid _blockstatsParses throw exception when lacking some fields
......................................................................
avoid _blockstatsParses throw exception when lacking some fields
libvirt may return stats with some fields when running query-blockstats
avoid _blockstatsParses to throw exception when encounter keyError
Change-Id: Id898b1456d874b1a02f04115e285e329eb1c81e0
Signed-off-by: Royce Lv<lvroyce(a)linux.vnet.ibm.com>
---
M vdsm/libvirtvm.py
M vdsm/storage/hsm.py
2 files changed, 17 insertions(+), 6 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/04/4304/1
--
To view, visit http://gerrit.ovirt.org/4304
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id898b1456d874b1a02f04115e285e329eb1c81e0
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
Igor Lvovsky has uploaded a new change for review.
Change subject: BZ#845193 - Remove BRIDGE from nic/bond cofig file when removing bridge
......................................................................
BZ#845193 - Remove BRIDGE from nic/bond cofig file when removing bridge
Change-Id: I4b1c678469cee610d346d1e4905ee1f02f58f4bc
Signed-off-by: Igor Lvovsky <ilvovsky(a)redhat.com>
---
M vdsm/configNetwork.py
1 file changed, 11 insertions(+), 8 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/00/7600/1
diff --git a/vdsm/configNetwork.py b/vdsm/configNetwork.py
index 58117f8..74d19c7 100755
--- a/vdsm/configNetwork.py
+++ b/vdsm/configNetwork.py
@@ -1034,18 +1034,21 @@
if network and bridged:
configWriter.removeBridge(network)
+ name = None
if vlan:
configWriter.removeVlan(vlan, bonding or nics[0])
-
- # When removing bridgeless non-VLANed network
- # we need to remove IP/NETMASK from the cfg file
- name = None
- if not bridged and not vlan:
+ else:
name = bonding if bonding else nics[0]
- # Just edit the bond/nic cfg file
cf = configWriter.NET_CONF_PREF + name
- for key in ('IPADDR', 'NETMASK', 'GATEWAY', 'BOOTPROTO'):
- configWriter._updateConfigValue(cf, key, '', True)
+ if not bridged:
+ # When removing bridgeless non-VLANed network
+ # we need to remove IP/NETMASK from the cfg file
+ for key in ('IPADDR', 'NETMASK', 'GATEWAY', 'BOOTPROTO'):
+ configWriter._updateConfigValue(cf, key, '', True)
+ else:
+ # When removing bridged non-VLANed network
+ # we need to remove BRIDGE from the cfg file
+ configWriter._updateConfigValue(cf, 'BRIDGE', '', True)
# The (relatively) new setupNetwork verb allows to remove a network
# defined on top of an bonding device without break the bond itself.
--
To view, visit http://gerrit.ovirt.org/7600
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4b1c678469cee610d346d1e4905ee1f02f58f4bc
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Igor Lvovsky <ilvovsky(a)redhat.com>
Dan Kenigsberg has uploaded a new change for review.
Change subject: tc: avoid adding non-existing devices to filter
......................................................................
tc: avoid adding non-existing devices to filter
When a mirroring target dies, its tap device are removed. On `tc filter
show`, the tap device name is replaced with a string like `if17`, which
is not a name of an existing device.
This patch is somewhat racy, as another qemu may die just before the new
filter is set.
Change-Id: I9c1b459557985a3a894f182880411889f2c8a06f
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
---
M vdsm/tc.py
1 file changed, 3 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/31/7631/1
diff --git a/vdsm/tc.py b/vdsm/tc.py
index 47a7b96..d363d35 100644
--- a/vdsm/tc.py
+++ b/vdsm/tc.py
@@ -20,6 +20,8 @@
from collections import namedtuple
+import ethtool
+
import storage.misc
from vdsm.constants import EXT_TC, EXT_IFCONFIG
@@ -55,6 +57,7 @@
acts = set(filt.actions)
acts.discard(MirredAction(target))
+ acts.update(ethtool.get_devices())
if acts:
filt = Filter(prio=filt.prio, handle=filt.handle, actions=acts)
--
To view, visit http://gerrit.ovirt.org/7631
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9c1b459557985a3a894f182880411889f2c8a06f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>