From 7721d5764c9abe869d88e670c4acb794392dc9c1027f71c6b2fd065d3778503b Mon Sep 17 00:00:00 2001 From: Charles Arnold Date: Thu, 24 Jun 2010 19:41:37 +0000 Subject: [PATCH] - bnc#604611 - Do not store vif device details when vif config contains invalid mac address. 21653-xend-mac-addr.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=61 --- 21653-xend-mac-addr.patch | 46 +++++++++++++++++++++++++++++++++++++++ xen.changes | 7 ++++++ xen.spec | 2 ++ 3 files changed, 55 insertions(+) create mode 100644 21653-xend-mac-addr.patch diff --git a/21653-xend-mac-addr.patch b/21653-xend-mac-addr.patch new file mode 100644 index 0000000..293ffdb --- /dev/null +++ b/21653-xend-mac-addr.patch @@ -0,0 +1,46 @@ +# HG changeset patch +# User Ian Jackson +# Date 1277219220 -3600 +# Node ID 9da3abe88c90bd8ec48963a9ec537a8871e266db +# Parent 2ad890d46cb8a11fc6ea329126d398021307e627 +Check "mac" address sooner in device_create function, before doing device_add. + +In XendDomainInfo.py device_create function, when device type is +"vif", it has a paragraph to check the validity of "mac" +address. Before checking validity, device_add has been done. But after +checking validity, if the mac address is invlid, it raises VmError and +exits directly without doing clean work like removing the device item +from config info. This will cause that the incorrect mac address is +saved into VM Config file and VM fails to restart. If check "mac" +validity before doing device_add, there will be no problem. + +Signed-off-by Chunyan Liu + +Index: xen-4.0.0-testing/tools/python/xen/xend/XendDomainInfo.py +=================================================================== +--- xen-4.0.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py ++++ xen-4.0.0-testing/tools/python/xen/xend/XendDomainInfo.py +@@ -847,11 +847,6 @@ class XendDomainInfo: + @type dev_config: SXP object (parsed config) + """ + log.debug("XendDomainInfo.device_create: %s" % scrub_password(dev_config)) +- dev_type = sxp.name(dev_config) +- dev_uuid = self.info.device_add(dev_type, cfg_sxp = dev_config) +- dev_config_dict = self.info['devices'][dev_uuid][1] +- log.debug("XendDomainInfo.device_create: %s" % scrub_password(dev_config_dict)) +- + if dev_type == 'vif': + for x in dev_config: + if x != 'vif' and x[0] == 'mac': +@@ -859,6 +854,11 @@ class XendDomainInfo: + log.error("Virtual network interface creation error - invalid MAC Address entered: %s", x[1]) + raise VmError("Cannot create a new virtual network interface - MAC address is not valid!"); + ++ dev_type = sxp.name(dev_config) ++ dev_uuid = self.info.device_add(dev_type, cfg_sxp = dev_config) ++ dev_config_dict = self.info['devices'][dev_uuid][1] ++ log.debug("XendDomainInfo.device_create: %s" % scrub_password(dev_config_dict)) ++ + if self.domid is not None: + try: + dev_config_dict['devid'] = devid = \ diff --git a/xen.changes b/xen.changes index b2b7b77..dacb711 100644 --- a/xen.changes +++ b/xen.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Jun 22 11:50:35 MDT 2010 - jfehlig@novell.com + +- bnc#604611 - Do not store vif device details when vif config + contains invalid mac address. + 21653-xend-mac-addr.patch + ------------------------------------------------------------------- Wed Jun 16 08:36:44 MDT 2010 - carnold@novell.com diff --git a/xen.spec b/xen.spec index f7471d3..cee6303 100644 --- a/xen.spec +++ b/xen.spec @@ -117,6 +117,7 @@ Patch39: 21526-x86-nehalem-cpuid-mask.patch Patch40: 21542-amd-erratum-411.patch Patch41: 21615-dont-save-xen-heap-pages.patch Patch42: 21620-x86-signed-domain-irq.patch +Patch43: 21653-xend-mac-addr.patch # Our patches Patch300: xen-config.diff Patch301: xend-config.diff @@ -603,6 +604,7 @@ Authors: %patch40 -p1 %patch41 -p1 %patch42 -p1 +%patch43 -p1 %patch300 -p1 %patch301 -p1 %patch302 -p1