Hello community,
here is the log from the commit of package vm-install
checked in at Sat Sep 13 12:26:41 CEST 2008.
--------
--- arch/i386/vm-install/vm-install.changes 2008-08-30 05:42:28.000000000 +0200
+++ /mounts/work_src_done/STABLE/vm-install/vm-install.changes 2008-09-12 01:45:55.135174000 +0200
@@ -1,0 +2,13 @@
+Thu Sep 11 15:23:43 MDT 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.
+- Version 0.3.8
+
+-------------------------------------------------------------------
+Fri Sep 5 08:08:29 MDT 2008 - carnold@novell.com
+
+- Use pygrub for some OS installs. Fixed problem with xstransact
+ in console.py.
+
+-------------------------------------------------------------------
Old:
----
vm-install-0.3.7.tar.bz2
New:
----
vm-install-0.3.8.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ vm-install.spec ++++++
--- /var/tmp/diff_new_pack.D32508/_old 2008-09-13 12:26:27.000000000 +0200
+++ /var/tmp/diff_new_pack.D32508/_new 2008-09-13 12:26:27.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package vm-install (Version 0.3.7)
+# spec file for package vm-install (Version 0.3.8)
#
# 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.7
+Version: 0.3.8
Release: 1
Summary: Tool to Define a Virtual Machine and Install Its Operating System
-Source0: %{name}-0.3.7.tar.bz2
+Source0: %{name}-0.3.8.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
+* 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.
+- Version 0.3.8
+* Fri Sep 05 2008 carnold@novell.com
+- Use pygrub for some OS installs. Fixed problem with xstransact
+ in console.py.
* Tue Aug 26 2008 carnold@novell.com
- Added option to set on_poweroff, on_reboot and on_crash.
* Wed Aug 20 2008 carnold@novell.com
++++++ vm-install-0.3.7.tar.bz2 -> vm-install-0.3.8.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/vm-install-0.3.7/bin/vm-install new/vm-install-0.3.8/bin/vm-install
--- old/vm-install-0.3.7/bin/vm-install 2008-08-30 05:41:29.000000000 +0200
+++ new/vm-install-0.3.8/bin/vm-install 2008-09-12 00:25:33.000000000 +0200
@@ -74,7 +74,7 @@
parser.add_option('-g', '--graphics', type='string',
help="graphics hardware; one of 'cirrus', 'none', 'para', 'vesa'")
parser.add_option('', '--graphics-viewer', type='string',
- help="graphics viewer; one of 'text', 'sdl', or 'vnc'")
+ help="graphics viewer; one of 'text', 'sdl', 'vnc', or 'virt-viewer'")
parser.add_option('-m', '--memory', type='int', dest='memoryMB', metavar='MEGABYTES',
help="initial MB of RAM for VM")
parser.add_option('-M', '--max-memory', type='int', dest='max_memoryMB', metavar='MEGABYTES',
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/vm-install-0.3.7/ChangeLog new/vm-install-0.3.8/ChangeLog
--- old/vm-install-0.3.7/ChangeLog 2008-08-30 05:41:30.000000000 +0200
+++ new/vm-install-0.3.8/ChangeLog 2008-09-12 00:31:25.000000000 +0200
@@ -1,6 +1,29 @@
+0.3.8
+---------
+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.
+Use pygrub for some OS installs. Fixed problem with xstransact in console.py.
+Added option to set on_poweroff, on_reboot and on_crash.
+Use to qcow2 images and use qemu-img-xen to create them.
+bnc#418207 - vm-install missing dependency, libvirt-python
+bnc#414899 - vm-install erroneously reports installation error when using qcow
+bnc#417494 - python's file chooser dialog changes with every release, hence this fix.
+Allow virt-viewer to be used as the vm viewer.
+Added PXE boot feature for PV guests.
+bnc#245587 - Add drop down to network install source
+bnc#268153 - warn about being out of disk space.
+bnc#259994 - Disk size keeps changing back to 4.0
+bnc#347427 - text mode install does not allow control over the sparse file option.
+Removed 'type=ioemu' for FV guests.
+Allow vm-install to use libvirt calls to acquire guest information.
+Update protocol menu based on file type selected while browsing.
+Added --preserve-on-error to keep temporary files, config and image file around for debugging.
+Added --no-install to allow just a config file to be written.
+Added pull down menu to select various disk protocols.
+
0.2.3
---------
-Add option to allow PXE booting of the guest
+Add option to allow PXE booting of the HVM guest
Enable SMP for guests by default
0.2.2
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/vm-install-0.3.7/glade/vm-install.glade new/vm-install-0.3.8/glade/vm-install.glade
--- old/vm-install-0.3.7/glade/vm-install.glade 2008-08-30 05:41:30.000000000 +0200
+++ new/vm-install-0.3.8/glade/vm-install.glade 2008-09-12 00:25:33.000000000 +0200
@@ -4013,7 +4013,7 @@
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
- <signal name="toggled" handler="on_media_toggled" last_modification_time="Thu, 17 Jan 2008 21:34:29 GMT"/>
+ <signal name="toggled" handler="on_fv_media_toggled" last_modification_time="Thu, 04 Sep 2008 15:52:54 GMT"/>
</widget>
<packing>
<property name="left_attach">0</property>
@@ -4083,6 +4083,7 @@
<property name="active">True</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
+ <property name="group">fv-src-pxe</property>
<signal name="toggled" handler="on_fv_src_disk_toggled" last_modification_time="Thu, 17 Jan 2008 21:31:52 GMT"/>
</widget>
<packing>
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/vm-install-0.3.7/Makefile new/vm-install-0.3.8/Makefile
--- old/vm-install-0.3.7/Makefile 2008-08-30 05:41:30.000000000 +0200
+++ new/vm-install-0.3.8/Makefile 2008-09-12 00:26:27.000000000 +0200
@@ -1,5 +1,5 @@
PACKAGE = vm-install
-VER = 0.3.7
+VER = 0.3.8
default:
@echo "Run 'make install DESTDIR=$destdir' to install."
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/vm-install-0.3.7/po/xen-vm-install.pot new/vm-install-0.3.8/po/xen-vm-install.pot
--- old/vm-install-0.3.7/po/xen-vm-install.pot 2008-08-30 05:41:30.000000000 +0200
+++ new/vm-install-0.3.8/po/xen-vm-install.pot 2008-09-12 01:35:42.000000000 +0200
@@ -8,7 +8,7 @@
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-07-11 14:30-0600\n"
+"POT-Creation-Date: 2008-09-11 17:35-0600\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME \n"
"Language-Team: LANGUAGE \n"
@@ -204,6 +204,10 @@
"Two of the virtual disks have conflicting virtual names or physical devices."
msgstr ""
+#: src/vminstall/msg.py:88
+msgid "Not enough space on device for disk image."
+msgstr ""
+
#: src/vminstall/msg.py:91
msgid "The job was canceled."
msgstr ""
@@ -480,7 +484,7 @@
msgid "Disks"
msgstr ""
-#: src/vminstall/msg.py:172 src/vminstall/msg.py:217
+#: src/vminstall/msg.py:172 src/vminstall/msg.py:218
msgid "Virtual Disk"
msgstr ""
@@ -587,232 +591,274 @@
"installation or boot process."
msgstr ""
-#: src/vminstall/msg.py:197
+#: src/vminstall/msg.py:195
+msgid ""
+"Select the behavior when the operating system exits with power off, reboot "
+"or crash. Settings take effect after installation is complete."
+msgstr ""
+
+#: src/vminstall/msg.py:198
msgid ""
"Specify the bootable virtual disk (often labeled as Disk 1) or the network "
"installation source URL. Each CD, DVD, or ISO image required for "
"installation must be added as a virtual disk."
msgstr ""
-#: src/vminstall/msg.py:200
+#: src/vminstall/msg.py:201
msgid ""
"Create a virtual disk based on a device (CD or other block device), an "
"existing image file (ISO), or a new file. Specify a device by its device "
"node, such as /dev/cdrom, not its mount point."
msgstr ""
-#: src/vminstall/msg.py:201
+#: src/vminstall/msg.py:202
msgid "Please specify the settings for the virtual network adapter."
msgstr ""
-#: src/vminstall/msg.py:204
+#: src/vminstall/msg.py:205
msgid ""
"Specify the amount of memory and number of processors to allocate for the VM."
msgstr ""
-#: src/vminstall/msg.py:205
+#: src/vminstall/msg.py:206
msgid ""
"For best performance, the number of virtual processors should be less than "
"or equal to the number of physical processors."
msgstr ""
-#: src/vminstall/msg.py:208
+#: src/vminstall/msg.py:209
msgid ""
"Paravirtualized graphics require that an appropriate driver is installed in "
"the operating system."
msgstr ""
-#: src/vminstall/msg.py:209
+#: src/vminstall/msg.py:210
msgid ""
"The VM will operate like a server without a monitor. You may still access "
"the operating system via the virtualized serial port, or through any "
"operating system supported services such as ssh or VNC."
msgstr ""
-#: src/vminstall/msg.py:210
+#: src/vminstall/msg.py:211
msgid "Please specify the type of virtualized graphics hardware."
msgstr ""
-#: src/vminstall/msg.py:211
+#: src/vminstall/msg.py:212
msgid "Paravirtualized Graphics Adapter"
msgstr ""
-#: src/vminstall/msg.py:212
+#: src/vminstall/msg.py:213
msgid "VESA VGA"
msgstr ""
-#: src/vminstall/msg.py:213
+#: src/vminstall/msg.py:214
msgid "Cirrus Logic GD5446 VGA"
msgstr ""
-#: src/vminstall/msg.py:214
+#: src/vminstall/msg.py:215
msgid "No Graphics Support"
msgstr ""
-#: src/vminstall/msg.py:218
+#: src/vminstall/msg.py:219
msgid "Virtual Disks"
msgstr ""
-#: src/vminstall/msg.py:219
+#: src/vminstall/msg.py:220
msgid "PXE Boot"
msgstr ""
-#: src/vminstall/msg.py:220
+#: src/vminstall/msg.py:221
msgid "Size (GB)"
msgstr ""
-#: src/vminstall/msg.py:221
+#: src/vminstall/msg.py:222
msgid "Create Sparse Image File"
msgstr ""
-#: src/vminstall/msg.py:222
+#: src/vminstall/msg.py:223
msgid "Read-Only Access"
msgstr ""
-#: src/vminstall/msg.py:223
+#: src/vminstall/msg.py:224
msgid "Hard Disk"
msgstr ""
-#: src/vminstall/msg.py:224
+#: src/vminstall/msg.py:225
msgid "CD-ROM or DVD"
msgstr ""
-#: src/vminstall/msg.py:225
+#: src/vminstall/msg.py:226
msgid "Floppy Disk"
msgstr ""
-#: src/vminstall/msg.py:226
+#: src/vminstall/msg.py:227
msgid "PXE"
msgstr ""
-#: src/vminstall/msg.py:229
+#: src/vminstall/msg.py:230
+msgid ""
+"Can't reach the pxe server. Possible reasons are an improperly configured "
+"network, SuSEfirewall2 or iptables -L"
+msgstr ""
+
+#: src/vminstall/msg.py:231
+msgid "Can't get the pxelinux.cfg/default file from the pxe server."
+msgstr ""
+
+#: src/vminstall/msg.py:232
+msgid "Can't download the kernel and initrd from server."
+msgstr ""
+
+#: src/vminstall/msg.py:233
+msgid ""
+"This kernel image may not be a paravirtualized xen kernel required for "
+"installation, Continue?"
+msgstr ""
+
+#: src/vminstall/msg.py:236
msgid "Fully Virtualized AMD PCnet 32"
msgstr ""
-#: src/vminstall/msg.py:230
+#: src/vminstall/msg.py:237
msgid "Fully Virtualized NE2000 (ISA Bus)"
msgstr ""
-#: src/vminstall/msg.py:231
+#: src/vminstall/msg.py:238
msgid "Fully Virtualized NE2000 (PCI Bus)"
msgstr ""
-#: src/vminstall/msg.py:232
+#: src/vminstall/msg.py:239
msgid "Fully Virtualized Realtek 8139"
msgstr ""
-#: src/vminstall/msg.py:233
+#: src/vminstall/msg.py:240
msgid "MAC Address"
msgstr ""
-#: src/vminstall/msg.py:234
+#: src/vminstall/msg.py:241
msgid "Randomly generated MAC address"
msgstr ""
-#: src/vminstall/msg.py:235
+#: src/vminstall/msg.py:242
msgid "Specified MAC address"
msgstr ""
-#: src/vminstall/msg.py:238
+#: src/vminstall/msg.py:245
msgid "Additional Arguments"
msgstr ""
-#: src/vminstall/msg.py:239
+#: src/vminstall/msg.py:246
msgid "Network URL"
msgstr ""
-#: src/vminstall/msg.py:240
+#: src/vminstall/msg.py:247
msgid "Memory"
msgstr ""
-#: src/vminstall/msg.py:241
+#: src/vminstall/msg.py:248
msgid "Processors"
msgstr ""
-#: src/vminstall/msg.py:242
+#: src/vminstall/msg.py:249
msgid "Automated install file or URL"
msgstr ""
-#: src/vminstall/msg.py:243
+#: src/vminstall/msg.py:250
msgid "Available Memory"
msgstr ""
-#: src/vminstall/msg.py:244
+#: src/vminstall/msg.py:251
msgid "Available Processors"
msgstr ""
-#: src/vminstall/msg.py:245
+#: src/vminstall/msg.py:252
msgid "Initial Memory"
msgstr ""
-#: src/vminstall/msg.py:246
+#: src/vminstall/msg.py:253
msgid "Maximum Memory"
msgstr ""
-#: src/vminstall/msg.py:247
+#: src/vminstall/msg.py:254
msgid "Virtual Processors"
msgstr ""
-#: src/vminstall/msg.py:248
+#: src/vminstall/msg.py:255
msgid "Installation Source"
msgstr ""
-#: src/vminstall/msg.py:249
+#: src/vminstall/msg.py:256
msgid "Automated Installation"
msgstr ""
-#: src/vminstall/msg.py:250
+#: src/vminstall/msg.py:257
msgid "Operating System"
msgstr ""
-#: src/vminstall/msg.py:253
+#: src/vminstall/msg.py:258
+msgid "Power Off"
+msgstr ""
+
+#: src/vminstall/msg.py:259
+msgid "Reboot"
+msgstr ""
+
+#: src/vminstall/msg.py:260
+msgid "Crash"
+msgstr ""
+
+#: src/vminstall/msg.py:263
msgid "Kickstart file or URL"
msgstr ""
-#: src/vminstall/msg.py:254
+#: src/vminstall/msg.py:264
msgid "AutoYaST file"
msgstr ""
-#: src/vminstall/msg.py:255
+#: src/vminstall/msg.py:265
msgid "NetWare response file"
msgstr ""
-#: src/vminstall/msg.py:258
+#: src/vminstall/msg.py:268
msgid "Creating the Virtual Machine"
msgstr ""
-#: src/vminstall/msg.py:259
+#: src/vminstall/msg.py:269
msgid "Writing the configuration file"
msgstr ""
-#: src/vminstall/msg.py:260
+#: src/vminstall/msg.py:270
msgid "Locate Operating System Settings File"
msgstr ""
-#: src/vminstall/msg.py:261
+#: src/vminstall/msg.py:271
msgid "Locate Disk or Disk Image"
msgstr ""
-#: src/vminstall/msg.py:264
+#: src/vminstall/msg.py:274
msgid "Do you want to add another virtual disk?"
msgstr ""
-#: src/vminstall/msg.py:265
+#: src/vminstall/msg.py:275
msgid "Do you want to add another virtual network adapter?"
msgstr ""
-#: src/vminstall/msg.py:266
+#: src/vminstall/msg.py:276
msgid "What type of virtual disk do you want to add?"
msgstr ""
-#: src/vminstall/msg.py:267
+#: src/vminstall/msg.py:277
msgid "Where will the virtual disk physically reside?"
msgstr ""
-#: src/vminstall/msg.py:268
+#: src/vminstall/msg.py:278
msgid "What type of virtual network adapter do you want to add?"
msgstr ""
-#: src/vminstall/msg.py:270
+#: src/vminstall/msg.py:279
+msgid "Create a sparse image file for the virtual disk?"
+msgstr ""
+
+#: src/vminstall/msg.py:281
msgid "Default"
msgstr ""
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/vm-install-0.3.7/setup.py new/vm-install-0.3.8/setup.py
--- old/vm-install-0.3.7/setup.py 2008-08-30 05:41:30.000000000 +0200
+++ new/vm-install-0.3.8/setup.py 2008-09-12 00:26:38.000000000 +0200
@@ -1,7 +1,7 @@
from distutils.core import setup
setup(name='vminstall',
- version='0.3.7',
+ version='0.3.8',
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.7/src/vminstall/caps.py new/vm-install-0.3.8/src/vminstall/caps.py
--- old/vm-install-0.3.7/src/vminstall/caps.py 2008-08-30 05:41:29.000000000 +0200
+++ new/vm-install-0.3.8/src/vminstall/caps.py 2008-09-12 00:25:33.000000000 +0200
@@ -123,3 +123,20 @@
def is_domU():
return is_xen() and not is_dom0()
+
+def get_os_type():
+ # Could check SPIdent on sles
+ if os.path.exists('/etc/SuSE-release'):
+ f = open('/etc/SuSE-release')
+ lines = f.readlines()
+ f.close()
+ for line in lines:
+ if line.startswith('openSUSE 10'):
+ return 'opensuse'
+ if line.startswith('openSUSE 11'):
+ return 'opensuse11'
+ if line.startswith('SUSE Linux Enterprise Server 10'):
+ return 'sles10'
+ if line.startswith('SUSE Linux Enterprise Server 11'):
+ return 'sles11'
+ return 'sles11'
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/vm-install-0.3.7/src/vminstall/console.py new/vm-install-0.3.8/src/vminstall/console.py
--- old/vm-install-0.3.7/src/vminstall/console.py 2008-08-30 05:41:29.000000000 +0200
+++ new/vm-install-0.3.8/src/vminstall/console.py 2008-09-12 00:25:33.000000000 +0200
@@ -12,28 +12,69 @@
import os
import threading
+import time
+import libxml2
+import libvirt
+from libvirt import VIR_DOMAIN_XML_SECURE
from xen.xend.xenstore.xstransact import xstransact
from xen.xend.xenstore.xswatch import xswatch
from log import log
from VMDefaults import VMDefaults
+from vminstall.VMDefaults import use_libvirt
+import vminstall.xend
import msg
import util
_reset_console = False
+def parse_xml_data(xml, element, sub):
+ try:
+ doc = libxml2.parseDoc(xml)
+ except:
+ return None
+ try:
+ ctxt = doc.xpathNewContext()
+ result = ctxt.xpathEval("//"+element)
+ if len(result):
+ value=str(result[0])
+ if sub:
+ data = value.split(sub)
+ if data[1]:
+ data = data[1].split('>')[0]
+ if data.startswith('='):
+ data = data.strip('=\"')
+ else:
+ data = data.strip('\"')
+ if data.endswith('/'):
+ data = data.rstrip('/')
+ value = data.rstrip('\"')
+ return value
+ return None
+ finally:
+ doc.freeDoc()
def get_domid_from_uuid(uuid):
- vm_path = '/vm/%s' % uuid
- t = xstransact(path='/local/domain/')
- domids = t.list()
- for domid in domids:
- path = t.read('%s/vm' % domid)
- if path == vm_path:
- domid = int(domid)
- log.debug("Domain %s has ID %d" % (uuid, domid))
- return domid
+ if use_libvirt is False:
+ vm_path = '/vm/%s' % uuid
+ t = xstransact(path='/local/domain/')
+ domids = t.list()
+ for domid in domids:
+ path = t.read('%s/vm' % domid)
+ if path == vm_path:
+ domid = int(domid)
+ log.debug("Domain %s has ID %d" % (uuid, domid))
+ t.abort()
+ return domid
+ else:
+ virConn = vminstall.xend.connection.getConn()
+ if virConn:
+ virDom = virConn.lookupByUUIDString(uuid)
+ if virDom:
+ domid = virDom.ID()
+ log.debug("Domain %s has ID %d" % (uuid, domid))
+ return domid
log.debug("Domain %s is not running" % uuid)
return None
@@ -46,55 +87,83 @@
which domid has already exited and was replace by another)."""
if domid is None:
return
- uuid_path = '/local/domain/%d/vm' % domid
- log.debug("Watching xenstore path '%s'" % uuid_path)
- cv = threading.Condition()
- def fn(path):
- log.debug("Watch fired for '%s'" % uuid_path)
- cv.acquire()
- u = xstransact.Read(uuid_path)
- log.debug("UUID is '%s'", u)
- if u is None:
- again = False
- else:
- u = u.split('/')[-1] # Why does uuid have "/vm/" prefix?
- if u == uuid:
- again = True
- else:
+ if use_libvirt is False:
+ uuid_path = '/local/domain/%d/vm' % domid
+ log.debug("Watching xenstore path '%s'" % uuid_path)
+ cv = threading.Condition()
+ def fn(path):
+ log.debug("Watch fired for '%s'" % uuid_path)
+ cv.acquire()
+ u = xstransact.Read(uuid_path)
+ log.debug("UUID is '%s'", u)
+ if u is None:
again = False
- if not again:
- cv.notifyAll()
+ else:
+ u = u.split('/')[-1] # Why does uuid have "/vm/" prefix?
+ if u == uuid:
+ again = True
+ else:
+ again = False
+ if not again:
+ cv.notifyAll()
+ cv.release()
+ return again
+ cv.acquire()
+ w = xswatch(uuid_path, fn)
+ cv.wait()
cv.release()
- return again
- cv.acquire()
- w = xswatch(uuid_path, fn)
- cv.wait()
- cv.release()
+ else:
+ # Hack: Ugly polling method of waiting.
+ # Need a better way to know when the guest has exited
+ log.debug("Polling libvirt for when guest goes away '%s'" % uuid)
+ while True:
+ try:
+ virConn = vminstall.xend.connection.getConn()
+ if virConn:
+ virDom = virConn.lookupByID(domid)
+ if virDom:
+ u = virDom.UUIDString()
+ if u == uuid:
+ time.sleep(3.0)
+ continue
+ break
+ except:
+ log.debug("Libvirt exception means guest has exited. '%s'" % uuid)
+ break
def get_vnc_port_from_domid(domid, timeout=0.0):
if domid is None:
return None
ports = [None]
- console_path = '/local/domain/%d/console/vnc-port' % domid
- log.debug("Watching xenstore path '%s'" % console_path)
- cv = threading.Condition()
- def fn(path):
- log.debug("Watch fired for '%s'" % console_path)
- again = True
+ if use_libvirt is False:
+ console_path = '/local/domain/%d/console/vnc-port' % domid
+ log.debug("Watching xenstore path '%s'" % console_path)
+ cv = threading.Condition()
+ def fn(path):
+ log.debug("Watch fired for '%s'" % console_path)
+ again = True
+ cv.acquire()
+ p = xstransact.Read(console_path)
+ if p is not None:
+ log.debug("vnc-port is '%s'", p)
+ ports[0] = p
+ cv.notifyAll()
+ again = False
+ cv.release()
+ return again
cv.acquire()
- p = xstransact.Read(console_path)
- if p is not None:
- log.debug("vnc-port is '%s'", p)
- ports[0] = p
- cv.notifyAll()
- again = False
+ w = xswatch(console_path, fn)
+ cv.wait(timeout)
cv.release()
- return again
- cv.acquire()
- w = xswatch(console_path, fn)
- cv.wait(timeout)
- cv.release()
-
+ else:
+ virConn = vminstall.xend.connection.getConn()
+ if virConn:
+ virDom = virConn.lookupByID(domid)
+ if virDom:
+ xml = virDom.XMLDesc(VIR_DOMAIN_XML_SECURE)
+ if xml:
+ p = parse_xml_data(xml, 'graphics', 'port')
+ ports[0] = p
port = ports[0]
log.info('Domain ID %d has vnc port %s' % (domid, port))
if port is not None:
@@ -104,8 +173,19 @@
def get_tty_from_domid(domid):
if domid is None:
return None
- console_path = '/local/domain/%d/console/tty' % domid
- tty = xstransact.Read(console_path)
+ tty = None
+ if use_libvirt is False:
+ console_path = '/local/domain/%d/console/tty' % domid
+ tty = xstransact.Read(console_path)
+ else:
+ # We can avoid xenstore entirely
+ virConn = vminstall.xend.connection.getConn()
+ if virConn:
+ virDom = virConn.lookupByID(domid)
+ if virDom:
+ xml = virDom.XMLDesc(VIR_DOMAIN_XML_SECURE)
+ if xml:
+ tty = parse_xml_data(xml, 'console', 'tty')
log.info('Domain ID %d has tty %s' % (domid, str(tty)))
return tty
@@ -114,8 +194,10 @@
child's PID if (success and not detach), else None. Note that
failure cannot be determined if detach is True.
"""
- #default_viewer = 'virt-viewer'
- default_viewer = 'vncviewer'
+ if guest.options.graphics_viewer == 'vnc':
+ default_viewer = 'vncviewer'
+ else:
+ default_viewer = 'virt-viewer'
domid = get_domid_from_uuid(guest.uuid)
vncport = get_vnc_port_from_domid(domid, timeout=10.0)
if vncport == None:
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/vm-install-0.3.7/src/vminstall/job.py new/vm-install-0.3.8/src/vminstall/job.py
--- old/vm-install-0.3.7/src/vminstall/job.py 2008-08-30 05:41:29.000000000 +0200
+++ new/vm-install-0.3.8/src/vminstall/job.py 2008-09-12 00:25:33.000000000 +0200
@@ -178,7 +178,7 @@
if self._options.graphics_viewer == 'sdl':
# xm automatically created a viewer, so just wait.
log.debug('Viewer is sdl')
- elif self._options.graphics_viewer == 'vnc':
+ elif self._options.graphics_viewer == 'vnc' or self._options.graphics_viewer == 'virt-viewer':
log.debug('Viewer is vnc')
try:
child = console.vnc_console(self.guest, detach=detached)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/vm-install-0.3.7/src/vminstall/options.py new/vm-install-0.3.8/src/vminstall/options.py
--- old/vm-install-0.3.7/src/vminstall/options.py 2008-08-30 05:41:29.000000000 +0200
+++ new/vm-install-0.3.8/src/vminstall/options.py 2008-09-12 00:25:33.000000000 +0200
@@ -36,7 +36,7 @@
'extra_args', # User's install or boot args
'full_virt',
'graphics', # 'cirrus', 'none', 'para', 'vesa'
- 'graphics_viewer', # 'text', 'sdl', 'vnc'
+ 'graphics_viewer', # 'text', 'sdl', 'vnc', 'virt-viewer'
'initrd',
'_install_args', # install-time args calculated by OS
'install',
@@ -171,9 +171,15 @@
elif item == 'nics':
check_type(value, (list,))
nics = value
- elif item == 'on_crash' or item == 'on_poweroff' or item == 'on_reboot':
+ elif item == 'on_crash':
if value not in on_exit:
bad()
+ elif item == 'on_poweroff' or item == 'on_reboot':
+ on_exit_normal = on_exit[:]
+ on_exit_normal.pop()
+ on_exit_normal.pop()
+ if value not in on_exit_normal:
+ bad()
elif item == 'os_settings':
check_type(value, (str,))
elif item == 'os_type':
@@ -332,7 +338,12 @@
if defaults.full_virt:
defaults.loader = '/usr/lib/xen/boot/hvmloader'
else:
- defaults.loader = '/usr/lib/xen/boot/domUloader.py'
+ # Those OS'es that should continue to use domUloader
+ dl = ['oes2nw','oes2l','opensuse11','opensuse','sled10','sles10','sles9']
+ if defaults.os_type not in dl:
+ defaults.loader = '/usr/bin/pygrub'
+ else:
+ defaults.loader = '/usr/lib/xen/boot/domUloader.py'
# The command line can take a UUID, but the TUI or GUI won't let the
# user specify one. So, if one didn't exist on the command line,
@@ -363,6 +374,8 @@
if options.graphics_viewer == 'sdl':
defaults.graphics_viewer = 'sdl'
+ elif options.graphics_viewer == 'virt-viewer':
+ defaults.graphics_viewer = 'virt-viewer'
else:
defaults.graphics_viewer = 'vnc'
defaults.vnc_password = options.vnc_password or ''
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/vm-install-0.3.7/src/vminstall/VMDefaults.py new/vm-install-0.3.8/src/vminstall/VMDefaults.py
--- old/vm-install-0.3.7/src/vminstall/VMDefaults.py 2008-08-30 05:41:29.000000000 +0200
+++ new/vm-install-0.3.8/src/vminstall/VMDefaults.py 2008-09-12 00:25:33.000000000 +0200
@@ -493,5 +493,5 @@
'pxe' : PXEDefaults(),
}
-default_os_type = 'opensuse11'
+default_os_type = caps.get_os_type()
use_libvirt = False
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/vm-install-0.3.7/src/vminstall/XenGuest.py new/vm-install-0.3.8/src/vminstall/XenGuest.py
--- old/vm-install-0.3.7/src/vminstall/XenGuest.py 2008-08-30 05:41:29.000000000 +0200
+++ new/vm-install-0.3.8/src/vminstall/XenGuest.py 2008-09-12 00:25:33.000000000 +0200
@@ -208,7 +208,7 @@
if self.options.graphics == 'none':
return []
ret = ''
- if self.options.graphics_viewer == 'vnc':
+ if self.options.graphics_viewer == 'vnc' or self.options.graphics_viewer == 'virt-viewer':
ret = "= 5900:
options.append('vncdisplay=%d' % (port - 5900,))
options.append('vncunused=0')
+ viewer = 'vnc'
else:
assert(viewer == 'sdl')
options=[]
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org