f42ba1daac
533d708d-fix-showing-vcpus-values.patch 533d7602-fix-changing-graphics-type.patch 533d7be7-clarify-iscsi-IQN-fields.patch - Dropped virtman-init-vm-processor-topology.patch in favor of upstream 533d708d-fix-showing-vcpus-values.patch - bnc#869024 - Build0198: Only option to create a virtual machine is "import existing disk image" virtman-add-s390x-arch-support.patch - bnc#871642 - virt-manager wants to install libvirt-daemon-xen even when it is installed xen.spec - Xen: Virt-install won't reboot VM after install of SLE HVM guest because of libxl exception. virtinst-keep-cdrom-media-attached.patch - Fate#315125: add NOCOW flag virtinst-vol-default-nocow.patch - Upstream bug fixes 53375bad-raise-value-error-when-no-ipaddr-set.patch 53388de2-show-port-number-for-active-autoport-VM.patch 53397ae0-check-ip-address-format.patch 53399b45-hook-into-domain-balloon-event.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=162
63 lines
2.3 KiB
Diff
63 lines
2.3 KiB
Diff
Subject: interface: check ip address format
|
|
From: Chen Hanxiao chenhanxiao@cn.fujitsu.com Mon Mar 31 22:25:36 2014 +0800
|
|
Date: Mon Mar 31 22:25:36 2014 +0800:
|
|
Git: 89c45af26deca41cba5dffcc4cae5e653fedc89a
|
|
|
|
Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
|
|
|
|
Index: virt-manager-1.0.1/tests/xmlparse-xml/interface-test-bridge-ip-out.xml
|
|
===================================================================
|
|
--- virt-manager-1.0.1.orig/tests/xmlparse-xml/interface-test-bridge-ip-out.xml
|
|
+++ virt-manager-1.0.1/tests/xmlparse-xml/interface-test-bridge-ip-out.xml
|
|
@@ -15,7 +15,7 @@
|
|
</protocol>
|
|
<protocol family="ipv6">
|
|
<ip address="fe99::215:58ff:fe6e:5" prefix="32"/>
|
|
- <ip address="foobar" prefix="38"/>
|
|
+ <ip address="2002::" prefix="38"/>
|
|
<route gateway="1.2.3.4"/>
|
|
</protocol>
|
|
</interface>
|
|
Index: virt-manager-1.0.1/tests/xmlparse.py
|
|
===================================================================
|
|
--- virt-manager-1.0.1.orig/tests/xmlparse.py
|
|
+++ virt-manager-1.0.1/tests/xmlparse.py
|
|
@@ -958,7 +958,7 @@ class XMLParseTest(unittest.TestCase):
|
|
check("autoconf", True, False)
|
|
|
|
check = self._make_checker(iface.protocols[1].ips[1])
|
|
- check("address", "fe80::215:58ff:fe6e:5", "foobar")
|
|
+ check("address", "fe80::215:58ff:fe6e:5", "2002::")
|
|
check("prefix", 64, 38)
|
|
|
|
# Remove a child interface, verify it's data remains intact
|
|
Index: virt-manager-1.0.1/virtinst/interface.py
|
|
===================================================================
|
|
--- virt-manager-1.0.1.orig/virtinst/interface.py
|
|
+++ virt-manager-1.0.1/virtinst/interface.py
|
|
@@ -23,6 +23,7 @@ Classes for building and installing libv
|
|
import logging
|
|
|
|
import libvirt
|
|
+import ipaddr
|
|
|
|
from virtinst import util
|
|
from virtinst.xmlbuilder import XMLBuilder, XMLChildProperty, XMLProperty
|
|
@@ -32,7 +33,15 @@ class _IPAddress(XMLBuilder):
|
|
_XML_PROP_ORDER = ["address", "prefix"]
|
|
_XML_ROOT_NAME = "ip"
|
|
|
|
- address = XMLProperty("./@address")
|
|
+ ######################
|
|
+ # Validation helpers #
|
|
+ ######################
|
|
+
|
|
+ def _validate_ipaddr(self, addr):
|
|
+ ipaddr.IPAddress(addr)
|
|
+ return addr
|
|
+
|
|
+ address = XMLProperty("./@address", validate_cb=_validate_ipaddr)
|
|
prefix = XMLProperty("./@prefix", is_int=True)
|
|
|
|
|