From 76fdecff9e008a1ba7ad4a9b860b0d25feb5b17cb5ecff230a78f71bc10290c1 Mon Sep 17 00:00:00 2001 From: OBS User buildservice-autocommit Date: Tue, 19 Apr 2011 10:52:15 +0000 Subject: [PATCH 1/2] Updating link to change in openSUSE:Factory/xen revision 130.0 OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=504e3c3cfb73346d547e4782f9a54c8a --- xen.spec | 115 +++++++++++++++++++++++++++---------------------------- 1 file changed, 57 insertions(+), 58 deletions(-) diff --git a/xen.spec b/xen.spec index bd31a16..ebd6f55 100644 --- a/xen.spec +++ b/xen.spec @@ -1,5 +1,5 @@ # -# spec file for package xen (Version 4.1.0_01) +# spec file for package xen # # Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -31,39 +31,39 @@ ExclusiveArch: %ix86 x86_64 %else %define with_xend 1 %endif -BuildRequires: LibVNCServer-devel -BuildRequires: SDL-devel -BuildRequires: automake -BuildRequires: bin86 -BuildRequires: curl-devel -BuildRequires: dev86 -BuildRequires: graphviz -BuildRequires: latex2html -BuildRequires: libjpeg-devel -BuildRequires: libxml2-devel -BuildRequires: ncurses-devel -BuildRequires: openssl -BuildRequires: openssl-devel -BuildRequires: pciutils-devel -BuildRequires: python-devel -BuildRequires: texinfo -BuildRequires: transfig -BuildRequires: libbz2-devel +BuildRequires: LibVNCServer-devel +BuildRequires: SDL-devel +BuildRequires: automake +BuildRequires: bin86 +BuildRequires: curl-devel +BuildRequires: dev86 +BuildRequires: graphviz +BuildRequires: latex2html +BuildRequires: libjpeg-devel +BuildRequires: libxml2-devel +BuildRequires: ncurses-devel +BuildRequires: openssl +BuildRequires: openssl-devel +BuildRequires: pciutils-devel +BuildRequires: python-devel +BuildRequires: texinfo +BuildRequires: transfig +BuildRequires: libbz2-devel %if %suse_version >= 1120 -BuildRequires: xz-devel +BuildRequires: xz-devel %endif %if %suse_version <= 1110 -BuildRequires: pmtools +BuildRequires: pmtools %else -BuildRequires: acpica +BuildRequires: acpica %endif %if %suse_version >= 1030 -BuildRequires: texlive -BuildRequires: texlive-latex +BuildRequires: texlive +BuildRequires: texlive-latex %else -BuildRequires: te_ams -BuildRequires: te_latex -BuildRequires: tetex +BuildRequires: te_ams +BuildRequires: te_latex +BuildRequires: tetex %endif %ifarch x86_64 BuildRequires: glibc-32bit glibc-devel-32bit @@ -80,7 +80,7 @@ BuildRequires: glibc-devel BuildRequires: kernel-source kernel-syms module-init-tools xorg-x11 %endif Version: 4.1.0_01 -Release: 1 +Release: 7 License: GPLv2+ Group: System/Kernel AutoReqProv: on @@ -172,7 +172,7 @@ Patch370: xend-sysconfig.patch Patch371: domu-usb-controller.patch Patch372: usb-list.patch Patch373: xend-devid-or-name.patch -Patch374: suspend_evtchn_lock.patch +Patch374: suspend_evtchn_lock.patch # Patches for snapshot support Patch400: snapshot-ioemu-save.patch Patch401: snapshot-ioemu-restore.patch @@ -228,34 +228,34 @@ Patch651: ioemu-disable-scsi.patch Patch652: ioemu-disable-emulated-ide-if-pv.patch Patch700: hv_extid_compatibility.patch # FATE 310510 -Patch10001: xenpaging.tools_xenpaging_cleanup.patch -Patch10002: xenpaging.pageout_policy.patch -Patch10003: xenpaging.get_paged_frame.patch -Patch10004: xenpaging.makefile.patch -Patch10010: xenpaging.policy_linear.patch -Patch10011: xenpaging.pagefile.patch -Patch10012: xenpaging.xenpaging_init.patch -Patch10013: xenpaging.mem_paging_tool_qemu_flush_cache.patch -Patch10014: xenpaging.machine_to_phys_mapping.patch -Patch10015: xenpaging.populate_only_if_paged.patch -Patch10017: xenpaging.autostart.patch -Patch10018: xenpaging.signal_handling.patch -Patch10019: xenpaging.MRU_SIZE.patch -Patch10020: xenpaging.guest_remove_page.patch -Patch10021: xenpaging.mem_event_check_ring-free_requests.patch -Patch10022: xenpaging.blacklist.patch -Patch10023: xenpaging.autostart_delay.patch -Patch10024: xenpaging.page_already_populated.patch -Patch10025: xenpaging.notify_policy_only_once.patch -Patch10026: xenpaging.num_pages_equal_max_pages.patch -Patch10027: xenpaging.p2m_mem_paging_populate_if_p2m_ram_paged.patch -Patch10028: xenpaging.HVMCOPY_gfn_paged_out.patch -Patch10029: xenpaging.optimize_p2m_mem_paging_populate.patch -Patch10030: xenpaging.paging_prep_enomem.patch -Patch10031: xenpaging.print-arguments.patch -Patch10032: xenpaging.no_domain_id.patch -Patch10033: xenpaging.runtime_mru_size.patch -Patch10040: xenpaging.doc.patch +Patch10001: xenpaging.tools_xenpaging_cleanup.patch +Patch10002: xenpaging.pageout_policy.patch +Patch10003: xenpaging.get_paged_frame.patch +Patch10004: xenpaging.makefile.patch +Patch10010: xenpaging.policy_linear.patch +Patch10011: xenpaging.pagefile.patch +Patch10012: xenpaging.xenpaging_init.patch +Patch10013: xenpaging.mem_paging_tool_qemu_flush_cache.patch +Patch10014: xenpaging.machine_to_phys_mapping.patch +Patch10015: xenpaging.populate_only_if_paged.patch +Patch10017: xenpaging.autostart.patch +Patch10018: xenpaging.signal_handling.patch +Patch10019: xenpaging.MRU_SIZE.patch +Patch10020: xenpaging.guest_remove_page.patch +Patch10021: xenpaging.mem_event_check_ring-free_requests.patch +Patch10022: xenpaging.blacklist.patch +Patch10023: xenpaging.autostart_delay.patch +Patch10024: xenpaging.page_already_populated.patch +Patch10025: xenpaging.notify_policy_only_once.patch +Patch10026: xenpaging.num_pages_equal_max_pages.patch +Patch10027: xenpaging.p2m_mem_paging_populate_if_p2m_ram_paged.patch +Patch10028: xenpaging.HVMCOPY_gfn_paged_out.patch +Patch10029: xenpaging.optimize_p2m_mem_paging_populate.patch +Patch10030: xenpaging.paging_prep_enomem.patch +Patch10031: xenpaging.print-arguments.patch +Patch10032: xenpaging.no_domain_id.patch +Patch10033: xenpaging.runtime_mru_size.patch +Patch10040: xenpaging.doc.patch # Build patch Patch99999: tmp_build.patch Url: http://www.cl.cam.ac.uk/Research/SRG/netos/xen/ @@ -718,7 +718,6 @@ tar xfj %{SOURCE2} -C $RPM_BUILD_DIR/%{xen_build_dir}/tools #%patch10040 -p1 %patch99999 -p1 - %build XEN_EXTRAVERSION=%version-%release XEN_EXTRAVERSION=${XEN_EXTRAVERSION#%{xvers}} From be3eccd8df57e080b6ef28e47e286cdb48b91bd8a59cc0c8c5d47468f970c75c Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Wed, 20 Apr 2011 16:02:16 +0000 Subject: [PATCH 2/2] - bnc#688519: correct indention in xend-domain-lock.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=112 --- xen.changes | 5 + xend-domain-lock.patch | 270 +++++++++++++++++++++-------------------- 2 files changed, 145 insertions(+), 130 deletions(-) diff --git a/xen.changes b/xen.changes index 7912883..1af670e 100644 --- a/xen.changes +++ b/xen.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Apr 20 17:50:04 CEST 2011 - ohering@suse.de + +- bnc#688519: correct indention in xend-domain-lock.patch + ------------------------------------------------------------------- Mon Apr 11 15:55:04 MDT 2011 - jfehlig@suse.de diff --git a/xend-domain-lock.patch b/xend-domain-lock.patch index 10b340c..7047c47 100644 --- a/xend-domain-lock.patch +++ b/xend-domain-lock.patch @@ -1,3 +1,13 @@ +--- + tools/examples/xend-config.sxp | 59 ++++++++++++++++++++++ + tools/hotplug/Linux/Makefile | 1 + tools/hotplug/Linux/domain-lock | 83 ++++++++++++++++++++++++++++++++ + tools/hotplug/Linux/vm-monitor | 41 +++++++++++++++ + tools/python/xen/xend/XendCheckpoint.py | 3 + + tools/python/xen/xend/XendDomainInfo.py | 74 ++++++++++++++++++++++++++++ + tools/python/xen/xend/XendOptions.py | 29 +++++++++++ + 7 files changed, 290 insertions(+) + Index: xen-4.1.0-testing/tools/examples/xend-config.sxp =================================================================== --- xen-4.1.0-testing.orig/tools/examples/xend-config.sxp @@ -68,74 +78,6 @@ Index: xen-4.1.0-testing/tools/examples/xend-config.sxp # If we have a very big scsi device configuration, start of xend is slow, # because xend scans all the device paths to build its internal PSCSI device # list. If we need only a few devices for assigning to a guest, we can reduce -Index: xen-4.1.0-testing/tools/python/xen/xend/XendOptions.py -=================================================================== ---- xen-4.1.0-testing.orig/tools/python/xen/xend/XendOptions.py -+++ xen-4.1.0-testing/tools/python/xen/xend/XendOptions.py -@@ -154,6 +154,17 @@ class XendOptions: - use loose check automatically if necessary.""" - pci_dev_assign_strict_check_default = True - -+ """Default for the flag indicating whether xend should create -+ a lock file for domains when they are started.""" -+ xend_domain_lock = 'no' -+ -+ """Default domain lock storage path.""" -+ xend_domain_lock_path_default = '/var/lib/xen/images/vm_locks' -+ -+ """Default script to acquire/release domain lock""" -+ xend_domain_lock_utility = auxbin.scripts_dir() + "/domain-lock" -+ -+ - def __init__(self): - self.configure() - -@@ -401,6 +412,24 @@ class XendOptions: - else: - return None - -+ def get_xend_domain_lock(self): -+ """Get the flag indicating whether xend should create a lock file -+ for domains when they are started.""" -+ return self.get_config_bool("xend-domain-lock", self.xend_domain_lock) -+ -+ def get_xend_domain_lock_path(self): -+ """ Get the path for domain lock storage -+ """ -+ return self.get_config_string("xend-domain-lock-path", self.xend_domain_lock_path_default) -+ -+ def get_xend_domain_lock_utility(self): -+ s = self.get_config_string('xend-domain-lock-utility') -+ -+ if s: -+ return os.path.join(auxbin.scripts_dir(), s) -+ else: -+ return self.xend_domain_lock_utility -+ - - def get_vnc_tls(self): - return self.get_config_string('vnc-tls', self.xend_vnc_tls) -Index: xen-4.1.0-testing/tools/python/xen/xend/XendCheckpoint.py -=================================================================== ---- xen-4.1.0-testing.orig/tools/python/xen/xend/XendCheckpoint.py -+++ xen-4.1.0-testing/tools/python/xen/xend/XendCheckpoint.py -@@ -133,6 +133,8 @@ def save(fd, dominfo, network, live, dst - dominfo.shutdown('suspend') - dominfo.waitForSuspend() - if line in ('suspend', 'suspended'): -+ if checkpoint == False: -+ dominfo.release_running_lock(domain_name) - dominfo.migrateDevices(network, dst, DEV_MIGRATE_STEP2, - domain_name) - log.info("Domain %d suspended.", dominfo.getDomid()) -@@ -410,6 +412,7 @@ def restore(xd, fd, dominfo = None, paus - if not paused: - dominfo.unpause() - -+ dominfo.acquire_running_lock() - return dominfo - except Exception, exn: - dominfo.destroy() Index: xen-4.1.0-testing/tools/hotplug/Linux/Makefile =================================================================== --- xen-4.1.0-testing.orig/tools/hotplug/Linux/Makefile @@ -282,6 +224,27 @@ Index: xen-4.1.0-testing/tools/hotplug/Linux/vm-monitor +elif [ $0 = "$basedir/vm-monitor" ]; then + monitor $* +fi +Index: xen-4.1.0-testing/tools/python/xen/xend/XendCheckpoint.py +=================================================================== +--- xen-4.1.0-testing.orig/tools/python/xen/xend/XendCheckpoint.py ++++ xen-4.1.0-testing/tools/python/xen/xend/XendCheckpoint.py +@@ -133,6 +133,8 @@ def save(fd, dominfo, network, live, dst + dominfo.shutdown('suspend') + dominfo.waitForSuspend() + if line in ('suspend', 'suspended'): ++ if checkpoint == False: ++ dominfo.release_running_lock(domain_name) + dominfo.migrateDevices(network, dst, DEV_MIGRATE_STEP2, + domain_name) + log.info("Domain %d suspended.", dominfo.getDomid()) +@@ -410,6 +412,7 @@ def restore(xd, fd, dominfo = None, paus + if not paused: + dominfo.unpause() + ++ dominfo.acquire_running_lock() + return dominfo + except Exception, exn: + dominfo.destroy() Index: xen-4.1.0-testing/tools/python/xen/xend/XendDomainInfo.py =================================================================== --- xen-4.1.0-testing.orig/tools/python/xen/xend/XendDomainInfo.py @@ -299,10 +262,10 @@ Index: xen-4.1.0-testing/tools/python/xen/xend/XendDomainInfo.py self._stateSet(DOM_STATE_HALTED) self.domid = None # Do not push into _stateSet()! + -+ try: -+ self.release_running_lock() -+ except: -+ log.exception("Failed to release domain lock.") ++ try: ++ self.release_running_lock() ++ except: ++ log.exception("Failed to release domain lock.") finally: self.refresh_shutdown_lock.release() @@ -310,74 +273,121 @@ Index: xen-4.1.0-testing/tools/python/xen/xend/XendDomainInfo.py def has_device(self, dev_class, dev_uuid): return (dev_uuid in self.info['%s_refs' % dev_class.lower()]) -+ # Return name of host contained in lock file. -+ def get_lock_host(self, path): -+ fin = os.popen(xoptions.get_xend_domain_lock_utility() + \ -+ ' -s ' + path, 'r') -+ hostname = "unknown" ++ # Return name of host contained in lock file. ++ def get_lock_host(self, path): ++ fin = os.popen(xoptions.get_xend_domain_lock_utility() + \ ++ ' -s ' + path, 'r') ++ hostname = "unknown" + -+ try: -+ tokens = fin.readline().split() -+ for token in tokens: -+ item = token.split('=') -+ if item[0] == 'host': -+ hostname = item[1] -+ return hostname -+ finally: -+ fin.close() ++ try: ++ tokens = fin.readline().split() ++ for token in tokens: ++ item = token.split('=') ++ if item[0] == 'host': ++ hostname = item[1] ++ return hostname ++ finally: ++ fin.close() + + # Acquire a lock for the domain. No-op if domain locking is turned off. -+ def acquire_running_lock(self): -+ if not xoptions.get_xend_domain_lock(): -+ return ++ def acquire_running_lock(self): ++ if not xoptions.get_xend_domain_lock(): ++ return + -+ log.debug("Acquiring lock for domain %s" % self.info['name_label']) -+ path = xoptions.get_xend_domain_lock_path() -+ path = os.path.join(path, self.get_uuid()) ++ log.debug("Acquiring lock for domain %s" % self.info['name_label']) ++ path = xoptions.get_xend_domain_lock_path() ++ path = os.path.join(path, self.get_uuid()) + -+ try: -+ if not os.path.exists(path): -+ mkdir.parents(path, stat.S_IRWXU) -+ except: -+ log.exception("%s could not be created." % path) -+ raise XendError("%s could not be created." % path) ++ try: ++ if not os.path.exists(path): ++ mkdir.parents(path, stat.S_IRWXU) ++ except: ++ log.exception("%s could not be created." % path) ++ raise XendError("%s could not be created." % path) + -+ status = os.system('%s -l -p %s -n %s -i %s %s' % \ -+ (xoptions.get_xend_domain_lock_utility(), \ -+ XendNode.instance().get_name(), \ -+ self.info['name_label'], \ -+ self.info['uuid'], \ -+ path)) -+ if status != 0: -+ log.debug("Failed to aqcuire lock: status = %d" % status) -+ raise XendError("The VM is locked and appears to be running on host %s." % self.get_lock_host(path)) ++ status = os.system('%s -l -p %s -n %s -i %s %s' % \ ++ (xoptions.get_xend_domain_lock_utility(), \ ++ XendNode.instance().get_name(), \ ++ self.info['name_label'], \ ++ self.info['uuid'], \ ++ path)) ++ if status != 0: ++ log.debug("Failed to aqcuire lock: status = %d" % status) ++ raise XendError("The VM is locked and appears to be running on host %s." % self.get_lock_host(path)) + -+ # Release lock for domain. No-op if domain locking is turned off. -+ def release_running_lock(self, name = None): -+ if not xoptions.get_xend_domain_lock(): -+ return ++ # Release lock for domain. No-op if domain locking is turned off. ++ def release_running_lock(self, name = None): ++ if not xoptions.get_xend_domain_lock(): ++ return + -+ dom_name = self.info['name_label'] -+ if name: -+ dom_name = name -+ log.debug("Releasing lock for domain %s" % dom_name) ++ dom_name = self.info['name_label'] ++ if name: ++ dom_name = name ++ log.debug("Releasing lock for domain %s" % dom_name) + -+ path = xoptions.get_xend_domain_lock_path() -+ path = os.path.join(path, self.get_uuid()) -+ status = os.system('%s -u -p %s -n %s -i %s %s' % \ -+ (xoptions.get_xend_domain_lock_utility(), \ -+ XendNode.instance().get_name(), \ -+ dom_name, \ -+ self.info['uuid'], \ -+ path)) -+ if status != 0: -+ log.exception("Failed to release lock: status = %s" % status) -+ try: -+ if len(os.listdir(path)) == 0: -+ shutil.rmtree(path) -+ except: -+ log.exception("Failed to remove unmanaged directory %s." % path) ++ path = xoptions.get_xend_domain_lock_path() ++ path = os.path.join(path, self.get_uuid()) ++ status = os.system('%s -u -p %s -n %s -i %s %s' % \ ++ (xoptions.get_xend_domain_lock_utility(), \ ++ XendNode.instance().get_name(), \ ++ dom_name, \ ++ self.info['uuid'], \ ++ path)) ++ if status != 0: ++ log.exception("Failed to release lock: status = %s" % status) ++ try: ++ if len(os.listdir(path)) == 0: ++ shutil.rmtree(path) ++ except: ++ log.exception("Failed to remove unmanaged directory %s." % path) + def __str__(self): return '' % \ (str(self.domid), self.info['name_label'], +Index: xen-4.1.0-testing/tools/python/xen/xend/XendOptions.py +=================================================================== +--- xen-4.1.0-testing.orig/tools/python/xen/xend/XendOptions.py ++++ xen-4.1.0-testing/tools/python/xen/xend/XendOptions.py +@@ -154,6 +154,17 @@ class XendOptions: + use loose check automatically if necessary.""" + pci_dev_assign_strict_check_default = True + ++ """Default for the flag indicating whether xend should create ++ a lock file for domains when they are started.""" ++ xend_domain_lock = 'no' ++ ++ """Default domain lock storage path.""" ++ xend_domain_lock_path_default = '/var/lib/xen/images/vm_locks' ++ ++ """Default script to acquire/release domain lock""" ++ xend_domain_lock_utility = auxbin.scripts_dir() + "/domain-lock" ++ ++ + def __init__(self): + self.configure() + +@@ -401,6 +412,24 @@ class XendOptions: + else: + return None + ++ def get_xend_domain_lock(self): ++ """Get the flag indicating whether xend should create a lock file ++ for domains when they are started.""" ++ return self.get_config_bool("xend-domain-lock", self.xend_domain_lock) ++ ++ def get_xend_domain_lock_path(self): ++ """ Get the path for domain lock storage ++ """ ++ return self.get_config_string("xend-domain-lock-path", self.xend_domain_lock_path_default) ++ ++ def get_xend_domain_lock_utility(self): ++ s = self.get_config_string('xend-domain-lock-utility') ++ ++ if s: ++ return os.path.join(auxbin.scripts_dir(), s) ++ else: ++ return self.xend_domain_lock_utility ++ + + def get_vnc_tls(self): + return self.get_config_string('vnc-tls', self.xend_vnc_tls)