[virt-tools-list] [virt-manager PATCH 3/3] deviceinterface: disallow using source dev for ethernet interface
Pavel Hrdina
phrdina at redhat.com
Fri Jul 8 16:11:18 UTC 2016
Device <interface type='ethernet'/> doesn't support <source dev=''/> attribute
and we should ignore it the same way as we do for <interface type='user'/>.
Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
---
virtinst/deviceinterface.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/virtinst/deviceinterface.py b/virtinst/deviceinterface.py
index 8ae203b..103c54a 100644
--- a/virtinst/deviceinterface.py
+++ b/virtinst/deviceinterface.py
@@ -182,9 +182,9 @@ class VirtualNetworkInterface(VirtualDevice):
return self._network
if self.type == self.TYPE_BRIDGE:
return self._bridge
- if self.type == self.TYPE_ETHERNET or self.type == self.TYPE_DIRECT:
+ if self.type == self.TYPE_DIRECT:
return self._source_dev
- if self.type == self.TYPE_USER:
+ if self.type == self.TYPE_USER or self.type == self.TYPE_ETHERNET:
return None
return self._network or self._bridge or self._source_dev
def _set_source(self, newsource):
@@ -200,7 +200,7 @@ class VirtualNetworkInterface(VirtualDevice):
self._network = newsource
elif self.type == self.TYPE_BRIDGE:
self._bridge = newsource
- elif self.type == self.TYPE_ETHERNET or self.type == self.TYPE_DIRECT:
+ elif self.type == self.TYPE_DIRECT:
self._source_dev = newsource
source = property(_get_source, _set_source)
--
2.9.0
More information about the virt-tools-list
mailing list