Hello community,
here is the log from the commit of package vm-install for openSUSE:Factory checked in at 2014-01-07 13:59:49
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/vm-install (Old)
and /work/SRC/openSUSE:Factory/.vm-install.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "vm-install"
Changes:
--------
--- /work/SRC/openSUSE:Factory/vm-install/vm-install.changes 2013-11-04 08:50:59.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.vm-install.new/vm-install.changes 2014-01-07 13:59:50.000000000 +0100
@@ -1,0 +2,14 @@
+Thu Jan 02 16:55:13 MDT 2014 - carnold@suse.com
+
+- Add support for sles12 and sled12
+- Add support in the upgrade feature to use the virsh XML format in
+ addition to the legacy xend sxp format
+- Version 0.8.0
+
+-------------------------------------------------------------------
+Thu Jan 02 16:55:13 MDT 2014 - carnold@suse.com
+
+- Add debug switch to allow starting VM's with 'xl'
+- Version 0.7.9
+
+-------------------------------------------------------------------
Old:
----
vm-install-0.7.8.tar.bz2
New:
----
vm-install-0.8.0.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ vm-install.spec ++++++
--- /var/tmp/diff_new_pack.nI0AJo/_old 2014-01-07 13:59:51.000000000 +0100
+++ /var/tmp/diff_new_pack.nI0AJo/_new 2014-01-07 13:59:51.000000000 +0100
@@ -1,7 +1,7 @@
#
# spec file for package vm-install
#
-# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -22,12 +22,12 @@
BuildRequires: update-desktop-files
# For directory ownership:
BuildRequires: yast2
-Version: 0.7.8
+Version: 0.8.0
Release: 0
Summary: Tool to Define a Virtual Machine and Install Its Operating System
License: GPL-2.0
Group: System/Emulators/PC
-Source0: %{name}-0.7.8.tar.bz2
+Source0: %{name}-0.8.0.tar.bz2
Source1: vm-install.conf
BuildRoot: %{_tmppath}/%{name}-%{version}-build
ExclusiveArch: %ix86 x86_64 s390x
++++++ vm-install-0.7.8.tar.bz2 -> vm-install-0.8.0.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vm-install-0.7.8/Makefile new/vm-install-0.8.0/Makefile
--- old/vm-install-0.7.8/Makefile 2013-10-16 18:43:56.000000000 +0200
+++ new/vm-install-0.8.0/Makefile 2014-01-06 22:48:24.000000000 +0100
@@ -1,5 +1,5 @@
PACKAGE = vm-install
-VER = 0.7.8
+VER = 0.8.0
default:
@echo "Run 'make install DESTDIR=$destdir' to install."
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vm-install-0.7.8/bin/vm-install new/vm-install-0.8.0/bin/vm-install
--- old/vm-install-0.7.8/bin/vm-install 2013-10-16 18:43:54.000000000 +0200
+++ new/vm-install-0.8.0/bin/vm-install 2014-01-03 14:59:13.000000000 +0100
@@ -202,6 +202,8 @@
help="print debugging information")
parser.add_option('', '--preserve-on-error', action='store_true', dest='preserve_on_error',
help="On error, do not delete temporary, configuration and image files")
+ parser.add_option('', '--use-xl', action='store_true', dest='use_xl',
+ help="Use the xl command to start the VM; this is for debugging only")
# Manually copy option keys/values into optparse's values, rather
# than relying on optparse.parser.add_option, so my options class
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vm-install-0.7.8/setup.py new/vm-install-0.8.0/setup.py
--- old/vm-install-0.7.8/setup.py 2013-10-16 18:43:56.000000000 +0200
+++ new/vm-install-0.8.0/setup.py 2014-01-06 22:48:16.000000000 +0100
@@ -1,7 +1,7 @@
from distutils.core import setup
setup(name='vminstall',
- version='0.7.8',
+ version='0.8.0',
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.7.8/src/vmdisks/disks.py new/vm-install-0.8.0/src/vmdisks/disks.py
--- old/vm-install-0.7.8/src/vmdisks/disks.py 2013-10-16 18:43:53.000000000 +0200
+++ new/vm-install-0.8.0/src/vmdisks/disks.py 2013-12-06 18:42:08.000000000 +0100
@@ -87,6 +87,14 @@
os.chmod(filename, 0600)
else:
os.chmod(filename, 0644)
+
+ log.debug("Setting nocow flag")
+ cmd = '/usr/bin/chattr +C %s' % filename
+ log.debug("Running: %s" % cmd)
+ ret = os.system(cmd)
+ if ret:
+ log.debug("Setting nocow flag to %s failed" % filename)
+
if sparse:
offset = bytes - 1
os.lseek(fd, offset, 0)
@@ -109,6 +117,20 @@
log.debug("Creating qcow file '%s', %d bytes." % (filename, bytes))
mb = str(bytes / 1024 / 1024) + 'M'
fmt = '-f' + type
+ fd = os.open(filename, os.O_WRONLY | os.O_CREAT | os.O_TRUNC | os.O_LARGEFILE | os.O_DIRECT);
+ if os.geteuid() == 0:
+ os.chmod(filename, 0600)
+ else:
+ os.chmod(filename, 0644)
+
+ log.debug("Setting nocow flag")
+ cmd = '/usr/bin/chattr +C %s' % filename
+ log.debug("Running: %s" % cmd)
+ ret = os.system(cmd)
+ if ret:
+ log.debug("Setting nocow flag to %s failed" % filename)
+ os.close(fd)
+
if os.path.exists('/usr/bin/qemu-img'):
vminstall.util.run(['/usr/bin/qemu-img', 'create', fmt, filename, mb])
elif os.path.exists('/usr/bin/qemu-img-xen'):
@@ -120,6 +142,20 @@
if not os.path.exists('/usr/sbin/vhd-util'):
raise DiskResourceError(DiskResourceError.E_CREATE_FAILED, details='vhd-util not found')
try:
+ fd = os.open(filename, os.O_WRONLY | os.O_CREAT | os.O_TRUNC | os.O_LARGEFILE | os.O_DIRECT);
+ if os.geteuid() == 0:
+ os.chmod(filename, 0600)
+ else:
+ os.chmod(filename, 0644)
+
+ log.debug("Setting nocow flag")
+ cmd = '/usr/bin/chattr +C %s' % filename
+ log.debug("Running: %s" % cmd)
+ ret = os.system(cmd)
+ if ret:
+ log.debug("Setting nocow flag to %s failed" % filename)
+ os.close(fd)
+
vminstall.util.run(['/usr/sbin/vhd-util', "create", "-n", filename, mb])
except:
raise DiskResourceError(DiskResourceError.E_CREATE_FAILED, details="Create %s failed" % filename)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vm-install-0.7.8/src/vminstall/ParaVirtGuest.py new/vm-install-0.8.0/src/vminstall/ParaVirtGuest.py
--- old/vm-install-0.7.8/src/vminstall/ParaVirtGuest.py 2013-10-16 18:43:54.000000000 +0200
+++ new/vm-install-0.8.0/src/vminstall/ParaVirtGuest.py 2014-01-03 17:11:05.000000000 +0100
@@ -237,7 +237,7 @@
else:
vpart = traildigits(partition['name'])
log.info("Found kernel on partition %s." % vpart)
- boot_kernel_check = ['sles11','sled11','opensuse11','opensuse12','opensuse13']
+ boot_kernel_check = ['sles12', 'sled12', 'sles11','sled11','opensuse11','opensuse12','opensuse13']
if self.options.os_type in boot_kernel_check:
path = os.path.dirname(_kernel)
checkAndSetDefaultBootKernel(mountpoint + path)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vm-install-0.7.8/src/vminstall/VMDefaults.py new/vm-install-0.8.0/src/vminstall/VMDefaults.py
--- old/vm-install-0.7.8/src/vminstall/VMDefaults.py 2013-10-21 23:31:57.000000000 +0200
+++ new/vm-install-0.8.0/src/vminstall/VMDefaults.py 2014-01-03 17:09:36.000000000 +0100
@@ -364,6 +364,42 @@
def direct_kernel_boot(self):
return True
+class SLED12Defaults(SUSEDefaults):
+ def name(self):
+ return msg.sled12
+ def min_memory(self):
+ return 256
+ def default_memory(self):
+ return 512
+ def _disk_size(self):
+ return 16
+ def supports_32nonpae(self):
+ return False
+ def apic(self):
+ # Turned on even for uni-processor
+ return True
+ def is_upgradeable(self):
+ return True
+ def virtio(self):
+ if caps.is_kvm() or caps.is_qemu():
+ return True
+ else:
+ return False
+ def nics(self):
+ if caps.is_kvm() or caps.is_qemu():
+ return [ KvmNic(model='virtio') ]
+ else:
+ return [ XenNic(model='para') ]
+ def sound(self):
+ if caps.is_xen():
+ return "sb16"
+ else:
+ return "ac97"
+ def supports_direct_kernel_boot(self):
+ return True
+ def direct_kernel_boot(self):
+ return True
+
class SLES8Defaults(SUSEDefaults):
def name(self):
return msg.sles8
@@ -442,6 +478,36 @@
def direct_kernel_boot(self):
return True
+class SLES12Defaults(SUSEDefaults):
+ def name(self):
+ return msg.sles12
+ def default_memory(self):
+ return 512
+ def _disk_size(self):
+ return 8
+ def num_vcpus(self):
+ return caps.vcpu_processors(4)
+ def apic(self):
+ return True
+ def is_upgradeable(self):
+ return True
+ def supports_32nonpae(self):
+ return False
+ def virtio(self):
+ if caps.is_kvm() or caps.is_qemu():
+ return True
+ else:
+ return False
+ def nics(self):
+ if caps.is_kvm() or caps.is_qemu():
+ return [ KvmNic(model='virtio') ]
+ else:
+ return [ XenNic(model='para') ]
+ def supports_direct_kernel_boot(self):
+ return True
+ def direct_kernel_boot(self):
+ return True
+
class UbuntuDefaults(LinuxDefaults):
def group(self):
return 'ubuntu'
@@ -826,8 +892,10 @@
'rhel6' : RHEL6Defaults(),
'sled10' : SLED10Defaults(),
'sled11' : SLED11Defaults(),
+ 'sled12' : SLED12Defaults(),
'sles10' : SLES10Defaults(),
'sles11' : SLES11Defaults(),
+ 'sles12' : SLES12Defaults(),
'sles8' : SLES8Defaults(),
'sles9' : SLES9Defaults(),
'suse' : SUSEDefaults(),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vm-install-0.7.8/src/vminstall/VMSUSE.py new/vm-install-0.8.0/src/vminstall/VMSUSE.py
--- old/vm-install-0.7.8/src/vminstall/VMSUSE.py 2013-10-16 18:43:54.000000000 +0200
+++ new/vm-install-0.8.0/src/vminstall/VMSUSE.py 2014-01-03 17:13:45.000000000 +0100
@@ -359,7 +359,8 @@
if options.direct_kernel_boot:
virtio = False
if caps.is_kvm():
- if options.os_type == 'sles11' or options.os_type == 'sled11' or \
+ if options.os_type == 'sles12' or options.os_type == 'sled12' or \
+ options.os_type == 'sles11' or options.os_type == 'sled11' or \
options.os_type == 'opensuse11' or options.os_type == 'opensuse12' or \
options.os_type == 'opensuse13':
virtio = True
@@ -421,7 +422,9 @@
(fd, tmpdisk) = tempfile.mkstemp(prefix='autoyast.')
virtio = False
if guest.options.direct_kernel_boot and caps.is_kvm():
- if guest.options.os_type == 'sles11' or \
+ if guest.options.os_type == 'sles12' or \
+ guest.options.os_type == 'sled12' or \
+ guest.options.os_type == 'sles11' or \
guest.options.os_type == 'sled11' or \
guest.options.os_type == 'opensuse11' or \
guest.options.os_type == 'opensuse12' or \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vm-install-0.7.8/src/vminstall/caps.py new/vm-install-0.8.0/src/vminstall/caps.py
--- old/vm-install-0.7.8/src/vminstall/caps.py 2013-10-16 18:43:54.000000000 +0200
+++ new/vm-install-0.8.0/src/vminstall/caps.py 2014-01-03 17:10:34.000000000 +0100
@@ -222,4 +222,8 @@
return 'sles11'
if line.startswith('SUSE Linux Enterprise Desktop 11'):
return 'sled11'
- return 'sles11'
+ if line.startswith('SUSE Linux Enterprise Server 12'):
+ return 'sles12'
+ if line.startswith('SUSE Linux Enterprise Desktop 12'):
+ return 'sled12'
+ return 'sles12'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vm-install-0.7.8/src/vminstall/console.py new/vm-install-0.8.0/src/vminstall/console.py
--- old/vm-install-0.7.8/src/vminstall/console.py 2013-10-16 18:43:54.000000000 +0200
+++ new/vm-install-0.8.0/src/vminstall/console.py 2014-01-03 00:53:32.000000000 +0100
@@ -152,8 +152,11 @@
default_viewer = 'vncviewer'
else:
default_viewer = 'virt-viewer'
- domid = self.get_domid_from_uuid(guest.uuid)
- vncport = self.get_vnc_port_from_domid(domid, timeout=10.0)
+ if guest.options.use_xl:
+ vncport = 5900
+ else:
+ domid = self.get_domid_from_uuid(guest.uuid)
+ vncport = self.get_vnc_port_from_domid(domid, timeout=10.0)
if vncport == None:
log.info("Did not find VNC port, so not using VNC.")
raise NotImplementedError
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vm-install-0.7.8/src/vminstall/hypervisor.py new/vm-install-0.8.0/src/vminstall/hypervisor.py
--- old/vm-install-0.7.8/src/vminstall/hypervisor.py 2013-10-16 18:43:54.000000000 +0200
+++ new/vm-install-0.8.0/src/vminstall/hypervisor.py 2014-01-03 22:49:55.000000000 +0100
@@ -63,14 +63,8 @@
# Method: domain_running
#---------------------------------------------------------------------------
def domain_running(self, domid):
- domain = self.domain(domid)
- if not domain:
- return False
- for d in domain:
- if type(d) == list and len(d) > 1 and d[0] == 'state':
- # Any state means there is an instance...
- return len(d[1]) > 1
- return False
+ #TODO: any code that is stubb, should probably produce an exception
+ pass
#---------------------------------------------------------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vm-install-0.7.8/src/vminstall/job.py new/vm-install-0.8.0/src/vminstall/job.py
--- old/vm-install-0.7.8/src/vminstall/job.py 2013-10-16 18:43:54.000000000 +0200
+++ new/vm-install-0.8.0/src/vminstall/job.py 2014-01-06 21:46:02.000000000 +0100
@@ -405,6 +405,228 @@
pass
return (xml_cf, xen_cf)
+ def _find_closing_brace(self, line, index, end):
+ closing_brace_found = 0
+ while index < end:
+ if line[index] == ")" or line[index] == ">":
+ closing_brace_found = 1
+ index = index + 1
+ break
+ index += 1
+ return (index, closing_brace_found)
+
+ def _partition_line(self, line, sep):
+ list = line.split(sep)
+ a = b = c = ""
+ idx = 0
+ b = sep
+ for s in list:
+ if idx == 0:
+ a = s
+ else:
+ c = c + s
+ idx = idx + 1
+ return (a,b,c)
+
+ def _parse_sxp(self, f, lines):
+ kernel_found = 0
+ bootloader_found = 0
+ bootloader_args_found = 0
+ ramdisk_found = 0
+ args_found = 0
+ on_reboot_found = 0
+
+ for line in lines:
+ while True:
+ if not kernel_found:
+ index = line.find("(kernel ")
+ if index != -1:
+ kernel_found = 1
+ _line = line[0:index]
+ new = " (kernel " + self.guest.kernel + ")\n"
+ if not ramdisk_found:
+ new = new + " (ramdisk " + self.guest.initrd + ")\n"
+ ramdisk_found = 1
+ _line = _line + new
+ end = len(line)
+ (index,found) = self._find_closing_brace(line, index, end)
+ line = _line + line[index:end]
+ continue
+ if not bootloader_found:
+ index = line.find("(bootloader ")
+ if index != -1:
+ bootloader_found = 1
+ end = len(line)
+ (end,found) = self._find_closing_brace(line, index, end)
+ sep = line[index:end]
+ (a,b,c) = self._partition_line(line, sep)
+ if c.strip(" \n") == "" and a.strip(" ") == "":
+ c = ""
+ if a.strip(" ") == "":
+ a = ""
+ line = a + c
+ continue
+ if not bootloader_args_found:
+ index = line.find("(bootloader_args ")
+ if index != -1:
+ bootloader_args_found = 1
+ end = len(line)
+ (end,found) = self._find_closing_brace(line, index, end)
+ sep = line[index:end]
+ (a,b,c) = self._partition_line(line, sep)
+ if c.strip(" \n") == "" and a.strip(" ") == "":
+ c = ""
+ if a.strip(" ") == "":
+ a = ""
+ line = a + c
+ continue
+ if not ramdisk_found:
+ index = line.find("(ramdisk ")
+ if index != -1:
+ ramdisk_found = 1
+ end = len(line)
+ (end,found) = self._find_closing_brace(line, index, end)
+ sep = line[index:end]
+ (a,b,c) = self._partition_line(line, sep)
+ if found:
+ new = " (ramdisk " + self.guest.initrd + ")\n"
+ else:
+ new = " (ramdisk " + self.guest.initrd + "\n"
+ line = a + new + c
+ continue
+ if not args_found:
+ index = line.find("(args ")
+ if index != -1:
+ args_found = 1
+ end = len(line)
+ (end,found) = self._find_closing_brace(line, index, end)
+ sep = line[index:end]
+ (a,b,c) = self._partition_line(line, sep)
+ args_line = " (args \' install=" + self.guest.options.source
+ if self.guest.options.extra_args:
+ args_line = args_line + " " + self.guest.options.extra_args
+ if found:
+ new = args_line + "\')\n"
+ else:
+ new = args_line + "\'\n"
+ line = a + new + c
+ continue
+ if not on_reboot_found:
+ index = line.find("(on_reboot ")
+ if index != -1:
+ on_reboot_found = 1
+ end = len(line)
+ (end,found) = self._find_closing_brace(line, index, end)
+ sep = line[index:end]
+ (a,b,c) = self._partition_line(line, sep)
+ if found:
+ new = "(on_reboot destroy)"
+ else:
+ new = "(on_reboot destroy"
+ line = a + new + c
+ continue
+ f.write(line)
+ break
+
+ def _parse_xml(self, f, lines):
+ kernel_found = 0
+ bootloader_found = 0
+ bootloader_args_found = 0
+ ramdisk_found = 0
+ args_found = 0
+ on_reboot_found = 0
+ for line in lines:
+ while True:
+ if not kernel_found:
+ index = line.find("<kernel>")
+ if index != -1:
+ kernel_found = 1
+ _line = line[0:index]
+ new = " <kernel>" + self.guest.kernel + "</kernel>\n"
+ if not ramdisk_found:
+ new = new + " <initrd>" + self.guest.initrd + "</initrd>\n"
+ ramdisk_found = 1
+ _line = _line + new
+ end = len(line)
+ (index,found) = self._find_closing_brace(line, index, end)
+ line = _line + line[index:end]
+ continue
+ if not bootloader_found:
+ index = line.find("<bootloader>")
+ if index != -1:
+ bootloader_found = 1
+ end = len(line)
+ (end,found) = self._find_closing_brace(line, index, end)
+ sep = line[index:end]
+ (a,b,c) = self._partition_line(line, sep)
+ if c.strip(" \n") == "" and a.strip(" ") == "":
+ c = ""
+ if a.strip(" ") == "":
+ a = ""
+ line = a + c
+ continue
+ if not bootloader_args_found:
+ index = line.find("