Hello community,
here is the log from the commit of package vm-install
checked in at Thu Sep 25 13:21:59 CEST 2008.
--------
--- arch/i386/vm-install/vm-install.changes 2008-09-12 01:45:55.000000000 +0200
+++ /mounts/work_src_done/STABLE/vm-install/vm-install.changes 2008-09-25 05:57:12.809066000 +0200
@@ -1,0 +2,17 @@
+Thu Sep 16 16:34:43 MDT 2008 - carnold@novell.com
+
+- fate#302936 - Allow administrators to configure cpuid data via
+ vm-install's command line interface.
+
+-------------------------------------------------------------------
+Thu Sep 16 16:34:43 MDT 2008 - carnold@novell.com
+
+- bnc#259207 - vm-install does not write maxmem parameter into the
+ configuration file.
+
+-------------------------------------------------------------------
+Thu Sep 12 10:27:43 MDT 2008 - carnold@novell.com
+
+- bnc#425653 - vm-install resets the os type.
+
+-------------------------------------------------------------------
Old:
----
vm-install-0.3.8.tar.bz2
New:
----
vm-install-0.3.9.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ vm-install.spec ++++++
--- /var/tmp/diff_new_pack.vn3354/_old 2008-09-25 13:21:38.000000000 +0200
+++ /var/tmp/diff_new_pack.vn3354/_new 2008-09-25 13:21:38.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package vm-install (Version 0.3.8)
+# spec file for package vm-install (Version 0.3.9)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -26,10 +26,10 @@
License: GPL v2 or later
Group: System/Emulators/PC
AutoReqProv: yes
-Version: 0.3.8
+Version: 0.3.9
Release: 1
Summary: Tool to Define a Virtual Machine and Install Its Operating System
-Source0: %{name}-0.3.8.tar.bz2
+Source0: %{name}-0.3.9.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires: xen-tools python-urlgrabber libxml2-python libvirt-python
%define pysite %(python -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib()")
@@ -85,6 +85,13 @@
%{_datadir}/applications/YaST2/vm-install.desktop
%changelog
+* Tue Sep 16 2008 carnold@novell.com
+- fate#302936 - Allow administrators to configure cpuid data via
+ vm-install's command line interface.
+- bnc#259207 - vm-install does not write maxmem parameter into the
+ configuration file.
+* Fri Sep 12 2008 carnold@novell.com
+- bnc#425653 - vm-install resets the os type.
* Thu Sep 11 2008 carnold@novell.com
- Add virt-viewer as an option to the --graphics-viewer flag.
- Added check to get os type so we can default to the correct one.
++++++ vm-install-0.3.8.tar.bz2 -> vm-install-0.3.9.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/vm-install-0.3.8/bin/vm-install new/vm-install-0.3.9/bin/vm-install
--- old/vm-install-0.3.8/bin/vm-install 2008-09-12 00:25:33.000000000 +0200
+++ new/vm-install-0.3.9/bin/vm-install 2008-09-25 01:42:31.000000000 +0200
@@ -23,6 +23,7 @@
import vminstall.VMDefaults
import vminstall.xml
import vminstall.nics
+import vminstall.cpuid
import vminstall.options
import vminstall.job
from vminstall.exceptions import *
@@ -54,6 +55,22 @@
else:
parser.values.nics = [nic]
+def setCPUID(option, opt_str, value, parser):
+ cpuid = vminstall.cpuid.parse_string(value)
+ for c in cpuid:
+ if parser.values.cpuid:
+ parser.values.cpuid.extend([c])
+ else:
+ parser.values.cpuid = [c]
+
+def setCPUCHECK(option, opt_str, value, parser):
+ cpu_check = vminstall.cpuid.parse_string(value)
+ for c in cpuid:
+ if parser.values.cpu_check:
+ parser.values.cpu_check.extend([c])
+ else:
+ parser.values.cpu_check = [c]
+
def populate_options(options):
parser = optparse.OptionParser(description="""Defines a Xen virtual machine and installs its operating system. Consult the man page for complete usage and examples.""")
@@ -69,6 +86,12 @@
parser.add_option('-c', '--vcpus', type='int', dest='vcpus',
help="number of virtual CPUs")
+ parser.add_option('', '--cpuid', type='string', action='callback', callback=setCPUID,
+ help="present the fully virtualized VM with cpuid information for " \
+ "processor compatibility: CPUID:[REG=],[REG=],...")
+ parser.add_option('', '--cpu-check', type='string', action='callback', callback=setCPUCHECK,
+ help="set cpuid consistency checks before allowing the host to run a fully " \
+ "virtualized VM: CPUID:[REG=],[REG=],...")
parser.add_option('-d', '--disk', type='string', action='callback', callback=setDisk,
help="defines a virtual disk: PDEV,VDEV[,TYPE[,MODE[,MB]]]")
parser.add_option('-g', '--graphics', type='string',
@@ -107,7 +130,7 @@
parser.add_option('-s', '--source', type='string', dest='source',
help="URL of installation source for paravirtualized VM")
parser.add_option('-p', '--pxe-boot', action="store_true", dest="pxe_boot",
- help="Specify PXE booting for the fully virtualized VM")
+ help="Specify PXE booting for the VM")
parser.add_option('', '--background', action='store_true', dest='background',
help="run as background job; do not prompt")
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/vm-install-0.3.8/glade/vm-install.glade new/vm-install-0.3.9/glade/vm-install.glade
--- old/vm-install-0.3.8/glade/vm-install.glade 2008-09-12 00:25:33.000000000 +0200
+++ new/vm-install-0.3.9/glade/vm-install.glade 2008-09-25 01:42:31.000000000 +0200
@@ -2384,6 +2384,7 @@
<property name="snap_to_ticks">False</property>
<property name="wrap">False</property>
<property name="adjustment">256 4 32768 16 64 64</property>
+ <signal name="value_changed" handler="on_memory_startup_value_changed" last_modification_time="Tue, 16 Sep 2008 20:57:20 GMT"/>
</widget>
</child>
</widget>
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/vm-install-0.3.8/Makefile new/vm-install-0.3.9/Makefile
--- old/vm-install-0.3.8/Makefile 2008-09-12 00:26:27.000000000 +0200
+++ new/vm-install-0.3.9/Makefile 2008-09-25 01:42:31.000000000 +0200
@@ -1,5 +1,5 @@
PACKAGE = vm-install
-VER = 0.3.8
+VER = 0.3.9
default:
@echo "Run 'make install DESTDIR=$destdir' to install."
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/vm-install-0.3.8/man/vm-install.8 new/vm-install-0.3.9/man/vm-install.8
--- old/vm-install-0.3.8/man/vm-install.8 2008-09-12 00:25:33.000000000 +0200
+++ new/vm-install-0.3.9/man/vm-install.8 2008-09-25 01:42:31.000000000 +0200
@@ -41,6 +41,35 @@
.B -c\fR \fIN\fP\fR, \fB--vcpus\fR \fIN\fP
Number of virtual CPUs to allocate to the VM.
.TP
+.B --cpuid\fR \fICPUID\fP
+Present the fully virtualized VM with cpuid information for processor compatibility: \fICPUID\fR is in
+the form of FUNCTION:REG=[,[REG=],[FUNCTION:[REG=],...]].
+
+\fIFUNCTION\fR contains the eax register value as defined by the cpuid processor instruction and
+represents the function needed to define a set of processor features.
+
+\fIREG\fR is a register whose value represents the set of processors feature to enable or disable.
+Valid \fIREG\fR values are (\fBeax\fR, \fBecx\fR, \fBebx\fR, and \fBhedx\fR).
+
+For example, --cpuid 1:ecx=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx. Valid values are x, 0, 1, k, s
+
+See also /etc/xen/examples/xmexample.hvm.
+.TP
+.B --cpu-check\fR \fICPUCHECK\fP
+Defines the hosts cpuid consistency checks that must be satisfied for this fully virtualized
+VM to be allowed to run on the hosts processor type: \fICPUCHECK\fR is in the form of
+FUNCTION:REG=[,[REG=],[FUNCTION:[REG=],...]].
+
+\fIFUNCTION\fR contains the eax register value as defined by the cpuid processor instruction and
+represents the function needed to define a set of processor features.
+
+\fIREG\fR is a register whose value represents the set of processors feature to enable or disable.
+Valid \fIREG\fR values are (\fBeax\fR, \fBecx\fR, \fBebx\fR, and \fBhedx\fR).
+
+For example, --cpu-check 1:ecx=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx. Valid values are x, 0, 1, s
+
+See also /etc/xen/examples/xmexample.hvm.
+.TP
.B -d\fR \fIDISK\fR, \fB--disk\fR \fIDISK\fP
Defines an additional virtual disk. Repeat for multiple disks. \fIDISK\fR is
of the form \fIPDEV\fR,\fIVDEV\fR[,\fITYPE\fR[,\fIMODE\fR[,\fIMB\fR[,\fIOPTIONS\fR...]]].
@@ -82,6 +111,9 @@
Defines how the graphics (if any) are viewed. May be \fBsdl\fR or \fBvnc\fR.
Defaults to vnc.
.TP
+.B --keymap\fR \fIKEYMAP\fR
+Specify the keyboard translation map file. See /usr/share/xen/qemu/keymaps.
+.TP
.B -m\fR \fIN\fR, \fB--memory\fR \fIN\fR
Initial megabytes of RAM to allocate to the VM.
.TP
@@ -156,6 +188,9 @@
be named with ".nlf" extensions.
.RE
+.B -p\fR, \fB--pxe-boot\fR
+Specify PXE booting for the VM installation.
+.TP
.B -x\fR \fITEXT\fR, \fB--extra-args\fR \fITEXT\fR
Additional arguments to pass to the paravirtualized OS. Note that the tool
will automatically generate the necessary OS-specific arguments to bootstrap
@@ -190,9 +225,15 @@
(waiting for the installation to finish) until the VM is caused to shutdown by
some other means.
.TP
+.B --no-install
+Generate a configuration file but do not perform the install.
+.TP
.B --no-restart
Don't automatically restart the VM after the first portion of the installation
finishes.
+.TP
+.B --preserve-on-error
+Should an error occur, do not delete temporary, configuration and image files.
.SH EXAMPLES
As a trivial way to get started, run \fBvm-install\fR with no arguments:
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/vm-install-0.3.8/po/xen-vm-install.pot new/vm-install-0.3.9/po/xen-vm-install.pot
--- old/vm-install-0.3.8/po/xen-vm-install.pot 2008-09-12 01:35:42.000000000 +0200
+++ new/vm-install-0.3.9/po/xen-vm-install.pot 2008-09-25 01:42:31.000000000 +0200
@@ -8,7 +8,7 @@
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-09-11 17:35-0600\n"
+"POT-Creation-Date: 2008-09-12 07:02-0600\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/vm-install-0.3.8/setup.py new/vm-install-0.3.9/setup.py
--- old/vm-install-0.3.8/setup.py 2008-09-12 00:26:38.000000000 +0200
+++ new/vm-install-0.3.9/setup.py 2008-09-25 01:42:31.000000000 +0200
@@ -1,7 +1,7 @@
from distutils.core import setup
setup(name='vminstall',
- version='0.3.8',
+ version='0.3.9',
description='Define a virtual machine and install its operating system',
author='Charles Coffing',
author_email='ccoffing@novell.com',
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/vm-install-0.3.8/src/vminstall/cpuid.py new/vm-install-0.3.9/src/vminstall/cpuid.py
--- old/vm-install-0.3.8/src/vminstall/cpuid.py 1970-01-01 01:00:00.000000000 +0100
+++ new/vm-install-0.3.9/src/vminstall/cpuid.py 2008-09-25 01:42:31.000000000 +0200
@@ -0,0 +1,155 @@
+# CPUID class
+#
+# Copyright 2006-2008 Novell, Inc.
+# Author: Charles Arnold
+#
+# This software may be freely redistributed under the terms of the GNU
+# general public license.
+#
+# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+import os
+import re
+import string
+import types
+
+import caps
+from exceptions import *
+import msg
+
+
+def get_platform_cpuid():
+ flags = caps.cpu_flags()
+ # FIXME: Parse flags for cpuid information
+ return None
+
+def is_hex(value):
+ try:
+ if isinstance(value, types.StringTypes):
+ return int(value, 16)
+ else:
+ return value
+ except ValueError:
+ return None
+
+def validate_reg(reg):
+ # Valid syntax is either Hex or a string representing all bits
+ # Examples: 0x06b1, reg=xxxxxxxxxx0000xx00xxx0000000xx0
+ if reg.startswith('0x'):
+ value = reg.split("0x",1)
+ if is_hex(value[1]) is None:
+ raise ParamError(err=ParamError.E_INVALID, details=reg)
+ else:
+ # Must be 32 characters long, can only consist of '1, 0, x, k, s'
+ if len(reg) != 32:
+ raise ParamError(err=ParamError.E_INVALID, details=reg)
+ valid_chars = 'x,0,1,k,s'
+ for c in reg:
+ if c not in valid_chars:
+ raise ParamError(err=ParamError.E_INVALID, details=reg)
+
+
+def parse_string(cpuid_data):
+ cpuids = []
+ if cpuid_data == "":
+ return cpuids.append(XenCPUID())
+
+ functions = []
+ function=None
+ eax = None
+ ebx = None
+ ecx = None
+ edx = None
+
+ params = cpuid_data.split(',')
+ for p in params:
+ funcs = p.split(':')
+ for f in funcs:
+ if f.startswith('eax='):
+ eax = f[4:]
+ validate_reg(eax)
+ elif f.startswith('ebx='):
+ ebx = f[4:]
+ validate_reg(ebx)
+ elif f.startswith('ecx='):
+ ecx = f[4:]
+ validate_reg(ecx)
+ elif f.startswith('edx='):
+ edx = f[4:]
+ validate_reg(edx)
+ else:
+ if f.startswith("0x"):
+ value = f.split("0x",1)[1]
+ else:
+ value = f
+ if is_hex(value) is not None:
+ if function:
+ if eax == None and ebx == None and ecx == None and edx == None:
+ function = function + ',' + f
+ continue
+ if function in functions:
+ raise ParamError(err=ParamError.E_INVALID, details=function)
+ cpuid = XenCPUID(function, eax, ebx, ecx, edx)
+ cpuids.append(cpuid)
+ functions.append(function)
+ eax = ebx = ecx = edx = None
+ function = f
+ continue
+ else:
+ raise ParamError(err=ParamError.E_INVALID, details=p)
+ if function:
+ if eax == None and ebx == None and ecx == None and edx == None:
+ raise ParamError(err=ParamError.E_INVALID, details=function)
+ if function in functions:
+ raise ParamError(err=ParamError.E_INVALID, details=function)
+ cpuid = XenCPUID(function, eax, ebx, ecx, edx)
+ cpuids.append(cpuid)
+ return cpuids
+
+class XenCPUID(object):
+
+ def __init__(self, function=None, eax=None, ebx=None, ecx=None, edx=None):
+ self.function = function
+ self.eax = eax
+ self.ebx = ebx
+ self.ecx = ecx
+ self.edx = edx
+
+ def get_formatted(self):
+ if self.function:
+ padding = ' '
+ flen = len(self.function)
+ pad = padding[flen:]
+
+ value = "\'%s:" % self.function
+ if self.eax:
+ value += "eax=%s" % self.eax
+ if self.ebx:
+ if self.eax:
+ if not self.ebx.startswith("0x"):
+ value += ",\n" + pad
+ else:
+ value += ","
+ value += "ebx=%s" % self.ebx
+ if self.ecx:
+ if self.eax or self.ebx:
+ if not self.ecx.startswith("0x"):
+ value += ",\n" + pad
+ else:
+ value += ","
+ value += "ecx=%s" % self.ecx
+ if self.edx:
+ if self.eax or self.ebx or self.ecx:
+ if not self.edx.startswith("0x"):
+ value += ",\n" + pad
+ else:
+ value += ","
+ value += "edx=%s" % self.edx
+ value += "\'"
+ return value
+
+ def get_function(self):
+ return self.function
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/vm-install-0.3.8/src/vminstall/FullVirtGuest.py new/vm-install-0.3.9/src/vminstall/FullVirtGuest.py
--- old/vm-install-0.3.8/src/vminstall/FullVirtGuest.py 2008-09-12 00:25:33.000000000 +0200
+++ new/vm-install-0.3.9/src/vminstall/FullVirtGuest.py 2008-09-25 01:42:31.000000000 +0200
@@ -108,14 +108,16 @@
boot="%(bootdev)s"
%(disks)s
%(networks)s
+%(cpuid)s
+%(cpucheck)s
%(graphics)s
%(features)s
%(mouse)s
serial="pty"
""" % { 'common': self.getCommonXen(), 'disks': self._get_disk_xen(),
'hvmext': 'hvm-ext' in self.os().virt_support(),
- 'networks': self._get_network_xen(), 'qemu': self._qemu,
- 'graphics': self._get_graphics_xen(), 'features': self._get_features_xen(),
+ 'networks': self._get_network_xen(), 'cpuid': self._get_cpuid_xen(), 'cpucheck': self._get_cpu_check_xen(),
+ 'qemu': self._qemu, 'graphics': self._get_graphics_xen(), 'features': self._get_features_xen(),
'bootdev': bootdev, 'loader': self.options.loader, 'mouse': self._get_mouse_xen()}
def PostInstallCheck(self):
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/vm-install-0.3.8/src/vminstall/gtk/interface.py new/vm-install-0.3.9/src/vminstall/gtk/interface.py
--- old/vm-install-0.3.8/src/vminstall/gtk/interface.py 2008-09-12 00:25:32.000000000 +0200
+++ new/vm-install-0.3.9/src/vminstall/gtk/interface.py 2008-09-25 05:41:56.000000000 +0200
@@ -160,6 +160,7 @@
'on_button_delete_nic_clicked': self.do_delete_nic,
'on_fv_install_source_focus_in': self.activate_fv_pxe_src,
'on_pv_install_source_focus_in': self.activate_pv_network_src,
+ 'on_memory_startup_value_changed': self.set_max_memory,
'on_create_memory_max_value_changed': self.set_max_memory,
'on_fv_media_toggled': self.change_fv_media_type,
'on_pv_media_toggled': self.change_pv_media_type,
@@ -562,6 +563,9 @@
avail_mb = self.xen_info['max_hvm_memory']
else:
avail_mb = self.xen_info['max_para_memory']
+ maximum = self.window.get_widget("memory-max").get_adjustment()
+ if self.defaults.max_memoryMB > maximum.upper:
+ self.defaults.max_memoryMB = maximum.upper
self.window.get_widget("host-memory-free").set_text('%d MB' % avail_mb)
self.window.get_widget("memory-max").set_value(self.defaults.max_memoryMB)
self.window.get_widget("memory-startup").set_value(self.defaults.memoryMB)
@@ -1106,6 +1110,7 @@
startup.value = maximum.value
if startup.value > avail_mb:
startup.value = avail_mb
+ #maximum.upper = vminstall.options.calculate_max_memory(self.options, startup.value, None)
startup.upper = min(maximum.value, avail_mb)
def save_page(self, page_num):
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/vm-install-0.3.8/src/vminstall/options.py new/vm-install-0.3.9/src/vminstall/options.py
--- old/vm-install-0.3.8/src/vminstall/options.py 2008-09-12 00:25:33.000000000 +0200
+++ new/vm-install-0.3.9/src/vminstall/options.py 2008-09-25 05:42:28.000000000 +0200
@@ -23,6 +23,7 @@
import vmdisks
import xend
import keytable
+import cpuid
on_exit = ["destroy", "restart", "preserve", "rename-restart", "coredump-destroy", "coredump-restart"]
@@ -61,6 +62,8 @@
'usb_mouse_abs',
'uuid',
'vcpus',
+ 'cpuid',
+ 'cpu_check',
'vnc_password',
'vncport',
'pxe_boot',
@@ -205,6 +208,12 @@
elif item == 'vcpus':
check_type(value, (int, float))
value = int(value)
+ elif item == 'cpuid':
+ check_type(value, (list,))
+ cpuid = value
+ elif item == 'cpu_check':
+ check_type(value, (list,))
+ cpu_check = value
if item == 'pxe_boot':
check_type(value, (int, bool))
value = bool(value)
@@ -259,6 +268,36 @@
value = getattr(src, key)
dst.__dict__[key] = value
+def calculate_max_memory(options, startup_mem, maximum_mem):
+ # If too much max memory is given to a PV guest with under about 1 Gig,
+ # the guest will hang or crash.
+ max_allowed = maximum_mem
+ if options.full_virt:
+ try:
+ xen_info = xend.connection.info()
+ max_allowed = xen_info['max_hvm_memory']
+ dom0mem = xend.connection.get_dom0_min_memory()
+ if dom0mem > max_allowed:
+ max_allowed = startup_mem
+ else:
+ max_allowed = max_allowed - dom0mem
+ except:
+ max_allowed = VMDefaults[options.os_type].max_memory()
+ elif not options.full_virt and startup_mem < 1024:
+ if startup_mem <= 256:
+ mm = 4096
+ elif startup_mem <= 384:
+ mm = startup_mem / 0.0625
+ elif startup_mem <= 512:
+ mm = startup_mem / 0.048
+ else:
+ mm = startup_mem / 0.04
+ if maximum_mem is None or maximum_mem > mm:
+ max_allowed = mm
+ else:
+ max_allowed = VMDefaults[options.os_type].max_memory()
+ return max_allowed
+
def calculate(options, defaults):
"""Re-calculates 'defaults' based on 'options'. Error if 'options' is
not self-consistent."""
@@ -326,12 +365,25 @@
defaults.memoryMB = vmdefaults.min_memory()
if defaults.max_memoryMB < defaults.memoryMB:
defaults.max_memoryMB = defaults.memoryMB
+ #max_memory = calculate_max_memory(options, defaults.memoryMB, defaults.max_memoryMB)
+ #if defaults.max_memoryMB > max_memory:
+ # defaults.max_memoryMB = max_memory
if options.vcpus:
defaults.vcpus = options.vcpus
else:
defaults.vcpus = vmdefaults.num_vcpus()
+ if not options.cpuid:
+ defaults.cpuid = []
+ else:
+ defaults.cpuid = options.cpuid
+
+ if not options.cpu_check:
+ defaults.cpu_check = []
+ else:
+ defaults.cpu_check = options.cpu_check
+
if options.loader:
defaults.loader = options.loader
else:
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/vm-install-0.3.8/src/vminstall/ParaVirtGuest.py new/vm-install-0.3.9/src/vminstall/ParaVirtGuest.py
--- old/vm-install-0.3.8/src/vminstall/ParaVirtGuest.py 2008-09-12 00:25:33.000000000 +0200
+++ new/vm-install-0.3.9/src/vminstall/ParaVirtGuest.py 2008-09-25 01:42:31.000000000 +0200
@@ -271,11 +271,14 @@
self.runtime['initrd'] = initrd
def _cleanup_kernel(self):
- if self.kernel:
- try:
- os.unlink(self.kernel)
- finally:
- self.kernel = ''
+ if self.options.preserve_on_error:
+ log.info("Installation failed, not cleaning up disks because preserve_on_error is set")
+ else:
+ if self.kernel:
+ try:
+ os.unlink(self.kernel)
+ finally:
+ self.kernel = ''
if self.initrd:
try:
os.unlink(self.initrd)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/vm-install-0.3.8/src/vminstall/xend.py new/vm-install-0.3.9/src/vminstall/xend.py
--- old/vm-install-0.3.8/src/vminstall/xend.py 2008-09-12 00:25:33.000000000 +0200
+++ new/vm-install-0.3.9/src/vminstall/xend.py 2008-09-25 01:42:31.000000000 +0200
@@ -12,6 +12,7 @@
import time
import libvirt
+from xen.xend import XendOptions
from vminstall.VMDefaults import use_libvirt
try:
@@ -150,4 +151,11 @@
return True
return False
+ def get_dom0_min_memory(self):
+ if use_libvirt is False:
+ return XendOptions.instance().get_dom0_min_mem()
+ else:
+ # FIXME
+ return 0
+
connection = Xend()
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/vm-install-0.3.8/src/vminstall/XenGuest.py new/vm-install-0.3.9/src/vminstall/XenGuest.py
--- old/vm-install-0.3.8/src/vminstall/XenGuest.py 2008-09-12 00:25:33.000000000 +0200
+++ new/vm-install-0.3.9/src/vminstall/XenGuest.py 2008-09-25 05:39:24.000000000 +0200
@@ -47,8 +47,10 @@
'<maxmemory>%d</maxmemory>' % (self.options.max_memoryMB*1024,)]
def _get_memory_xen(self):
# config file wants MB
- # FIXME: xen's "maxmem" setting is broken -- debug xen before setting
return 'memory=%d\n' % self.options.memoryMB
+ def _get_max_memory_xen(self):
+ # config file wants MB
+ return 'maxmem=%d\n' % self.options.max_memoryMB
def _get_uuid_xml(self):
return ['<uuid>%s</uuid>' % self.options.uuid]
@@ -89,6 +91,7 @@
s += self._get_name_xen()
s += self._get_uuid_xen()
s += self._get_memory_xen()
+ #s += self._get_max_memory_xen()
s += self._get_vcpus_xen()
s += self._get_action_xen()
s += self._get_localtime_xen()
@@ -164,6 +167,52 @@
ret += ']'
return ret
+ def _get_cpuid_xen(self):
+ """Get the cpuid config in the xend python format"""
+ cpuid_len = len(self.options.cpuid)
+ if cpuid_len == 0:
+ return ""
+ firsttime = 1
+ padding = ' '
+ ret = 'cpuid = [ '
+ for cpuid in self.options.cpuid:
+ if not firsttime:
+ flen = len(cpuid.get_function()) + 1
+ if flen > 11:
+ flen = 11
+ pad = padding[flen:]
+ if cpuid_len > 0:
+ ret += ",\n" + pad
+ else:
+ firsttime = 0
+ ret += cpuid.get_formatted()
+ cpuid_len -= 1
+ ret += "]"
+ return ret
+
+ def _get_cpu_check_xen(self):
+ """Get the cpu_check config in the xend python format"""
+ cpu_check_len = len(self.options.cpu_check)
+ if cpu_check_len == 0:
+ return ""
+ firsttime = 1
+ padding = ' '
+ ret = 'cpu_check = [ '
+ for cpu_check in self.options.cpu_check:
+ if not firsttime:
+ flen = len(cpu_check.get_function()) + 1
+ if flen > 11:
+ flen = 11
+ pad = padding[flen:]
+ if cpu_check_len > 0:
+ ret += ",\n" + pad
+ else:
+ firsttime = 0
+ ret += cpu_check.get_formatted()
+ cpu_check_len -= 1
+ ret += "]"
+ return ret
+
def _get_keymap(self):
keymap = None
if self.options.keymap != None:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org