Hello community, here is the log from the commit of package vm-install for openSUSE:Factory checked in at Mon May 16 12:07:35 CEST 2011.
-------- --- vm-install/vm-install.changes 2011-04-26 22:41:51.000000000 +0200 +++ /mounts/work_src_done/STABLE/vm-install/vm-install.changes 2011-05-12 00:02:38.000000000 +0200 @@ -1,0 +2,23 @@ +Wed May 11 11:23:06 MDT 2011 - carn...@novell.com + +- If Xend is not running but we are running on the Xen hypervisor, + connect to libvirt for supporting libxl. + +------------------------------------------------------------------- +Tue May 10 06:47:41 MDT 2011 - carn...@novell.com + +- bnc#692625 - virt-manager has problems to install guest from + multiple CD + +------------------------------------------------------------------- +Fri Apr 29 12:08:01 MDT 2011 - carn...@novell.com + +- Added Ubuntu as an OS Installation choice + +------------------------------------------------------------------- +Thu Apr 28 11:03:50 MDT 2011 - carn...@novell.com + +- When PXE boot is selected as the installation source, make sure + an emulated nic is defined during the install of HVM guests. + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- vm-install-0.5.2.tar.bz2 New: ---- vm-install-0.5.3.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ vm-install.spec ++++++ --- /var/tmp/diff_new_pack.Kt3Aat/_old 2011-05-16 12:06:39.000000000 +0200 +++ /var/tmp/diff_new_pack.Kt3Aat/_new 2011-05-16 12:06:39.000000000 +0200 @@ -26,10 +26,10 @@ License: GPLv2+ Group: System/Emulators/PC AutoReqProv: yes -Version: 0.5.2 +Version: 0.5.3 Release: 1 Summary: Tool to Define a Virtual Machine and Install Its Operating System -Source0: %{name}-0.5.2.tar.bz2 +Source0: %{name}-0.5.3.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build ExclusiveArch: %ix86 x86_64 Requires: libvirt python-urlgrabber libxml2-python libvirt-python virt-utils udhcp tftp ++++++ vm-install-0.5.2.tar.bz2 -> vm-install-0.5.3.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vm-install-0.5.2/Makefile new/vm-install-0.5.3/Makefile --- old/vm-install-0.5.2/Makefile 2011-04-20 22:59:01.000000000 +0200 +++ new/vm-install-0.5.3/Makefile 2011-05-11 19:26:02.000000000 +0200 @@ -1,5 +1,5 @@ PACKAGE = vm-install -VER = 0.5.2 +VER = 0.5.3 default: @echo "Run 'make install DESTDIR=$destdir' to install." diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vm-install-0.5.2/glade/vm-install.glade new/vm-install-0.5.3/glade/vm-install.glade --- old/vm-install-0.5.2/glade/vm-install.glade 2011-04-26 22:26:15.000000000 +0200 +++ new/vm-install-0.5.3/glade/vm-install.glade 2011-04-29 21:38:50.000000000 +0200 @@ -1875,6 +1875,7 @@ <widget class="GtkEntry" id="create-vm-name"> <property name="visible">True</property> <property name="can_focus">True</property> + <property name="has_focus">True</property> <property name="editable">True</property> <property name="visibility">True</property> <property name="max_length">50</property> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vm-install-0.5.2/setup.py new/vm-install-0.5.3/setup.py --- old/vm-install-0.5.2/setup.py 2011-04-20 22:58:56.000000000 +0200 +++ new/vm-install-0.5.3/setup.py 2011-05-11 19:25:54.000000000 +0200 @@ -1,7 +1,7 @@ from distutils.core import setup setup(name='vminstall', - version='0.5.2', + version='0.5.3', description='Define a virtual machine and install its operating system', author='Charles Coffing', author_email='ccoff...@novell.com', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vm-install-0.5.2/src/vmdisks/disks.py new/vm-install-0.5.3/src/vmdisks/disks.py --- old/vm-install-0.5.2/src/vmdisks/disks.py 2011-04-13 18:42:46.000000000 +0200 +++ new/vm-install-0.5.3/src/vmdisks/disks.py 2011-05-10 15:19:03.000000000 +0200 @@ -1057,16 +1057,13 @@ else: if self._vdevType == self.DEVICE_CDROM and self.vdev.startswith('vd'): target_dev = None - # Default to hdc for the first cdrom - if available_cdroms['hdc'] == 0: - target_dev = "hdc" - available_cdroms['hdc'] = 1 - else: - for cd in available_cdroms: - if available_cdroms[cd] == 0: - target_dev = cd - available_cdroms[cd] = 1 - break + # Grab the lowest available cdrom + for cd in available_cdroms: + key = cd.keys()[0] + if cd[key] == 0: + target_dev = key + cd[key] = 1 + break if not target_dev: target_string = "<target dev='hd" + self.vdev[len(self.vdev)-1] + "'/>" else: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vm-install-0.5.2/src/vminstall/VMDefaults.py new/vm-install-0.5.3/src/vminstall/VMDefaults.py --- old/vm-install-0.5.2/src/vminstall/VMDefaults.py 2011-04-25 17:18:17.000000000 +0200 +++ new/vm-install-0.5.3/src/vminstall/VMDefaults.py 2011-04-30 00:09:17.000000000 +0200 @@ -16,6 +16,7 @@ from VMNetWare import VMNetWare from VMRedHat import VMRedHat from VMSUSE import VMSUSE +from VMUbuntu import VMUbuntu from VMWindows import VMWindows from vmdisks import Disk from VMPXE import VMPXE @@ -379,6 +380,72 @@ else: return [ XenNic(model='para') ] +class UbuntuDefaults(LinuxDefaults): + def group(self): + return 'ubuntu' + def name(self): + return msg.ubuntu_other + def virt_support(self): + return ('hvm') + def actions(self): + return VMUbuntu() + def virt_support(self): + return ('hvm') + def min_memory(self): + return 128 + #def default_memory(self): + # return 256 + def auto_install(self): + return msg.kickstart_desc + def apic(self): + return True + def usb(self): + return True + +class Ubuntu10Defaults(UbuntuDefaults): + def name(self): + return msg.ubuntu10 + def virt_support(self): + return ('hvm') + def max_cpus(self): + return 16 + def min_memory(self): + return 256 + def max_memory(self): + return self.default_memory() + 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') ] + +class Ubuntu11Defaults(UbuntuDefaults): + def name(self): + return msg.ubuntu11 + def virt_support(self): + return ('hvm') + def max_cpus(self): + return 16 + def min_memory(self): + return 256 + def max_memory(self): + return self.default_memory() + 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') ] + class NetWareDefaults(GenericDefaults): def group(self): return 'netware' @@ -627,6 +694,9 @@ 'suse' : SUSEDefaults(), 'solaris10': Solaris10Defaults(), 'solaris9' : Solaris9Defaults(), + 'ubuntu' : UbuntuDefaults(), + 'ubuntu10' : Ubuntu10Defaults(), + 'ubuntu11' : Ubuntu11Defaults(), 'winserver2008' : WindowsServer2008Defaults(), 'winserver2008x64': WindowsServer2008x64Defaults(), 'windowsvista' : WindowsVistaDefaults(), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vm-install-0.5.2/src/vminstall/VMUbuntu.py new/vm-install-0.5.3/src/vminstall/VMUbuntu.py --- old/vm-install-0.5.2/src/vminstall/VMUbuntu.py 1970-01-01 01:00:00.000000000 +0100 +++ new/vm-install-0.5.3/src/vminstall/VMUbuntu.py 2011-04-29 21:38:27.000000000 +0200 @@ -0,0 +1,184 @@ +# Ubuntu-specific operations +# +# Copyright 2011 Novell, Inc. +# +# 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 urlgrabber.grabber as grabber + +from VMLinux import VMLinux +from exceptions import * +import shutil +import stat +import tempfile +import mount +import msg +import util +import os +import vmdisks + +kickstart_vdev = vmdisks.get_possible_vdevs(False,False)[-1] + +class VMUbuntu(VMLinux): + def _kernel(self, base, alternate=None): + if alternate: + path=alternate + else: + path="images/xen" + return '%s/%s/vmlinuz' % (base,path,) + def _initrd(self, base, alternate=None): + if alternate: + path=alternate + else: + path="images/xen" + return '%s/%s/initrd.img' % (base,path,) + + def getInstallImagesFromUrl(self, options, url, progress=lambda f:None, supports_32nonpae=False): + """Retrieves a Xen-enabled Ubuntu kernel and initrd from the URL, and + copies them to temporary files. Returns the (kernel, initrd) tuple of + filenames.""" + kfd = ifd = None + try: + try: + if url.startswith('http://') or url.startswith('ftp://'): + alt_path="images/pxeboot" + try: + kfd = grabber.urlopen(self._kernel(url)) + except: + kfd = grabber.urlopen(self._kernel(url,alt_path)) + try: + ifd = grabber.urlopen(self._initrd(url)) + except: + ifd = grabber.urlopen(self._initrd(url,alt_path)) + elif url.startswith('nfs:'): + mnt = mount.TemporaryMount(url[4:]) + mountpoint = mnt.mount(mnt) + kfd = open(self._kernel(mountpoint), 'r') + ifd = open(self._initrd(mountpoint), 'r') + else: + raise InstSrcError(err=InstSrcError.E_UNSUPPORTED, details=url) + kfn = util.copy_to_temp(kfd, prefix='vmlinuz.', progress=lambda f:progress(f*0.5)) + try: + ifn = util.copy_to_temp(ifd, prefix='initrd.', progress=lambda f:progress(0.5+f*0.5)) + except: + os.unlink(kfn) + raise + except IOError, e: + raise RuntimeError(msg.invalid_url + ': ' + str(e)) + finally: + if kfd: kfd.close() + if ifd: ifd.close() + return (kfn, ifn) + + def getInstallImagesFromPath(self, options, path, progress=lambda f:None, supports_32nonpae=False): + """Retrieves a Xen-enabled Ubuntu kernel and initrd from the base path, and + copies them to temporary files. Returns the (kernel, initrd) tuple of + filenames.""" + kfd = ifd = None + k_xen = i_xen = None + if os.path.exists(self._kernel(path)): + k_xen = self._kernel(path) + i_xen = self._initrd(path) + else: + alt_path="images/pxeboot" + k_xen = self._kernel(path,alt_path) + i_xen = self._initrd(path,alt_path) + try: + kfd = open(k_xen, 'r') + ifd = open(i_xen, 'r') + kfn = util.copy_to_temp(kfd, prefix='vmlinuz.', progress=lambda f:progress(f*0.5)) + try: + ifn = util.copy_to_temp(ifd, prefix='initrd.', progress=lambda f:progress(0.5+f*0.5)) + except: + os.unlink(kfn) + raise + finally: + if kfd: kfd.close() + if ifd: ifd.close() + return (kfn, ifn) + + def getInstallArgs(self, options, override=None): + """Return Ubuntu's kernel arguments for installs.""" + if options.full_virt: + return '' + args = VMLinux.getInstallArgs(self, options) + if type(options.source) is str: + args += ' method=%s' % options.source + if options.os_settings: + if override is not None: + args += ' ks=%s' % override + else: + args += ' ks=%s' % options.os_settings + return args + + def preprocessOptions(self, options): + """Pulls settings out of extra_args.""" + if options.os_type == 'rhel4' and options.full_virt: + #options.usb = True + options.usb_mouse_abs = False + if not options.extra_args: + return + args = options.extra_args.split() + extra_args = '' + for arg in args: + if arg.startswith('method='): + if not options.source: + src = arg[7:] + if src.startswith('hd://'): + src = 'dev:/' + src[5:] + options.source = src + elif arg.startswith('ks=') and not options.os_settings: + options.os_settings = arg[3:] + else: + extra_args += arg + ' ' + options.extra_args = extra_args + + def setupOsSettings(self, guest, progress=lambda f:None): + """Creates a temporary disk image, in which to pass the kickstart + Text file.""" + ks = guest.options.os_settings + if ks and ks.startswith('ks='): + ks = ks.split('=',2)[1] + if not ks or ks.startswith('ftp://') or ks.startswith('tftp://') or \ + ks.startswith('http://') or ks.startswith('nfs://'): + pass + else: + (fd, tmpdisk) = tempfile.mkstemp(prefix='kickstart.') + ks_vdev = kickstart_vdev + if guest.options.os_type != 'sles11' and not guest.options.full_virt: + ks_vdev = 'xvdp' + disk = vmdisks.Disk(pdev=tmpdisk, vdev=ks_vdev, ro=True, blocks=2048, + full_virt=guest.options.full_virt, vmname=guest.options.name) + try: + disk.setup(progress=lambda f:progress(f*0.5)) + util.mke2fsImage(tmpdisk, progress=lambda f:progress(0.5+f*0.25)) + mounted_disk = mount.TemporaryLoopMount(tmpdisk) + mountpoint = mounted_disk.mount(options='loop') + progress(0.8) + try: + # Setup hd:xvdp:/<filename> + mode = os.stat(ks).st_mode + ks_file = None + if stat.S_ISREG(mode): + ks_file = os.path.basename(ks) + shutil.copyfile(ks, mountpoint + '/' + ks_file) + elif stat.S_ISDIR(mode): + if os.path.exists(ks + '/' + 'ks.cfg'): + ks_file = 'ks.cfg' + shutil.copyfile(ks + '/ks.cfg', mountpoint + '/' + 'ks.cfg') + if ks_file is not None: + override = "hd:xvdp:/" + ks_file + guest.options._install_args = self.getInstallArgs(guest.options, override) + finally: + progress(0.9) + mounted_disk.unmount() + except: + os.unlink(tmpdisk) + raise + guest.tmpdisks.append(disk) + progress(1.0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vm-install-0.5.2/src/vminstall/caps.py new/vm-install-0.5.3/src/vminstall/caps.py --- old/vm-install-0.5.2/src/vminstall/caps.py 2011-03-16 00:30:09.000000000 +0100 +++ new/vm-install-0.5.3/src/vminstall/caps.py 2011-05-11 23:56:56.000000000 +0200 @@ -12,6 +12,7 @@ import os import platform +import util from exceptions import * @@ -46,17 +47,28 @@ cpus = max_vcpus return cpus -def free_memory(): - f = open('/proc/meminfo') - lines = f.readlines() - f.close() +def free_memory(is_xen): free_memory = 0 - for line in lines: - if line.startswith('MemFree:') or line.startswith('Inactive:'): - mem = line.split(':', 1)[1] - mem = mem.strip() - mem = mem.split(' ')[0] - free_memory = free_memory + ((int)(mem) / 1024) + if is_xen: + if util.is_xend_running(): + cmd = '/usr/sbin/xm info | grep max_free_memory' + else: + cmd = '/usr/sbin/xl info | grep free_memory' + rfd = os.popen(cmd) + data = rfd.read() + status = rfd.close() + free_memory = data.split(':',1)[1] + free_memory = free_memory.strip() + else: + f = open('/proc/meminfo') + lines = f.readlines() + f.close() + for line in lines: + if line.startswith('MemFree:') or line.startswith('Inactive:'): + mem = line.split(':', 1)[1] + mem = mem.strip() + mem = mem.split(' ')[0] + free_memory = free_memory + ((int)(mem) / 1024) return free_memory _arch = None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vm-install-0.5.2/src/vminstall/gtk/interface.py new/vm-install-0.5.3/src/vminstall/gtk/interface.py --- old/vm-install-0.5.2/src/vminstall/gtk/interface.py 2011-04-26 22:26:55.000000000 +0200 +++ new/vm-install-0.5.3/src/vminstall/gtk/interface.py 2011-04-29 21:38:26.000000000 +0200 @@ -776,7 +776,9 @@ # elif page_number == self.pages['name']: if self.defaults.description: - self.window.get_widget('description-entry').set_text(self.defaults.description) + w = self.window.get_widget('description-entry') + w.set_text(self.defaults.description) + w.connect('activate', self.apply) w = self.window.get_widget('create-vm-name') w.connect('activate', self.apply) w.set_text(strify(self.defaults.name)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vm-install-0.5.2/src/vminstall/kvm_guest.py new/vm-install-0.5.3/src/vminstall/kvm_guest.py --- old/vm-install-0.5.2/src/vminstall/kvm_guest.py 2011-03-31 21:52:38.000000000 +0200 +++ new/vm-install-0.5.3/src/vminstall/kvm_guest.py 2011-05-10 15:17:57.000000000 +0200 @@ -103,7 +103,7 @@ def _get_disk_xml(self): """Get the disk config in the libvirt XML format""" - available_cdroms = { 'hda': 0, 'hdb':0, 'hdc':0, 'hdd':0 } + available_cdroms = [{'hda': 0}, {'hdb': 0}, {'hdc': 0}, {'hdd': 0}] ret = [] for disk in self.options.disks + self.tmpdisks: use_virtio = self.options.virtio and disk.virtio diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vm-install-0.5.2/src/vminstall/libvirt_hypervisor.py new/vm-install-0.5.3/src/vminstall/libvirt_hypervisor.py --- old/vm-install-0.5.2/src/vminstall/libvirt_hypervisor.py 2011-03-16 00:30:09.000000000 +0100 +++ new/vm-install-0.5.3/src/vminstall/libvirt_hypervisor.py 2011-05-11 23:47:22.000000000 +0200 @@ -159,7 +159,10 @@ #--------------------------------------------------------------------------- def info(self): self.virNode = self.virConn.getInfo() - maxmem = caps.free_memory() + if caps.is_xen(): + maxmem = caps.free_memory(True) + else: + maxmem = caps.free_memory(False) if maxmem > 524288: maxmem = 524288 return dict([('nr_cpus', self.virNode[2]), ('total_memory', self.virNode[1]), ('max_hvm_memory', maxmem), ('max_para_memory', maxmem)]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vm-install-0.5.2/src/vminstall/msg.py new/vm-install-0.5.3/src/vminstall/msg.py --- old/vm-install-0.5.2/src/vminstall/msg.py 2011-04-26 22:33:11.000000000 +0200 +++ new/vm-install-0.5.3/src/vminstall/msg.py 2011-04-29 21:38:27.000000000 +0200 @@ -109,6 +109,7 @@ os_netware = _("NetWare") os_redhat = _("RedHat") os_suse = _("SUSE") +os_ubuntu = _("Ubuntu") os_windows = _("Windows") os_solaris = _("Solaris") os_other = _("Other") @@ -134,6 +135,9 @@ solaris10 = _("Solaris 10") solaris9 = _("Solaris 9 and older") suse_other = _("SUSE (other)") +ubuntu_other = _("Ubuntu (other)") +ubuntu10 = _("Ubuntu 10 (Lucid Lynx, Maverick Meerkat)") +ubuntu11 = _("Ubuntu 11 (Natty Narwhal, Oneiric Ocelot)") windows_other = _("Windows (other)") windows_other_x64 = _("Windows (other, x64)") windows_nt = _("Windows NT") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vm-install-0.5.2/src/vminstall/options.py new/vm-install-0.5.3/src/vminstall/options.py --- old/vm-install-0.5.2/src/vminstall/options.py 2011-04-12 23:05:49.000000000 +0200 +++ new/vm-install-0.5.3/src/vminstall/options.py 2011-05-11 19:20:32.000000000 +0200 @@ -380,10 +380,13 @@ hypervisor.connection = options.connect options.use_libvirt = True elif hypervisor.connection is None: - if not caps.is_xen(): + if not caps.is_xen() or not util.is_xend_running(): # NOTE: the KVM path is coming through here! Yea! import libvirt_hypervisor - defaults.connect = libvirt_hypervisor.LibVirtHypervisor("qemu:///system") + if caps.is_xen(): + defaults.connect = libvirt_hypervisor.LibVirtHypervisor("xen:///") + else: + defaults.connect = libvirt_hypervisor.LibVirtHypervisor("qemu:///system") defaults.use_libvirt = options.use_libvirt = True else: import xen_hypervisor @@ -395,7 +398,7 @@ if options.os_type: defaults.os_type = options.os_type else: - defaults.os_type = default_os_type + options.os_type = defaults.os_type = default_os_type vmdefaults = VMDefaults[defaults.os_type] if options.pxe_boot: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vm-install-0.5.2/src/vminstall/util.py new/vm-install-0.5.3/src/vminstall/util.py --- old/vm-install-0.5.2/src/vminstall/util.py 2011-03-16 00:30:09.000000000 +0100 +++ new/vm-install-0.5.3/src/vminstall/util.py 2011-05-07 00:17:47.000000000 +0200 @@ -310,6 +310,15 @@ managed_vms.append(words[0]) return managed_vms +def is_xend_running(): + if os.path.exists('/usr/sbin/xend'): + try: + util.run(['/usr/sbin/xend', 'status']) + return True + except: + pass + return False + def get_config_file_option(config_file, var): f = open(config_file) lines = f.readlines() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vm-install-0.5.2/src/vminstall/xen_guest.py new/vm-install-0.5.3/src/vminstall/xen_guest.py --- old/vm-install-0.5.2/src/vminstall/xen_guest.py 2011-03-31 21:52:45.000000000 +0200 +++ new/vm-install-0.5.3/src/vminstall/xen_guest.py 2011-04-28 19:11:23.000000000 +0200 @@ -142,6 +142,13 @@ def _get_network_xen(self): """Get the network config in the xend python format""" + need_emulated_nic = False + if self.options.full_virt and self.options.pxe_boot: + # If PXE booting, must have emulated nic + need_emulated_nic = True + for nic in self.options.nics: + if nic.model != 'para': + need_emulated_nic = False ret = 'vif=[ ' for nic in self.options.nics: ret += "'" @@ -158,7 +165,10 @@ if self.options.full_virt: if nic.model == 'para': ret += commas[needComma] - ret += 'type=netfront' + if self.isInstall and need_emulated_nic: + ret += 'model=rtl8139' + else: + ret += 'type=netfront' needComma = 1 else: if nic.model: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org