This commit is contained in:
parent
b70fdcc926
commit
4263718c82
@ -1,296 +0,0 @@
|
||||
#
|
||||
# exception.py - general exception formatting and saving
|
||||
#
|
||||
# Matt Wilson <msw@redhat.com>
|
||||
# Erik Troan <ewt@redhat.com>
|
||||
# Harald Hoyer <harald@redhat.com>
|
||||
#
|
||||
# Copyright 2001, 2002 Red Hat, Inc.
|
||||
#
|
||||
# This software may be freely redistributed under the terms of the GNU
|
||||
# library public license.
|
||||
#
|
||||
# You should have received a copy of the GNU Library Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
#
|
||||
|
||||
import os, sys
|
||||
import signal
|
||||
import traceback
|
||||
import types
|
||||
from string import joinfields
|
||||
from cPickle import Pickler
|
||||
dumpHash = {}
|
||||
#from rhpl.translate import _
|
||||
def _(x):
|
||||
return x
|
||||
|
||||
|
||||
#
|
||||
# ExceptionWindow class
|
||||
#
|
||||
class ExceptionWindow:
|
||||
def __init__ (self, text, component_name):
|
||||
import gtk
|
||||
win = gtk.Dialog(_("Exception Occured"), None, gtk.DIALOG_MODAL)
|
||||
win.add_button(_("Debug"), 0)
|
||||
win.add_button(_("Save to file"), 1)
|
||||
win.add_button(gtk.STOCK_QUIT, 2)
|
||||
buffer = gtk.TextBuffer(None)
|
||||
buffer.set_text(text)
|
||||
textbox = gtk.TextView()
|
||||
textbox.set_buffer(buffer)
|
||||
textbox.set_property("editable", gtk.FALSE)
|
||||
textbox.set_property("cursor_visible", gtk.FALSE)
|
||||
sw = gtk.ScrolledWindow ()
|
||||
sw.add (textbox)
|
||||
sw.set_policy (gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
|
||||
hbox = gtk.HBox (gtk.FALSE)
|
||||
hbox.set_border_width(5)
|
||||
txt = _("An unhandled exception has occured. This "
|
||||
"is most likely a bug. Please save the crash "
|
||||
"dump and file a detailed bug "
|
||||
"report against %s at "
|
||||
"https://bugzilla.redhat.com/bugzilla") % \
|
||||
component_name
|
||||
info = gtk.Label(txt)
|
||||
info.set_line_wrap(gtk.TRUE)
|
||||
hbox.pack_start (sw, gtk.TRUE)
|
||||
win.vbox.pack_start (info, gtk.FALSE)
|
||||
win.vbox.pack_start (hbox, gtk.TRUE)
|
||||
win.vbox.set_border_width(5)
|
||||
win.set_size_request (500, 300)
|
||||
win.set_position (gtk.WIN_POS_CENTER)
|
||||
addFrame(win)
|
||||
win.show_all ()
|
||||
self.window = win
|
||||
self.rc = self.window.run ()
|
||||
self.window.destroy()
|
||||
|
||||
def quit (self, dialog, button):
|
||||
self.rc = button
|
||||
|
||||
def getrc (self):
|
||||
# I did it this way for future expantion
|
||||
# 0 is debug
|
||||
if self.rc == 0:
|
||||
return 1
|
||||
# 1 is save
|
||||
if self.rc == 1:
|
||||
return 2
|
||||
# 2 is OK
|
||||
elif self.rc == 2:
|
||||
return 0
|
||||
|
||||
def addFrame(dialog):
|
||||
import gtk
|
||||
contents = dialog.get_children()[0]
|
||||
dialog.remove(contents)
|
||||
frame = gtk.Frame()
|
||||
frame.set_shadow_type(gtk.SHADOW_OUT)
|
||||
frame.add(contents)
|
||||
dialog.add(frame)
|
||||
|
||||
# XXX do length limits on obj dumps.
|
||||
def dumpClass(instance, fd, level=0):
|
||||
# protect from loops
|
||||
if not dumpHash.has_key(instance):
|
||||
dumpHash[instance] = None
|
||||
else:
|
||||
fd.write("Already dumped\n")
|
||||
return
|
||||
if (instance.__class__.__dict__.has_key("__str__") or
|
||||
instance.__class__.__dict__.has_key("__repr__")):
|
||||
fd.write("%s\n" % (instance,))
|
||||
return
|
||||
fd.write("%s instance, containing members:\n" %
|
||||
(instance.__class__.__name__))
|
||||
pad = ' ' * ((level) * 2)
|
||||
for key, value in instance.__dict__.items():
|
||||
if type(value) == types.ListType:
|
||||
fd.write("%s%s: [" % (pad, key))
|
||||
first = 1
|
||||
for item in value:
|
||||
if not first:
|
||||
fd.write(", ")
|
||||
else:
|
||||
first = 0
|
||||
if type(item) == types.InstanceType:
|
||||
dumpClass(item, fd, level + 1)
|
||||
else:
|
||||
fd.write("%s" % (item,))
|
||||
fd.write("]\n")
|
||||
elif type(value) == types.DictType:
|
||||
fd.write("%s%s: {" % (pad, key))
|
||||
first = 1
|
||||
for k, v in value.items():
|
||||
if not first:
|
||||
fd.write(", ")
|
||||
else:
|
||||
first = 0
|
||||
if type(k) == types.StringType:
|
||||
fd.write("'%s': " % (k,))
|
||||
else:
|
||||
fd.write("%s: " % (k,))
|
||||
if type(v) == types.InstanceType:
|
||||
dumpClass(v, fd, level + 1)
|
||||
else:
|
||||
fd.write("%s" % (v,))
|
||||
fd.write("}\n")
|
||||
elif type(value) == types.InstanceType:
|
||||
fd.write("%s%s: " % (pad, key))
|
||||
dumpClass(value, fd, level + 1)
|
||||
else:
|
||||
fd.write("%s%s: %s\n" % (pad, key, value))
|
||||
|
||||
def dumpException(out, text, tb):
|
||||
p = Pickler(out)
|
||||
|
||||
out.write(text)
|
||||
|
||||
trace = tb
|
||||
while trace.tb_next:
|
||||
trace = trace.tb_next
|
||||
frame = trace.tb_frame
|
||||
out.write ("\nLocal variables in innermost frame:\n")
|
||||
try:
|
||||
for (key, value) in frame.f_locals.items():
|
||||
out.write ("%s: %s\n" % (key, value))
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
def exceptionWindow(title, text, name):
|
||||
import gtk
|
||||
#print text
|
||||
win = ExceptionWindow (text, name)
|
||||
|
||||
return win.getrc ()
|
||||
|
||||
|
||||
def generic_error_dialog (message, parent_dialog,
|
||||
message_type=None,
|
||||
widget=None, page=0, broken_widget=None):
|
||||
import gtk
|
||||
if message_type == None:
|
||||
message_type = gtk.MESSAGE_ERROR
|
||||
|
||||
dialog = gtk.MessageDialog(parent_dialog,
|
||||
gtk.DIALOG_MODAL|gtk.DIALOG_DESTROY_WITH_PARENT,
|
||||
message_type, gtk.BUTTONS_OK,
|
||||
message)
|
||||
|
||||
if widget != None:
|
||||
if isinstance (widget, gtk.CList):
|
||||
widget.select_row (page, 0)
|
||||
elif isinstance (widget, gtk.Notebook):
|
||||
widget.set_current_page (page)
|
||||
if broken_widget != None:
|
||||
broken_widget.grab_focus ()
|
||||
if isinstance (broken_widget, gtk.Entry):
|
||||
broken_widget.select_region (0, -1)
|
||||
|
||||
if parent_dialog:
|
||||
dialog.set_position (gtk.WIN_POS_CENTER_ON_PARENT)
|
||||
dialog.set_transient_for(parent_dialog)
|
||||
else:
|
||||
dialog.set_position (gtk.WIN_POS_CENTER)
|
||||
|
||||
ret = dialog.run ()
|
||||
dialog.destroy()
|
||||
return ret
|
||||
|
||||
#
|
||||
# FileSelection class
|
||||
#
|
||||
class FileSelection:
|
||||
def __init__(self, text):
|
||||
import gtk
|
||||
import gnome.ui
|
||||
win = gtk.Dialog (_("Select a file:"))
|
||||
#win.connect ("clicked", self.quit)
|
||||
win.add_button (gtk.STOCK_OK, gtk.RESPONSE_OK)
|
||||
win.add_button (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL)
|
||||
hbox = gtk.HBox (FALSE)
|
||||
|
||||
info = gtk.Label(text)
|
||||
self.entry = gnome.ui.FileEntry("", "")
|
||||
self.entry.set_modal(TRUE)
|
||||
win.vbox.pack_start (info, FALSE)
|
||||
win.vbox.pack_start (self.entry, TRUE)
|
||||
win.set_position (gtk.WIN_POS_CENTER)
|
||||
win.show_all ()
|
||||
self.window = win
|
||||
self.rc = self.window.run ()
|
||||
|
||||
def quit (self, dialog, button):
|
||||
self.rc = button
|
||||
|
||||
def getrc (self):
|
||||
return self.rc
|
||||
|
||||
def get_filename(self):
|
||||
return self.entry.get_full_path(FALSE)
|
||||
|
||||
#
|
||||
# handleException function
|
||||
#
|
||||
def handleException((type, value, tb), progname, version):
|
||||
import gtk
|
||||
list = traceback.format_exception (type, value, tb)
|
||||
tblast = traceback.extract_tb(tb, limit=None)
|
||||
if len(tblast):
|
||||
tblast = tblast[len(tblast)-1]
|
||||
extxt = traceback.format_exception_only(type, value)
|
||||
text = "Component: %s\n" % progname
|
||||
text = text + "Version: %s\n" % version
|
||||
text = text + "Summary: TB "
|
||||
if tblast and len(tblast) > 3:
|
||||
tblast = tblast[:3]
|
||||
for t in tblast:
|
||||
text = text + str(t) + ":"
|
||||
text = text + extxt[0]
|
||||
text = text + joinfields(list, "")
|
||||
|
||||
while 1:
|
||||
rc = exceptionWindow (_("Exception Occurred"), text, progname)
|
||||
|
||||
if rc == 1 and tb:
|
||||
print text
|
||||
import pdb
|
||||
pdb.post_mortem (tb)
|
||||
os.kill(os.getpid(), signal.SIGKILL)
|
||||
elif not rc:
|
||||
sys.exit(10)
|
||||
else:
|
||||
fs = FileSelection(_("Please specify a file to save the dump"))
|
||||
rc = fs.getrc()
|
||||
if rc == gtk.RESPONSE_OK:
|
||||
file = fs.get_filename()
|
||||
print file
|
||||
fs.window.destroy()
|
||||
|
||||
if not file or file=="":
|
||||
file = "/tmp/dump"
|
||||
|
||||
try:
|
||||
out = open(file, "w")
|
||||
dumpException (out, text, tb)
|
||||
out.close()
|
||||
|
||||
except IOError:
|
||||
generic_error_dialog(_("Failed to write to file %s.") \
|
||||
% (file), None)
|
||||
else:
|
||||
generic_error_dialog(
|
||||
_("The application's state has been successfully\n"
|
||||
"written to the file '%s'.") % (file), None,
|
||||
message_type = "info")
|
||||
sys.exit(10)
|
||||
|
||||
else:
|
||||
continue
|
||||
|
||||
sys.exit(10)
|
||||
|
3
virt-manager-0.5.3.tar.gz
Normal file
3
virt-manager-0.5.3.tar.gz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6ad1afc9b6fcf69d1d19d02091d59524974dcb77636857f339a17f9e108b2f9e
|
||||
size 1844922
|
@ -1,47 +1,71 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Dec 12 12:18:58 MST 2007 - dpmerrill@novell.com
|
||||
Sun Feb 3 14:13:14 MST 2008 - dpmerrill@novell.com
|
||||
|
||||
- #344490: Fix path in xenstore call (virtman-edit.diff)
|
||||
- Added virtman-xen-uri.diff to fix problem starting vnc.
|
||||
- virtman was getting confused between "xen" and "xen:///" uris.
|
||||
- bnc#358397
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Aug 16 09:26:23 MDT 2007 - ccoffing@novell.com
|
||||
Sat Feb 2 02:02:30 MST 2008 - dpmerrill@novell.com
|
||||
|
||||
- #300789: Could not add or change disks
|
||||
- Drop unused patch
|
||||
- Added virtman-dbus-query.diff to work around a hal/dbus
|
||||
- bug that crashes on QueryCapabilities()
|
||||
- bnc#358324
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Aug 3 10:46:58 MDT 2007 - chuck@novell.com
|
||||
Thu Jan 31 10:27:51 MST 2008 - dpmerrill@novell.com
|
||||
|
||||
- Added virtinst to finish resolving run-time dependencies
|
||||
- bnc#355826
|
||||
- bnc#356999
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Jan 23 14:13:42 MST 2008 - dpmerrill@novell.com
|
||||
|
||||
- Changed package requirements in spec file Requires section.
|
||||
- pygtk2 -> python-gtk
|
||||
- gnome-python2-gconf -> python-gnome
|
||||
- dbus-python -> dbus-1-python
|
||||
- gnome-python2-gnomekeyring -> removed
|
||||
- gnome-python2-gnomevfs -> removed
|
||||
- python-virtinst -> removed
|
||||
- pygtk2-libglade -> removed
|
||||
- gtk-vnc-python -> python-gtk-vnc
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Jan 19 15:53:27 MST 2008 - dpmerrill@novell.com
|
||||
|
||||
- Added new virt-manager version (0.5.3) to sle10-sp2-i386
|
||||
- (FATE Feature #302140)
|
||||
-------------------------------------------------------------------
|
||||
Thu Aug 16 16:24:39 MDT 2007 - ccoffing@novell.com
|
||||
|
||||
- Update virt-manager to match vm-install changes due to #279153.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Jul 9 13:19:09 MDT 2007 - ccoffing@novell.com
|
||||
|
||||
- Update to changeset 544.
|
||||
- Properly attach and detach CDs to running VM. (#289393)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Jul 2 11:11:50 MDT 2007 - ccoffing@novell.com
|
||||
Wed May 9 15:40:00 MDT 2007 - ccoffing@novell.com
|
||||
|
||||
- Update to changeset 508.
|
||||
- Include virtinst, to support virtual device add/remove.
|
||||
- Update .desktop with proper group. (#258600)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed May 23 14:13:36 MDT 2007 - ccoffing@novell.com
|
||||
Fri May 4 11:54:18 MDT 2007 - ccoffing@novell.com
|
||||
|
||||
- Could not delete VM through menu. (#272013)
|
||||
- Fix syntax error ("NOne" should be "None"), which caused
|
||||
unnecessary VNC connection failures in virt-manager. (#237406)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue May 22 17:03:20 MDT 2007 - ccoffing@novell.com
|
||||
Wed May 2 09:24:21 MDT 2007 - ccoffing@novell.com
|
||||
|
||||
- Fix desktop file.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu May 3 14:50:03 MDT 2007 - ccoffing@novell.com
|
||||
|
||||
- Fix syntax error, which could result in unnecessary VNC
|
||||
connection failures. (#237406)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Apr 27 13:20:07 MDT 2007 - ccoffing@novell.com
|
||||
|
||||
- Update to 0.4.0.
|
||||
- Clean up spec file.
|
||||
- Drop virtman-xenstored-thrashing.diff, to change the default
|
||||
refresh rate from 5 seconds back to 1 second. It is more
|
||||
important to have up-to-date knowledge of VMs (to ensure consoles
|
||||
can be opened, etc) rather than trying to lessen virt-manager's
|
||||
processor load. (#270761)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Apr 10 14:19:36 MDT 2007 - ccoffing@novell.com
|
||||
@ -56,11 +80,6 @@ Tue Apr 10 14:19:36 MDT 2007 - ccoffing@novell.com
|
||||
noted in bug #261110.
|
||||
- Fix attaching disks to running VM. (#238986)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Apr 2 01:56:33 CEST 2007 - ro@suse.de
|
||||
|
||||
- updated gconf scriptlets
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Mar 28 11:37:48 MDT 2007 - ccoffing@novell.com
|
||||
|
||||
|
@ -1,47 +1,87 @@
|
||||
#
|
||||
# spec file for package virt-manager (Version 0.4.0)
|
||||
# spec file for package virt-manager (Version 0.5.3)
|
||||
#
|
||||
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
# This file and all modifications and additions to the pristine
|
||||
# package are under the same license as the package itself.
|
||||
#
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
# norootforbuild
|
||||
|
||||
Name: virt-manager
|
||||
Url: http://virt-manager.et.redhat.com
|
||||
BuildRequires: autoconf automake gconf2 gettext gtk2-devel intltool python-devel python-gobject2-devel python-gtk-devel scrollkeeper update-desktop-files
|
||||
# Only for directory ownership:
|
||||
BuildRequires: libgnome yast2
|
||||
License: GPL v2 or later
|
||||
Group: System/Monitoring
|
||||
AutoReqProv: yes
|
||||
Version: 0.4.0
|
||||
Release: 97
|
||||
%define _extra_release %{?dist:%{dist}}%{!?dist:%{?extra_release:%{extra_release}}}
|
||||
%define gsysconfdir /etc/opt/gnome
|
||||
%define gconftool /opt/gnome/bin/gconftool-2
|
||||
%define virtinst_maj 0
|
||||
%define virtinst_min 300
|
||||
%define virtinst_rel 2
|
||||
%define virtinst_name virtinst-%{virtinst_maj}.%{virtinst_min}.%{virtinst_rel}
|
||||
Version: 0.5.3
|
||||
Release: 1
|
||||
Summary: Virtual Machine Manager
|
||||
Source0: virt-manager.tar.bz2
|
||||
Source1: virtinst.tar.bz2
|
||||
Source2: rhpl-exception.py
|
||||
Patch10: virtman-desktop.diff
|
||||
Patch11: virtman-type-register.diff
|
||||
Patch12: virtman-console-keys.diff
|
||||
Patch13: virtman-detach-yast.diff
|
||||
Patch14: virtman-install.diff
|
||||
Patch15: virtman-edit.diff
|
||||
Group: System/Monitoring
|
||||
License: GPL v2 or later
|
||||
Url: http://virt-manager.et.redhat.com
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
ExclusiveArch: %ix86 x86_64
|
||||
ExclusiveArch: %{ix86} x86_64 ia64
|
||||
Source0: virt-manager-%{version}.tar.gz
|
||||
Source1: %{virtinst_name}.tar.gz
|
||||
Patch0: virtman-desktop.diff
|
||||
Patch1: virtman-dbus-query.diff
|
||||
Patch2: virtman-xen-uri.diff
|
||||
# These two are just the oldest version tested
|
||||
# Requires: pygtk2 >= 1.99.12-6
|
||||
Requires: python-gtk
|
||||
# Requires: gnome-python2-gconf >= 1.99.11-7
|
||||
Requires: python-gnome
|
||||
Requires: libvirt-python >= 0.1.4-3
|
||||
# Absolutely require this version or newer
|
||||
Requires: libvirt-python >= 0.3.0-1
|
||||
# Definitely does not work with earlier due to python API changes
|
||||
# Requires: dbus-python >= 0.61
|
||||
Requires: dbus-1-python
|
||||
Requires: libxml2-python
|
||||
# Might work with earlier, but this is what we've tested
|
||||
#Requires: gnome-keyring >= 0.4.9
|
||||
Requires: gnome-keyring
|
||||
# Minimum we've tested with
|
||||
# Although if you don't have this, comment it out and the app
|
||||
# will work just fine - keyring functionality will simply be
|
||||
# disabled
|
||||
# Requires: gnome-python2-gnomekeyring >= 2.15.4
|
||||
# Requires: gnome-python2-gnomevfs >= 2.15.4
|
||||
# Minimum we've tested with
|
||||
Requires: libxml2-python >= 2.6.23
|
||||
# Required to install Xen & QEMU guests
|
||||
# Requires: python-virtinst >= 0.300.2
|
||||
# Required for loading the glade UI
|
||||
# Requires: pygtk2-libglade
|
||||
# Required for our graphics which are currently SVG format
|
||||
Requires: librsvg2
|
||||
# Earlier vte had broken python binding module
|
||||
# Requires: vte >= 0.12.2
|
||||
Requires: vte
|
||||
Requires: librsvg
|
||||
Requires: vm-install
|
||||
Requires: gconf2
|
||||
%gconf_schemas_prereq
|
||||
# For online help
|
||||
Requires: scrollkeeper
|
||||
# For console widget
|
||||
# Requires: gtk-vnc-python
|
||||
Requires: python-gtk-vnc
|
||||
BuildRequires: gtk2-devel
|
||||
BuildRequires: python-devel
|
||||
BuildRequires: gettext
|
||||
BuildRequires: scrollkeeper
|
||||
BuildRequires: intltool
|
||||
BuildRequires: python-gtk
|
||||
BuildRequires: gconf2
|
||||
BuildRequires: desktop-file-utils
|
||||
BuildRequires: update-desktop-files
|
||||
# virtinst BuildRequires
|
||||
BuildRequires: libxml2-python
|
||||
BuildRequires: python-urlgrabber
|
||||
BuildRequires: libvirt-python
|
||||
Requires(pre): gconf2
|
||||
Requires(post): gconf2,desktop-file-utils
|
||||
Requires(postun): desktop-file-utils
|
||||
Requires(preun): gconf2
|
||||
|
||||
%description
|
||||
Virtual Machine Manager provides a graphical tool for administering
|
||||
@ -56,87 +96,135 @@ Authors:
|
||||
Jeremy Katz <katzj@redhat.com>
|
||||
|
||||
%prep
|
||||
%setup -q -n virt-manager--devel
|
||||
%setup -D -T -b 1 -n virt-manager--devel
|
||||
%patch10 -p1
|
||||
%patch11 -p1
|
||||
%patch12 -p1
|
||||
%patch13 -p1
|
||||
%patch14 -p1
|
||||
%patch15 -p1
|
||||
%setup -q
|
||||
%setup -b 1
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
|
||||
%build
|
||||
intltoolize
|
||||
autoreconf -if
|
||||
%configure
|
||||
make
|
||||
# autoreconf -i
|
||||
%configure --sysconfdir=%{gsysconfdir}
|
||||
make %{?_smp_mflags}
|
||||
cd $RPM_BUILD_DIR/%{virtinst_name}
|
||||
python setup.py build
|
||||
python setup.py install
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
make install DESTDIR=$RPM_BUILD_ROOT
|
||||
make install DESTDIR=$RPM_BUILD_ROOT
|
||||
mkdir $RPM_BUILD_ROOT%{_datadir}/virt-manager/virtinst/
|
||||
install -m644 ../virtinst--devel/virtinst/*.py $RPM_BUILD_ROOT%{_datadir}/virt-manager/virtinst/
|
||||
install -m644 %SOURCE2 $RPM_BUILD_ROOT%{_datadir}/virt-manager/exception.py
|
||||
rm -f $RPM_BUILD_ROOT%{_libdir}/virt-manager/sparkline.{a,la}
|
||||
%find_gconf_schemas
|
||||
install -m644 ../%{virtinst_name}/virtinst/*.py $RPM_BUILD_ROOT%{_datadir}/virt-manager/virtinst/
|
||||
# install -m644 ../virtinst-0.300.2/virtinst/*.py $RPM_BUILD_ROOT%{_datadir}/virt-manager/virtinst/
|
||||
rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/sparkline.a
|
||||
rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/sparkline.la
|
||||
# Unsupport languages:
|
||||
rm -rf $RPM_BUILD_ROOT/usr/share/locale/or
|
||||
%find_lang %{name}
|
||||
cat %{name}.schemas_list %{name}.lang >%{name}.lst
|
||||
%suse_update_desktop_file -r %{name} X-SuSE-YaST X-SuSE-YaST-Virtualization
|
||||
%suse_update_desktop_file %{name} X-SuSE-YaST-Virtualization
|
||||
sed -i -e 's/Categories=.*/Categories=Qt;X-SuSE-YaST;X-SuSE-YaST-Virtualization;/' $RPM_BUILD_ROOT/%{_datadir}/applications/YaST2/%{name}.desktop
|
||||
# Nuking these because old version didnt have any
|
||||
rm -rf $RPM_BUILD_ROOT/usr/share/gnome
|
||||
# Also fixing the %{name}.lang file forcibly.
|
||||
sed -i '\^/usr/share/gnome/help/^d' %{name}.lang
|
||||
|
||||
%clean
|
||||
test ! -z "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" && rm -rf $RPM_BUILD_ROOT
|
||||
# rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%pre -f %{name}.schemas_pre
|
||||
%pre
|
||||
if [ "$1" -gt 1 ]; then
|
||||
export GCONF_CONFIG_SOURCE=`%{gconftool} --get-default-source`
|
||||
%{gconftool} --makefile-uninstall-rule \
|
||||
%{gsysconfdir}/gconf/schemas/%{name}.schemas > /dev/null || :
|
||||
fi
|
||||
|
||||
%preun -f %{name}.schemas_preun
|
||||
%posttrans -f %{name}.schemas_posttrans
|
||||
%post
|
||||
export GCONF_CONFIG_SOURCE=`%{gconftool} --get-default-source`
|
||||
%{gconftool} --makefile-install-rule \
|
||||
%{gsysconfdir}/gconf/schemas/%{name}.schemas > /dev/null || :
|
||||
|
||||
%files -f %{name}.lst
|
||||
%preun
|
||||
if [ "$1" -eq 0 ]; then
|
||||
export GCONF_CONFIG_SOURCE=`%{gconftool} --get-default-source`
|
||||
%{gconftool} --makefile-uninstall-rule \
|
||||
%{gsysconfdir}/gconf/schemas/%{name}.schemas > /dev/null || :
|
||||
fi
|
||||
|
||||
%files -f %{name}.lang
|
||||
%defattr(-,root,root,-)
|
||||
%doc COPYING AUTHORS ChangeLog
|
||||
%{_bindir}/virt-manager
|
||||
%{_libexecdir}/virt-manager-launch
|
||||
%{_libdir}/virt-manager/
|
||||
%dir %{_datadir}/virt-manager
|
||||
%{_datadir}/omf/virt-manager/
|
||||
%{_datadir}/virt-manager/*.glade
|
||||
%dir %{_datadir}/virt-manager/pixmaps
|
||||
%{_datadir}/virt-manager/pixmaps/*.png
|
||||
%{_datadir}/virt-manager/pixmaps/*.svg
|
||||
%{_datadir}/virt-manager/*.py
|
||||
%dir %{_datadir}/virt-manager/virtManager
|
||||
%{_datadir}/virt-manager/virtManager/*.py
|
||||
%dir %{_datadir}/virt-manager/virtinst
|
||||
%{_datadir}/virt-manager/virtinst/*.py
|
||||
%dir %{_datadir}/virt-manager/vncViewer
|
||||
%{_datadir}/virt-manager/vncViewer/*.py
|
||||
%{_datadir}/applications/YaST2/virt-manager.desktop
|
||||
%{_datadir}/dbus-1/services/virt-manager.service
|
||||
%{_mandir}/man1/virt-manager.1*
|
||||
# %dir %attr(775,root,root) /etc/gconf
|
||||
# %dir %attr(775,root,root) /etc/gconf/schemas
|
||||
%{gsysconfdir}/gconf/schemas/%{name}.schemas
|
||||
%{_bindir}/%{name}
|
||||
%{_libexecdir}/%{name}-launch
|
||||
%{_libdir}/%{name}
|
||||
%dir %{_datadir}/%{name}
|
||||
%{_datadir}/%{name}/*.glade
|
||||
%dir %{_datadir}/%{name}/pixmaps
|
||||
%{_datadir}/%{name}/pixmaps/*.png
|
||||
%{_datadir}/%{name}/pixmaps/*.svg
|
||||
%{_datadir}/%{name}/*.py
|
||||
%dir %{_datadir}/%{name}/virtManager
|
||||
%{_datadir}/%{name}/virtManager/*.py
|
||||
%dir %{_datadir}/%{name}/virtinst
|
||||
%{_datadir}/%{name}/virtinst/*.py
|
||||
# %dir %attr(775,root,root) %{_datadir}/locale/or
|
||||
# %dir %attr(775,root,root) %{_datadir}/locale/or/LC_MESSAGES
|
||||
# %{_datadir}/locale/or/LC_MESSAGES/*
|
||||
%{_datadir}/omf/%{name}
|
||||
# %dir %attr(775,root,root) %{_datadir}/gnome
|
||||
# %{_datadir}/gnome/help
|
||||
%{_datadir}/applications/YaST2/%{name}.desktop
|
||||
%{_datadir}/dbus-1/services/%{name}.service
|
||||
%{_datadir}/man/man1/%{name}.1*
|
||||
# FIXME: autobuild complains that these are unowned (not true...)
|
||||
%dir %{_datadir}/dbus-1
|
||||
%dir %{_datadir}/dbus-1/services
|
||||
%dir %{_datadir}/applications/YaST2
|
||||
|
||||
%changelog
|
||||
* Wed Dec 12 2007 - dpmerrill@novell.com
|
||||
- #344490: Fix path in xenstore call (virtman-edit.diff)
|
||||
* Thu Aug 16 2007 - ccoffing@novell.com
|
||||
- #300789: Could not add or change disks
|
||||
- Drop unused patch
|
||||
* Fri Aug 03 2007 - chuck@novell.com
|
||||
- Update to changeset 544.
|
||||
* Sun Feb 03 2008 dpmerrill@novell.com
|
||||
- Added virtman-xen-uri.diff to fix problem starting vnc.
|
||||
- virtman was getting confused between "xen" and "xen:///" uris.
|
||||
- bnc#358397
|
||||
* Sat Feb 02 2008 dpmerrill@novell.com
|
||||
- Added virtman-dbus-query.diff to work around a hal/dbus
|
||||
- bug that crashes on QueryCapabilities()
|
||||
- bnc#358324
|
||||
* Thu Jan 31 2008 dpmerrill@novell.com
|
||||
- Added virtinst to finish resolving run-time dependencies
|
||||
- bnc#355826
|
||||
- bnc#356999
|
||||
* Wed Jan 23 2008 dpmerrill@novell.com
|
||||
- Changed package requirements in spec file Requires section.
|
||||
- pygtk2 -> python-gtk
|
||||
- gnome-python2-gconf -> python-gnome
|
||||
- dbus-python -> dbus-1-python
|
||||
- gnome-python2-gnomekeyring -> removed
|
||||
- gnome-python2-gnomevfs -> removed
|
||||
- python-virtinst -> removed
|
||||
- pygtk2-libglade -> removed
|
||||
- gtk-vnc-python -> python-gtk-vnc
|
||||
* Sat Jan 19 2008 dpmerrill@novell.com
|
||||
- Added new virt-manager version (0.5.3) to sle10-sp2-i386
|
||||
- (FATE Feature #302140)
|
||||
* Thu Aug 16 2007 ccoffing@novell.com
|
||||
- Update virt-manager to match vm-install changes due to #279153.
|
||||
* Mon Jul 09 2007 ccoffing@novell.com
|
||||
- Properly attach and detach CDs to running VM. (#289393)
|
||||
* Mon Jul 02 2007 - ccoffing@novell.com
|
||||
- Update to changeset 508.
|
||||
- Include virtinst, to support virtual device add/remove.
|
||||
* Wed May 23 2007 - ccoffing@novell.com
|
||||
- Could not delete VM through menu. (#272013)
|
||||
* Tue May 22 2007 - ccoffing@novell.com
|
||||
- Fix desktop file.
|
||||
* Thu May 03 2007 - ccoffing@novell.com
|
||||
- Fix syntax error, which could result in unnecessary VNC
|
||||
connection failures. (#237406)
|
||||
* Fri Apr 27 2007 - ccoffing@novell.com
|
||||
- Update to 0.4.0.
|
||||
- Clean up spec file.
|
||||
* Tue Apr 10 2007 - ccoffing@novell.com
|
||||
* Wed May 09 2007 ccoffing@novell.com
|
||||
- Update .desktop with proper group. (#258600)
|
||||
* Fri May 04 2007 ccoffing@novell.com
|
||||
- Fix syntax error ("NOne" should be "None"), which caused
|
||||
unnecessary VNC connection failures in virt-manager. (#237406)
|
||||
* Wed May 02 2007 ccoffing@novell.com
|
||||
- Drop virtman-xenstored-thrashing.diff, to change the default
|
||||
refresh rate from 5 seconds back to 1 second. It is more
|
||||
important to have up-to-date knowledge of VMs (to ensure consoles
|
||||
can be opened, etc) rather than trying to lessen virt-manager's
|
||||
processor load. (#270761)
|
||||
* Tue Apr 10 2007 ccoffing@novell.com
|
||||
- Remove code that (incorrectly) guesses the vnc port. (#259692)
|
||||
- Do not refresh GUI every second (which causes xenstored to not
|
||||
thrash so badly, which makes virt-manager more responsive and
|
||||
@ -146,34 +234,32 @@ test ! -z "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" && rm -rf $RPM_BUILD_ROO
|
||||
- Revert patch for bug #244772, because it causes lockups, as
|
||||
noted in bug #261110.
|
||||
- Fix attaching disks to running VM. (#238986)
|
||||
* Mon Apr 02 2007 - ro@suse.de
|
||||
- updated gconf scriptlets
|
||||
* Wed Mar 28 2007 - ccoffing@novell.com
|
||||
* Wed Mar 28 2007 ccoffing@novell.com
|
||||
- Update icon filename.
|
||||
* Tue Mar 13 2007 - ccoffing@novell.com
|
||||
* Tue Mar 13 2007 ccoffing@novell.com
|
||||
- Import threading and timer tick patches from upstream to improve
|
||||
stability. (#237406 and others)
|
||||
- Do not offer QEMU option. (#254083)
|
||||
* Mon Mar 12 2007 - ccoffing@novell.com
|
||||
* Mon Mar 12 2007 ccoffing@novell.com
|
||||
- Update virt-manager to match changes in vm-install's disk class,
|
||||
due to bug #247849.
|
||||
* Fri Mar 09 2007 - ccoffing@novell.com
|
||||
* Fri Mar 09 2007 ccoffing@novell.com
|
||||
- Make Ctrl+Alt release the mouse cursor (#252998).
|
||||
* Thu Mar 08 2007 - ccoffing@novell.com
|
||||
* Thu Mar 08 2007 ccoffing@novell.com
|
||||
- Add release to "Requires: xen-tools", to prevent mixing with
|
||||
pre-beta 5. (#238986, #252495)
|
||||
* Fri Mar 02 2007 - ccoffing@novell.com
|
||||
* Fri Mar 02 2007 ccoffing@novell.com
|
||||
- Disable gtk-menu-bar-accel when VM has focus, to allow VM to get
|
||||
F10 key. (#240001)
|
||||
* Tue Feb 27 2007 - ccoffing@novell.com
|
||||
* Tue Feb 27 2007 ccoffing@novell.com
|
||||
- Update to 0.3.1.
|
||||
- "Requires: librsvg" (#250156)
|
||||
- Re-use vm-install's disk UI, to allow disks to be added/removed
|
||||
from xend-managed VMs (currently only for running VMs). (#238986)
|
||||
* Thu Feb 22 2007 - ccoffing@novell.com
|
||||
* Thu Feb 22 2007 ccoffing@novell.com
|
||||
- If Xen isn't running, put up error window instead of raising.
|
||||
(#244772)
|
||||
* Tue Feb 13 2007 - ccoffing@novell.com
|
||||
* Tue Feb 13 2007 ccoffing@novell.com
|
||||
- Update to latest hg; grabs mouse for better mouse tracking.
|
||||
(#240387)
|
||||
- Don't lose mouse grab on every keystroke
|
||||
@ -182,24 +268,24 @@ test ! -z "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" && rm -rf $RPM_BUILD_ROO
|
||||
- Fix syntax to avoid deprecation warnings (don't raise strings).
|
||||
- YaST integration: default to managing on-box; detach from yast
|
||||
control center.
|
||||
* Mon Jan 29 2007 - ccoffing@novell.com
|
||||
* Mon Jan 29 2007 ccoffing@novell.com
|
||||
- Fix desktop file. (#239275)
|
||||
- Update to 0.3.0 (updated translations; no code changes)
|
||||
* Mon Jan 22 2007 - ccoffing@novell.com
|
||||
* Mon Jan 22 2007 ccoffing@novell.com
|
||||
- Fix desktop file, so icon shows in YaST. (#237046)
|
||||
- Clean up macros in spec file.
|
||||
* Fri Jan 19 2007 - ccoffing@novell.com
|
||||
* Fri Jan 19 2007 ccoffing@novell.com
|
||||
- Use temporary icon until real ones arrive.
|
||||
- Update to changeset 371 to fix VNC issues.
|
||||
* Wed Jan 17 2007 - ccoffing@novell.com
|
||||
* Wed Jan 17 2007 ccoffing@novell.com
|
||||
- Fix BuildRequires and paths to work with both SLES10 and STABLE.
|
||||
* Fri Jan 12 2007 - ccoffing@novell.com
|
||||
* Fri Jan 12 2007 ccoffing@novell.com
|
||||
- Fix sysconfdir path.
|
||||
- Add desktop file.
|
||||
* Thu Jan 11 2007 - ccoffing@novell.com
|
||||
* Thu Jan 11 2007 ccoffing@novell.com
|
||||
- Add to SLES 10 SP1 (fate #301181)
|
||||
- Update to virt-manager 0.2.6.
|
||||
- Fix type_register deprecation warnings.
|
||||
* Tue Oct 24 2006 - ccoffing@novell.com
|
||||
* Tue Oct 24 2006 ccoffing@novell.com
|
||||
- Initial package.
|
||||
- Replace virt-inst with xen-vm-install (part of xen-tools-install)
|
||||
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:eed79ad6c7e0d07b058686b863a1b203409e1c749565ca5e5e605060aac240eb
|
||||
size 972359
|
3
virtinst-0.300.2.tar.gz
Normal file
3
virtinst-0.300.2.tar.gz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:b78f73136ae94a9b616c7fa3988bd3d6266a4fff11904036b8ec330f69c6231b
|
||||
size 124659
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:589a032edce8c8e10333b5fd41b4f5b15c4c531597a42243d6d33278f5ea5ea8
|
||||
size 78645
|
@ -1,64 +0,0 @@
|
||||
Index: virt-manager--devel/src/virtManager/console.py
|
||||
===================================================================
|
||||
--- virt-manager--devel.orig/src/virtManager/console.py
|
||||
+++ virt-manager--devel/src/virtManager/console.py
|
||||
@@ -49,6 +49,8 @@ class vmmConsole(gobject.GObject):
|
||||
self.vm = vm
|
||||
|
||||
topwin = self.window.get_widget("vmm-console")
|
||||
+ sens = (self.window.get_widget("menubar2"),
|
||||
+ self.window.get_widget("console-toolbar"))
|
||||
topwin.hide()
|
||||
self.title = vm.get_name() + " " + topwin.get_title()
|
||||
topwin.set_title(self.title)
|
||||
@@ -56,9 +58,9 @@ class vmmConsole(gobject.GObject):
|
||||
self.window.get_widget("control-shutdown").get_icon_widget().set_from_file(config.get_icon_dir() + "/icon_shutdown.png")
|
||||
|
||||
if self.config.get_console_keygrab() == 2:
|
||||
- self.vncViewer = GRFBViewer(topwin, autograbkey=True)
|
||||
+ self.vncViewer = GRFBViewer(topwin, sens, autograbkey=True)
|
||||
else:
|
||||
- self.vncViewer = GRFBViewer(topwin, autograbkey=False)
|
||||
+ self.vncViewer = GRFBViewer(topwin, sens, autograbkey=False)
|
||||
self.vncViewer.connect("pointer-grabbed", self.notify_grabbed)
|
||||
self.vncViewer.connect("pointer-ungrabbed", self.notify_ungrabbed)
|
||||
|
||||
Index: virt-manager--devel/src/vncViewer/vnc.py
|
||||
===================================================================
|
||||
--- virt-manager--devel.orig/src/vncViewer/vnc.py
|
||||
+++ virt-manager--devel/src/vncViewer/vnc.py
|
||||
@@ -190,7 +190,7 @@ class GRFBViewer(gtk.DrawingArea):
|
||||
"keyboard-ungrabbed": (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, []),
|
||||
}
|
||||
|
||||
- def __init__(self, topwin, autograbkey=False):
|
||||
+ def __init__(self, topwin, sens, autograbkey=False):
|
||||
gtk.DrawingArea.__init__(self)
|
||||
|
||||
self.fb = GRFBFrameBuffer(self)
|
||||
@@ -200,6 +200,7 @@ class GRFBViewer(gtk.DrawingArea):
|
||||
self.autograbkey = autograbkey
|
||||
self.autograbptr = True
|
||||
self.topwin = topwin
|
||||
+ self.sens = sens
|
||||
self.accel_groups = gtk.accel_groups_from_object(topwin)
|
||||
self.preferred_encoding = (rfb.ENCODING_RAW, rfb.ENCODING_DESKTOP_RESIZE)
|
||||
# Current impl of draw_solid is *far* too slow to be practical
|
||||
@@ -458,6 +459,8 @@ class GRFBViewer(gtk.DrawingArea):
|
||||
gtk.gdk.keyboard_grab(self.window, False, long(0))
|
||||
for g in self.accel_groups:
|
||||
self.topwin.remove_accel_group(g)
|
||||
+ for w in self.sens:
|
||||
+ w.set_sensitive(False)
|
||||
self.gtk_settings = gtk.settings_get_default()
|
||||
self.gtk_settings_accel = self.gtk_settings.get_property('gtk-menu-bar-accel')
|
||||
self.gtk_settings.set_property('gtk-menu-bar-accel', None)
|
||||
@@ -468,6 +471,8 @@ class GRFBViewer(gtk.DrawingArea):
|
||||
gtk.gdk.keyboard_ungrab()
|
||||
for g in self.accel_groups:
|
||||
self.topwin.add_accel_group(g)
|
||||
+ for w in self.sens:
|
||||
+ w.set_sensitive(True)
|
||||
self.gtk_settings.set_property('gtk-menu-bar-accel', self.gtk_settings_accel)
|
||||
self.grabbedKeyboard = False
|
||||
self.emit("keyboard-ungrabbed")
|
63
virtman-dbus-query.diff
Normal file
63
virtman-dbus-query.diff
Normal file
@ -0,0 +1,63 @@
|
||||
Index: virt-manager-0.5.3/src/virtManager/connection.py
|
||||
===================================================================
|
||||
--- virt-manager-0.5.3.orig/src/virtManager/connection.py 2008-01-10 18:17:51.000000000 -0700
|
||||
+++ virt-manager-0.5.3/src/virtManager/connection.py 2008-02-02 00:44:16.000000000 -0700
|
||||
@@ -136,6 +136,18 @@
|
||||
|
||||
self.detect_network_devices()
|
||||
|
||||
+ # A bug in hal prevents us from calling QueryCapability on devices
|
||||
+ # this is a temporary workaround that can be removed when we get
|
||||
+ # a newer hald/hald_dbus.c
|
||||
+ def _query_capability(self, device_interface, str_capability):
|
||||
+ if not device_interface.PropertyExists('info.capabilities'):
|
||||
+ return False
|
||||
+ cap_set = set(device_interface.GetProperty('info.capabilities'))
|
||||
+ if str_capability in cap_set:
|
||||
+ return True
|
||||
+ return False
|
||||
+
|
||||
+
|
||||
def detect_network_devices(self):
|
||||
try:
|
||||
# Get a connection to the SYSTEM bus
|
||||
@@ -161,7 +173,7 @@
|
||||
|
||||
def _device_added(self, path):
|
||||
obj = self.bus.get_object("org.freedesktop.Hal", path)
|
||||
- if obj.QueryCapability("net"):
|
||||
+ if self._query_capability(obj,"net"):
|
||||
name = obj.GetPropertyString("net.interface")
|
||||
mac = obj.GetPropertyString("net.address")
|
||||
|
||||
Index: virt-manager-0.5.3/src/virtManager/opticalhelper.py
|
||||
===================================================================
|
||||
--- virt-manager-0.5.3.orig/src/virtManager/opticalhelper.py 2008-01-10 18:17:51.000000000 -0700
|
||||
+++ virt-manager-0.5.3/src/virtManager/opticalhelper.py 2008-02-02 00:44:40.000000000 -0700
|
||||
@@ -41,6 +41,17 @@
|
||||
self.hal_iface = None
|
||||
raise
|
||||
|
||||
+ # A bug in hal prevents us from calling QueryCapability on devices
|
||||
+ # this is a temporary workaround that can be removed when we get
|
||||
+ # a newer hald/hald_dbus.c
|
||||
+ def _query_capability(self, device_interface, str_capability):
|
||||
+ if not device_interface.PropertyExists('info.capabilities'):
|
||||
+ return False
|
||||
+ cap_set = set(device_interface.GetProperty('info.capabilities'))
|
||||
+ if str_capability in cap_set:
|
||||
+ return True
|
||||
+ return False
|
||||
+
|
||||
def populate_opt_media(self):
|
||||
# get a list of optical devices with data discs in, for FV installs
|
||||
vollabel = {}
|
||||
@@ -71,7 +82,7 @@
|
||||
|
||||
def _device_added(self, path):
|
||||
vol = self.bus.get_object("org.freedesktop.Hal", path)
|
||||
- if vol.QueryCapability("volume"):
|
||||
+ if self._query_capability(vol,"volume"):
|
||||
if vol.GetPropertyBoolean("volume.is_disc") and \
|
||||
vol.GetPropertyBoolean("volume.disc.has_data"):
|
||||
devnode = vol.GetProperty("block.device")
|
@ -1,9 +1,23 @@
|
||||
Index: virt-manager--devel/src/virt-manager.desktop.in.in
|
||||
Index: virt-manager-0.5.3/src/Makefile.am
|
||||
===================================================================
|
||||
--- virt-manager--devel.orig/src/virt-manager.desktop.in.in
|
||||
+++ virt-manager--devel/src/virt-manager.desktop.in.in
|
||||
@@ -1,9 +1,15 @@
|
||||
--- virt-manager-0.5.3.orig/src/Makefile.am 2008-01-10 18:17:51.000000000 -0700
|
||||
+++ virt-manager-0.5.3/src/Makefile.am 2008-01-18 15:38:21.000000000 -0700
|
||||
@@ -14,7 +14,7 @@
|
||||
gladedir = $(pkgdatadir)
|
||||
glade_DATA = $(wildcard $(srcdir)/*.glade)
|
||||
|
||||
-desktopdir = $(datadir)/applications
|
||||
+desktopdir = $(datadir)/applications/YaST2/
|
||||
desktop_SOURCES = $(PACKAGE).desktop.in.in
|
||||
desktop_DATA = $(PACKAGE).desktop
|
||||
|
||||
Index: virt-manager-0.5.3/src/virt-manager.desktop.in.in
|
||||
===================================================================
|
||||
--- virt-manager-0.5.3.orig/src/virt-manager.desktop.in.in 2008-01-10 18:17:51.000000000 -0700
|
||||
+++ virt-manager-0.5.3/src/virt-manager.desktop.in.in 2008-01-18 15:37:59.000000000 -0700
|
||||
@@ -1,9 +1,17 @@
|
||||
[Desktop Entry]
|
||||
+Version=1.0
|
||||
_Name=Virtual Machine Manager
|
||||
_Comment=Manage virtual machines
|
||||
-Icon=::ICONDIR::/::PACKAGE::-icon.svg
|
||||
@ -14,23 +28,24 @@ Index: virt-manager--devel/src/virt-manager.desktop.in.in
|
||||
Terminal=false
|
||||
Encoding=UTF-8
|
||||
-Categories=System;
|
||||
+Categories=Qt;X-SuSE-YaST;X-SuSE-YaST-Virtualization;
|
||||
+Categories=Qt;X-SuSE-YaST;
|
||||
+X-SuSE-YaST-Call=/usr/bin/virt-manager -- -c xen --yast
|
||||
+X-SuSE-YaST-Group=Virtualization
|
||||
+X-SuSE-YaST-Argument=
|
||||
+X-SuSE-YaST-RootOnly=true
|
||||
+X-SuSE-YaST-Geometry=
|
||||
+X-SuSE-YaST-SortKey=
|
||||
Index: virt-manager--devel/src/Makefile.am
|
||||
+X-SuSE-translate=true
|
||||
Index: virt-manager-0.5.3/src/Makefile.in
|
||||
===================================================================
|
||||
--- virt-manager--devel.orig/src/Makefile.am
|
||||
+++ virt-manager--devel/src/Makefile.am
|
||||
@@ -14,7 +14,7 @@ libexec_SCRIPTS = $(PACKAGE)-launch
|
||||
--- virt-manager-0.5.3.orig/src/Makefile.in 2008-01-10 18:18:06.000000000 -0700
|
||||
+++ virt-manager-0.5.3/src/Makefile.in 2008-01-18 15:49:25.000000000 -0700
|
||||
@@ -246,7 +246,7 @@
|
||||
libexec_SCRIPTS = $(PACKAGE)-launch
|
||||
gladedir = $(pkgdatadir)
|
||||
glade_DATA = $(wildcard $(srcdir)/*.glade)
|
||||
|
||||
-desktopdir = $(datadir)/applications
|
||||
+desktopdir = $(datadir)/applications/YaST2/
|
||||
desktop_SOURCES = $(PACKAGE).desktop.in.in
|
||||
desktop_DATA = $(PACKAGE).desktop
|
||||
|
||||
dbusdir = $(datadir)/dbus-1/services
|
||||
|
@ -1,50 +0,0 @@
|
||||
Index: virt-manager--devel/src/virt-manager.py.in
|
||||
===================================================================
|
||||
--- virt-manager--devel.orig/src/virt-manager.py.in
|
||||
+++ virt-manager--devel/src/virt-manager.py.in
|
||||
@@ -188,6 +188,8 @@ def main():
|
||||
optParser = OptionParser()
|
||||
optParser.add_option("--profile", dest="profile", help="Generate runtime performance profile stats", metavar="FILE")
|
||||
optParser.set_defaults(uuid=None)
|
||||
+ optParser.add_option("-y", "--yast", dest="fork", action="store_true",
|
||||
+ help="Allow yast parent to exit")
|
||||
optParser.add_option("-c", "--connect", dest="uri",
|
||||
help="Connect to hypervisor at URI", metavar="URI")
|
||||
optParser.add_option("--no-dbus", action="store_true", dest="nodbus",
|
||||
@@ -239,6 +241,23 @@ def main():
|
||||
logging.warning("Could not connection to session bus, disabling DBus service " + \
|
||||
str(sys.exc_info()[0]) + " " + str(sys.exc_info()[1]))
|
||||
|
||||
+ if options.fork:
|
||||
+ # Don't have to completely daemonize; just fork off and close
|
||||
+ # stdin/stdout/stderr to let yast parent die happily.
|
||||
+ pid = os.fork()
|
||||
+ if pid == 0:
|
||||
+ for fd in (0, 1, 2):
|
||||
+ try:
|
||||
+ os.close(fd)
|
||||
+ except:
|
||||
+ continue
|
||||
+ os.open('/dev/null', os.O_RDWR)
|
||||
+ if os.fork():
|
||||
+ os._exit(0)
|
||||
+ else:
|
||||
+ os.waitpid(pid, 0)
|
||||
+ os._exit(0)
|
||||
+
|
||||
# Finally start the app for real
|
||||
show_engine(engine, options.show, options.uri, options.uuid)
|
||||
if options.profile != None:
|
||||
Index: virt-manager--devel/src/virtManager/engine.py
|
||||
===================================================================
|
||||
--- virt-manager--devel.orig/src/virtManager/engine.py
|
||||
+++ virt-manager--devel/src/virtManager/engine.py
|
||||
@@ -285,7 +285,7 @@ class vmmEngine:
|
||||
return self.connections[uri]["windowDetails"][uuid]
|
||||
|
||||
def show_manager(self, uri):
|
||||
- con = self.get_connection(uri)
|
||||
+ con = self.get_connection(uri, False)
|
||||
|
||||
if self.connections[uri]["windowManager"] == None:
|
||||
manager = vmmManager(self.get_config(),
|
@ -1,490 +0,0 @@
|
||||
Index: virt-manager--devel/src/virtManager/details.py
|
||||
===================================================================
|
||||
--- virt-manager--devel.orig/src/virtManager/details.py
|
||||
+++ virt-manager--devel/src/virtManager/details.py
|
||||
@@ -24,6 +24,12 @@ import libvirt
|
||||
import sparkline
|
||||
import logging
|
||||
import traceback
|
||||
+import os
|
||||
+from subprocess import *
|
||||
+
|
||||
+import vmdisks
|
||||
+import vminstall
|
||||
+from vminstall.gtk.disk_widgets import DisksWidget, DiskEditWidget
|
||||
|
||||
from virtManager.error import vmmErrorDialog
|
||||
from virtManager.addhardware import vmmAddHardware
|
||||
@@ -31,6 +37,17 @@ from virtManager.addhardware import vmmA
|
||||
import virtinst
|
||||
import urlgrabber.progress as progress
|
||||
|
||||
+def run(args):
|
||||
+ try:
|
||||
+ p = Popen(args=args, stdin=None, stdout=PIPE, stderr=STDOUT, close_fds=True)
|
||||
+ (pid, status) = os.waitpid(p.pid, 0)
|
||||
+ output = p.stdout.read()
|
||||
+ if status:
|
||||
+ raise RuntimeError(output)
|
||||
+ except OSError, e:
|
||||
+ raise RuntimeError(str(e))
|
||||
+ return output
|
||||
+
|
||||
# Columns in hw list model
|
||||
HW_LIST_COL_LABEL = 0
|
||||
HW_LIST_COL_STOCK_ID = 1
|
||||
@@ -69,12 +86,7 @@ class vmmDetails(gobject.GObject):
|
||||
topwin = self.window.get_widget("vmm-details")
|
||||
topwin.hide()
|
||||
topwin.set_title(self.vm.get_name() + " " + topwin.get_title())
|
||||
-
|
||||
- # Don't allowing changing network/disks for Dom0
|
||||
- if self.vm.is_management_domain():
|
||||
- self.window.get_widget("add-hardware-button").set_sensitive(False)
|
||||
- else:
|
||||
- self.window.get_widget("add-hardware-button").set_sensitive(True)
|
||||
+ self.topwin = topwin
|
||||
|
||||
self.window.get_widget("overview-name").set_text(self.vm.get_name())
|
||||
self.window.get_widget("overview-uuid").set_text(self.vm.get_uuid())
|
||||
@@ -119,10 +131,6 @@ class vmmDetails(gobject.GObject):
|
||||
"on_config_maxmem_changed": self.config_maxmem_changed,
|
||||
"on_config_memory_apply_clicked": self.config_memory_apply,
|
||||
"on_details_help_activate": self.show_help,
|
||||
-
|
||||
- "on_config_disk_remove_clicked": self.remove_disk,
|
||||
- "on_config_network_remove_clicked": self.remove_network,
|
||||
- "on_add_hardware_button_clicked": self.add_hardware,
|
||||
})
|
||||
|
||||
self.vm.connect("status-changed", self.update_widget_states)
|
||||
@@ -166,11 +174,11 @@ class vmmDetails(gobject.GObject):
|
||||
self.window.get_widget("details-pages").set_current_page(1)
|
||||
|
||||
def close(self,ignore1=None,ignore2=None):
|
||||
- self.window.get_widget("vmm-details").hide()
|
||||
+ self.topwin.hide()
|
||||
return 1
|
||||
|
||||
def is_visible(self):
|
||||
- if self.window.get_widget("vmm-details").flags() & gtk.VISIBLE:
|
||||
+ if self.topwin.flags() & gtk.VISIBLE:
|
||||
return 1
|
||||
return 0
|
||||
|
||||
@@ -192,10 +200,10 @@ class vmmDetails(gobject.GObject):
|
||||
self.refresh_config_memory()
|
||||
pagenum = 1
|
||||
elif pagetype == HW_LIST_TYPE_DISK:
|
||||
- self.refresh_disk_page()
|
||||
+ self.populate_disk_list()
|
||||
pagenum = 2
|
||||
elif pagetype == HW_LIST_TYPE_NIC:
|
||||
- self.refresh_network_page()
|
||||
+ self.populate_network_list()
|
||||
pagenum = 3
|
||||
|
||||
self.window.get_widget("hw-panel").set_current_page(pagenum)
|
||||
@@ -328,9 +336,6 @@ class vmmDetails(gobject.GObject):
|
||||
if details.get_current_page() == 0:
|
||||
self.refresh_summary()
|
||||
else:
|
||||
- # Add / remove new devices
|
||||
- self.repopulate_hw_list()
|
||||
-
|
||||
# Now refresh desired page
|
||||
hw_list = self.window.get_widget("hw-list")
|
||||
selection = hw_list.get_selection()
|
||||
@@ -343,10 +348,10 @@ class vmmDetails(gobject.GObject):
|
||||
self.refresh_config_cpu()
|
||||
elif pagetype == HW_LIST_TYPE_MEMORY:
|
||||
self.refresh_config_memory()
|
||||
- elif pagetype == HW_LIST_TYPE_DISK:
|
||||
- self.refresh_disk_page()
|
||||
- elif pagetype == HW_LIST_TYPE_NIC:
|
||||
- self.refresh_network_page()
|
||||
+ #elif pagetype == HW_LIST_TYPE_DISK:
|
||||
+ # self.refresh_disk_page()
|
||||
+ #elif pagetype == HW_LIST_TYPE_NIC:
|
||||
+ # self.refresh_network_page()
|
||||
|
||||
def refresh_summary(self):
|
||||
self.window.get_widget("overview-cpu-usage-text").set_text("%d %%" % self.vm.cpu_time_percentage())
|
||||
@@ -400,18 +405,6 @@ class vmmDetails(gobject.GObject):
|
||||
|
||||
self.window.get_widget("state-vm-memory").set_text("%d MB" % (self.vm.get_memory()/1024))
|
||||
|
||||
- def refresh_disk_page(self):
|
||||
- # get the currently selected line
|
||||
- vmlist = self.window.get_widget("hw-list")
|
||||
- selection = vmlist.get_selection()
|
||||
- active = selection.get_selected()
|
||||
- if active[1] != None:
|
||||
- diskinfo = active[0].get_value(active[1], HW_LIST_COL_DEVICE)
|
||||
- self.window.get_widget("disk-source-type").set_text(diskinfo[0])
|
||||
- self.window.get_widget("disk-source-path").set_text(diskinfo[1])
|
||||
- self.window.get_widget("disk-target-type").set_text(diskinfo[2])
|
||||
- self.window.get_widget("disk-target-device").set_text(diskinfo[3])
|
||||
-
|
||||
def refresh_network_page(self):
|
||||
vmlist = self.window.get_widget("hw-list")
|
||||
selection = vmlist.get_selection()
|
||||
@@ -458,36 +451,232 @@ class vmmDetails(gobject.GObject):
|
||||
self.window.get_widget("config-memory-apply").set_sensitive(False)
|
||||
|
||||
|
||||
- def remove_disk(self, src):
|
||||
- vmlist = self.window.get_widget("hw-list")
|
||||
- selection = vmlist.get_selection()
|
||||
- active = selection.get_selected()
|
||||
- if active[1] != None:
|
||||
- diskinfo = active[0].get_value(active[1], HW_LIST_COL_DEVICE)
|
||||
-
|
||||
- vbd = virtinst.VirtualDisk(path=diskinfo[1], type=diskinfo[0], device=diskinfo[2])
|
||||
- xml = vbd.get_xml_config(diskinfo[3])
|
||||
-
|
||||
- self.vm.remove_device(xml)
|
||||
-
|
||||
- def remove_network(self, src):
|
||||
- vmlist = self.window.get_widget("hw-list")
|
||||
- selection = vmlist.get_selection()
|
||||
- active = selection.get_selected()
|
||||
- if active[1] != None:
|
||||
- netinfo = active[0].get_value(active[1], HW_LIST_COL_DEVICE)
|
||||
-
|
||||
- vnic = None
|
||||
- if netinfo[0] == "bridge":
|
||||
- vnic = virtinst.VirtualNetworkInterface(type=netinfo[0], bridge=netinfo[1], macaddr=netinfo[3])
|
||||
- elif netinfo[0] == "network":
|
||||
- vnic = virtinst.VirtualNetworkInterface(type=netinfo[0], network=netinfo[1], macaddr=netinfo[3])
|
||||
+ def get_disk_editor(self):
|
||||
+ w = gtk.Window()
|
||||
+ w.set_modal(True)
|
||||
+ w.set_transient_for(self.topwin)
|
||||
+ w.set_position(gtk.WIN_POS_CENTER_ON_PARENT)
|
||||
+ w.set_title(vminstall.msg.title_disk)
|
||||
+ w.set_border_width(10)
|
||||
+ disk_editor = DiskEditWidget()
|
||||
+ vbox = gtk.VBox()
|
||||
+ w.add(vbox)
|
||||
+ vbox.pack_start(disk_editor.get_widget(), False)
|
||||
+ bbox = gtk.HButtonBox()
|
||||
+ bbox.set_layout(gtk.BUTTONBOX_END)
|
||||
+ cancel_button = gtk.Button(stock=gtk.STOCK_CANCEL)
|
||||
+ bbox.pack_start(cancel_button)
|
||||
+ ok_button = gtk.Button(stock=gtk.STOCK_OK)
|
||||
+ bbox.pack_start(ok_button)
|
||||
+ vbox.pack_start(bbox, False)
|
||||
+ w.show_all()
|
||||
+ w.present()
|
||||
+ def _cancel_disk(button):
|
||||
+ w.destroy()
|
||||
+ cancel_button.connect("clicked", _cancel_disk)
|
||||
+ return (w, disk_editor, ok_button)
|
||||
+
|
||||
+ def error_box(self, parent, text=vminstall.msg.error):
|
||||
+ parent.present()
|
||||
+ message_box = gtk.MessageDialog(parent, 0, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, text)
|
||||
+ message_box.run()
|
||||
+ message_box.destroy()
|
||||
+
|
||||
+ def add_cdrom(self, button):
|
||||
+ return self.add_disk(True)
|
||||
+ def add_harddisk(self, button):
|
||||
+ return self.add_disk(False)
|
||||
+ def add_disk(self, is_cdrom):
|
||||
+ disks = self.disks_widget.get_disks()
|
||||
+ unused_vdevs = vmdisks.get_unused_vdevs(self.options.full_virt, disks)
|
||||
+ if len(unused_vdevs) == 0:
|
||||
+ return
|
||||
+ (w, disk_editor, ok_button) = self.get_disk_editor()
|
||||
+ def _add_disk(button):
|
||||
+ try:
|
||||
+ disk = disk_editor.get()
|
||||
+ self.xen_add_disk(disk)
|
||||
+ except vminstall.DiskResourceError, e:
|
||||
+ self.error_box(w, e.title)
|
||||
+ except:
|
||||
+ self.error_box(w)
|
||||
+ else:
|
||||
+ disks.append(disk)
|
||||
+ self.disks_widget.set_disks(disks)
|
||||
+ w.destroy()
|
||||
+ ok_button.connect("clicked", _add_disk)
|
||||
+ if is_cdrom:
|
||||
+ cdrom = disk_editor.default_cdrom()
|
||||
+ disk = vmdisks.Disk(pdev=cdrom, vdev=unused_vdevs[0],
|
||||
+ vdevType=vmdisks.Disk.DEVICE_CDROM,
|
||||
+ full_virt=self.options.full_virt, vmname=self.options.vmname, disk_group=disks)
|
||||
+ else:
|
||||
+ disk = vmdisks.Disk(pdev=None, vdev=unused_vdevs[0],
|
||||
+ vdevType=vmdisks.Disk.DEVICE_DISK,
|
||||
+ args={'sparse':True},
|
||||
+ full_virt=self.options.full_virt, vmname=self.options.vmname, disk_group=disks)
|
||||
+ disk_editor.set(disk)
|
||||
+
|
||||
+ def edit_disk(self, button):
|
||||
+ (disk, index) = self.disks_widget.get_selected()
|
||||
+ (w, disk_editor, ok_button) = self.get_disk_editor()
|
||||
+ disk_editor.set(disk)
|
||||
+ def _edit_disk(button):
|
||||
+ try:
|
||||
+ disk = disk_editor.get()
|
||||
+ self.xen_edit_disk(disk)
|
||||
+ except vminstall.DiskResourceError, e:
|
||||
+ self.error_box(w, e.title)
|
||||
+ except:
|
||||
+ self.error_box(w)
|
||||
else:
|
||||
- vnic = virtinst.VirtualNetworkInterface(type=netinfo[0], macaddr=netinfo[3])
|
||||
+ self.disks_widget.set_index(index, disk)
|
||||
+ w.destroy()
|
||||
+ ok_button.connect("clicked", _edit_disk)
|
||||
+ disk_editor.set(disk)
|
||||
+
|
||||
+ def xen_add_disk(self, disk):
|
||||
+ disk.setup()
|
||||
+ if self.vm.is_active():
|
||||
+ mode = 'w'
|
||||
+ if disk.ro:
|
||||
+ mode = 'r'
|
||||
+ vdev = disk.get_vdev_str()
|
||||
+ if disk.get_vdevtype() == disk.DEVICE_CDROM:
|
||||
+ vdev += ':cdrom'
|
||||
+ try:
|
||||
+ run(['/usr/sbin/xm', 'block-attach', str(self.vm.get_id()),
|
||||
+ disk.get_pdev(), vdev, mode])
|
||||
+ except RuntimeError, e:
|
||||
+ logging.error("Failed to attach disk: %s" % str(e))
|
||||
+ raise
|
||||
+ else:
|
||||
+ raise NotImplementedError
|
||||
|
||||
- xml = vnic.get_xml_config()
|
||||
- self.vm.remove_device(xml)
|
||||
+ def xen_remove_disk(self, disk):
|
||||
+ if self.vm.is_active():
|
||||
+ try:
|
||||
+ run(['/usr/sbin/xm', 'block-detach', str(self.vm.get_id()), disk.vdev, '-f'])
|
||||
+ except RuntimeError, e:
|
||||
+ logging.error("Failed to remove disk: %s" % str(e))
|
||||
+ raise
|
||||
+ else:
|
||||
+ raise NotImplementedError
|
||||
|
||||
+ def xen_edit_disk(self, disk):
|
||||
+ if self.vm.is_active():
|
||||
+ try:
|
||||
+ from xen.util import blkif
|
||||
+ devid = blkif.blkdev_name_to_number(disk.get_vdev_str())
|
||||
+ run(['/usr/bin/xenstore-write',
|
||||
+ '/local/domain/0/backend/vbd/%d/%d/params' % (self.vm.get_id(), devid),
|
||||
+ disk.get_path()])
|
||||
+ except RuntimeError, e:
|
||||
+ logging.error("Failed to change CD media: %s" % str(e))
|
||||
+ raise
|
||||
+ else:
|
||||
+ raise NotImplementedError
|
||||
+
|
||||
+ def disk_selected(self, src=None):
|
||||
+ (disk, index) = self.disks_widget.get_selected()
|
||||
+ # FIXME: Abstract access to the buttons
|
||||
+ def button(name):
|
||||
+ return self.disks_widget.glade.get_widget(name)
|
||||
+ cdrom_button = button('button-new-cdrom')
|
||||
+ disk_button = button('button-new-harddisk')
|
||||
+ edit_button = button('button-edit-disk')
|
||||
+ remove_button = button('button-delete-disk')
|
||||
+ active = self.vm.is_active()
|
||||
+ cdrom_button.set_sensitive(active)
|
||||
+ disk_button.set_sensitive(active)
|
||||
+ if disk is None:
|
||||
+ edit_button.set_sensitive(False)
|
||||
+ remove_button.set_sensitive(False)
|
||||
+ else:
|
||||
+ edit_button.set_sensitive(active and disk.get_vdevtype() == disk.DEVICE_CDROM)
|
||||
+ remove_button.set_sensitive(active)
|
||||
+
|
||||
+ def prepare_disk_list(self):
|
||||
+ self.disks_widget = DisksWidget(allow_reorder=False,
|
||||
+ add_cdrom_fn=self.add_cdrom,
|
||||
+ add_harddisk_fn=self.add_harddisk,
|
||||
+ edit_fn=self.edit_disk,
|
||||
+ remove_fn=self.xen_remove_disk)
|
||||
+ notebook = self.window.get_widget("hw-panel")
|
||||
+ notebook.remove_page(2)
|
||||
+ notebook.insert_page(self.disks_widget.get_widget(), None, 2)
|
||||
+ self.disks_widget.disks_view.view.get_selection().connect("changed", self.disk_selected)
|
||||
+ class Options:
|
||||
+ pass
|
||||
+ self.options = Options()
|
||||
+ self.options.vmname = self.vm.get_name()
|
||||
+ # This is to work around a libvirt bug; once libvirt is updated,
|
||||
+ # remove this. If the VM is not running, libvirt assumes it is
|
||||
+ # paravirtual. This can cause problems (such as failure to detach
|
||||
+ # a disk) if the VM is started and turns out it was actually FV.
|
||||
+ if self.vm.is_active():
|
||||
+ self.options.full_virt = self.vm.vm.OSType() == 'hvm'
|
||||
+ else:
|
||||
+ self.options.full_virt = False
|
||||
+ for d in self.vm.get_disk_devices():
|
||||
+ if d[3].startswith('hd'):
|
||||
+ self.options.full_virt = True
|
||||
+ break
|
||||
+
|
||||
+ def populate_disk_list(self):
|
||||
+ diskList = self.vm.get_disk_devices()
|
||||
+ disks = []
|
||||
+ for d in diskList:
|
||||
+ disks.append(vmdisks.Disk(d[1], vdev=d[3], vdevType=d[2],
|
||||
+ full_virt=self.options.full_virt, vmname=self.options.vmname, disk_group=disks))
|
||||
+ max_disks = len(vmdisks.get_possible_vdevs(self.options.full_virt))
|
||||
+ self.disks_widget.set_max_disks(max_disks)
|
||||
+ self.disks_widget.set_disks(disks)
|
||||
+ self.disk_selected()
|
||||
+
|
||||
+ def prepare_network_list(self):
|
||||
+ netsModel = gtk.TreeStore(str,str,str,str)
|
||||
+ self.nets = nets = gtk.TreeView(netsModel)
|
||||
+ frame = gtk.Frame()
|
||||
+ frame.add(nets)
|
||||
+ frame.set_border_width(10)
|
||||
+
|
||||
+ notebook = self.window.get_widget("hw-panel")
|
||||
+ notebook.remove_page(3)
|
||||
+ notebook.insert_page(frame, None, 3)
|
||||
+
|
||||
+ netType_col = gtk.TreeViewColumn("Type")
|
||||
+ netType_text = gtk.CellRendererText()
|
||||
+ netType_col.pack_start(netType_text, True)
|
||||
+ netType_col.add_attribute(netType_text, 'text', 0)
|
||||
+
|
||||
+ netSrc_col = gtk.TreeViewColumn("Source")
|
||||
+ netSrc_text = gtk.CellRendererText()
|
||||
+ netSrc_col.pack_start(netSrc_text, True)
|
||||
+ netSrc_col.add_attribute(netSrc_text, 'text', 1)
|
||||
+
|
||||
+ netDevice_col = gtk.TreeViewColumn("Device")
|
||||
+ netDevice_text = gtk.CellRendererText()
|
||||
+ netDevice_col.pack_start(netDevice_text, True)
|
||||
+ netDevice_col.add_attribute(netDevice_text, 'text', 2)
|
||||
+
|
||||
+ netDst_col = gtk.TreeViewColumn(_("MAC address"))
|
||||
+ netDst_text = gtk.CellRendererText()
|
||||
+ netDst_col.pack_start(netDst_text, True)
|
||||
+ netDst_col.add_attribute(netDst_text, 'text', 3)
|
||||
+
|
||||
+ nets.append_column(netType_col)
|
||||
+ nets.append_column(netSrc_col)
|
||||
+ nets.append_column(netDevice_col)
|
||||
+ nets.append_column(netDst_col)
|
||||
+
|
||||
+ def populate_network_list(self):
|
||||
+ netList = self.vm.get_network_devices()
|
||||
+
|
||||
+ netsModel = self.nets.get_model()
|
||||
+ netsModel.clear()
|
||||
+ for d in netList:
|
||||
+ netsModel.append(None, d)
|
||||
|
||||
def prepare_hw_list(self):
|
||||
hw_list_model = gtk.ListStore(str, str, int, gtk.gdk.Pixbuf, int, gobject.TYPE_PYOBJECT)
|
||||
@@ -504,94 +693,11 @@ class vmmDetails(gobject.GObject):
|
||||
hwCol.add_attribute(hw_img, 'pixbuf', HW_LIST_COL_PIXBUF)
|
||||
self.window.get_widget("hw-list").append_column(hwCol)
|
||||
|
||||
- self.populate_hw_list()
|
||||
-
|
||||
- def populate_hw_list(self):
|
||||
- hw_list_model = self.window.get_widget("hw-list").get_model()
|
||||
hw_list_model.clear()
|
||||
hw_list_model.append(["Processor", None, 0, self.pixbuf_processor, HW_LIST_TYPE_CPU, []])
|
||||
hw_list_model.append(["Memory", None, 0, self.pixbuf_memory, HW_LIST_TYPE_MEMORY, []])
|
||||
- self.repopulate_hw_list()
|
||||
-
|
||||
- def repopulate_hw_list(self):
|
||||
- hw_list = self.window.get_widget("hw-list")
|
||||
- hw_list_model = hw_list.get_model()
|
||||
-
|
||||
- # Populate list of disks
|
||||
- currentDisks = {}
|
||||
- for disk in self.vm.get_disk_devices():
|
||||
- missing = True
|
||||
- insertAt = 0
|
||||
- currentDisks[disk[3]] = 1
|
||||
- for row in hw_list_model:
|
||||
- if row[HW_LIST_COL_TYPE] == HW_LIST_TYPE_DISK and row[HW_LIST_COL_DEVICE][3] == disk[3]:
|
||||
- # Update metadata
|
||||
- row[HW_LIST_COL_DEVICE] = disk
|
||||
- missing = False
|
||||
- # The insert position must be *before* any NICs
|
||||
- if row[HW_LIST_COL_TYPE] != HW_LIST_TYPE_NIC:
|
||||
- insertAt = insertAt + 1
|
||||
-
|
||||
- # Add in row
|
||||
- if missing:
|
||||
- stock = gtk.STOCK_HARDDISK
|
||||
- if disk[2] == "cdrom":
|
||||
- stock = gtk.STOCK_CDROM
|
||||
- elif disk[2] == "floppy":
|
||||
- stock = gtk.STOCK_FLOPPY
|
||||
- hw_list_model.insert(insertAt, ["Disk %s" % disk[3], stock, gtk.ICON_SIZE_LARGE_TOOLBAR, None, HW_LIST_TYPE_DISK, disk])
|
||||
-
|
||||
- # Populate list of NICs
|
||||
- currentNICs = {}
|
||||
- nic_number = 0
|
||||
- for nic in self.vm.get_network_devices():
|
||||
- missing = True
|
||||
- insertAt = 0
|
||||
- currentNICs[nic[3]] = 1
|
||||
- for row in hw_list_model:
|
||||
- if row[HW_LIST_COL_TYPE] == HW_LIST_TYPE_NIC and row[HW_LIST_COL_DEVICE][3] == nic[3]:
|
||||
- # Update metadata
|
||||
- row[HW_LIST_COL_DEVICE] = nic
|
||||
- missing = False
|
||||
-
|
||||
- # Insert position is at end....
|
||||
- # XXX until we add support for Mice, etc
|
||||
- insertAt = insertAt + 1
|
||||
-
|
||||
- # Add in row
|
||||
- if missing:
|
||||
- hw_list_model.insert(insertAt, ["NIC %s" % nic[3][-9:], gtk.STOCK_NETWORK, gtk.ICON_SIZE_LARGE_TOOLBAR, None, HW_LIST_TYPE_NIC, nic])
|
||||
-
|
||||
- # Now remove any no longer current devs
|
||||
- devs = range(len(hw_list_model))
|
||||
- devs.reverse()
|
||||
- for i in devs:
|
||||
- iter = hw_list_model.iter_nth_child(None, i)
|
||||
- row = hw_list_model[i]
|
||||
- removeIt = False
|
||||
-
|
||||
- if row[HW_LIST_COL_TYPE] == HW_LIST_TYPE_DISK and not currentDisks.has_key(row[HW_LIST_COL_DEVICE][3]):
|
||||
- removeIt = True
|
||||
- elif row[HW_LIST_COL_TYPE] == HW_LIST_TYPE_NIC and not currentNICs.has_key(row[HW_LIST_COL_DEVICE][3]):
|
||||
- removeIt = True
|
||||
-
|
||||
- if removeIt:
|
||||
- # Re-select the first row, if we're viewing the device
|
||||
- # we're about to remove
|
||||
- (selModel, selIter) = hw_list.get_selection().get_selected()
|
||||
- selType = selModel.get_value(selIter, HW_LIST_COL_TYPE)
|
||||
- selInfo = selModel.get_value(selIter, HW_LIST_COL_DEVICE)
|
||||
- if selType == row[HW_LIST_COL_TYPE] and selInfo[3] == row[HW_LIST_COL_DEVICE][3]:
|
||||
- hw_list.get_selection().select_iter(selModel.iter_nth_child(None, 0))
|
||||
-
|
||||
- # Now actually remove it
|
||||
- hw_list_model.remove(iter)
|
||||
-
|
||||
-
|
||||
- def add_hardware(self, src):
|
||||
- if self.addhw is None:
|
||||
- self.addhw = vmmAddHardware(self.config, self.vm)
|
||||
-
|
||||
- self.addhw.show()
|
||||
-
|
||||
+ hw_list_model.append(["Disk", gtk.STOCK_HARDDISK, gtk.ICON_SIZE_LARGE_TOOLBAR, None, HW_LIST_TYPE_DISK, []])
|
||||
+ hw_list_model.append(["Network", gtk.STOCK_NETWORK, gtk.ICON_SIZE_LARGE_TOOLBAR, None, HW_LIST_TYPE_NIC, []])
|
||||
|
||||
+ self.prepare_disk_list()
|
||||
+ self.prepare_network_list()
|
@ -1,73 +0,0 @@
|
||||
Index: virt-manager--devel/src/virtManager/engine.py
|
||||
===================================================================
|
||||
--- virt-manager--devel.orig/src/virtManager/engine.py
|
||||
+++ virt-manager--devel/src/virtManager/engine.py
|
||||
@@ -32,7 +32,7 @@ from virtManager.manager import vmmManag
|
||||
from virtManager.details import vmmDetails
|
||||
from virtManager.console import vmmConsole
|
||||
from virtManager.asyncjob import vmmAsyncJob
|
||||
-from virtManager.create import vmmCreate
|
||||
+from vminstall.gtk.interface import VMCreate as vmmCreate
|
||||
from virtManager.serialcon import vmmSerialConsole
|
||||
from virtManager.error import vmmErrorDialog
|
||||
from virtManager.host import vmmHost
|
||||
@@ -42,7 +42,7 @@ class vmmEngine:
|
||||
self.windowConnect = None
|
||||
self.windowPreferences = None
|
||||
self.windowAbout = None
|
||||
- self.windowCreate = None
|
||||
+ self.windowCreate = {}
|
||||
self.connections = {}
|
||||
|
||||
self.timer = None
|
||||
@@ -169,8 +169,7 @@ class vmmEngine:
|
||||
for name in [ "windowManager", "windowHost"]:
|
||||
if conn[name] != None and conn[name].is_visible():
|
||||
ct += 1
|
||||
- if self.windowCreate:
|
||||
- ct += self.windowCreate.is_visible()
|
||||
+ ct += len(filter(lambda w: w.is_visible(), self.windowCreate.values()))
|
||||
return ct
|
||||
|
||||
def change_timer_interval(self,ignore1,ignore2,ignore3,ignore4):
|
||||
@@ -302,14 +301,21 @@ class vmmEngine:
|
||||
self.connections[uri]["windowManager"] = manager
|
||||
self.connections[uri]["windowManager"].show()
|
||||
|
||||
+ def _create_closing(self, src, key):
|
||||
+ del self.windowCreate[key]
|
||||
+
|
||||
def show_create(self, uri):
|
||||
- if self.windowCreate == None:
|
||||
- self.windowCreate = vmmCreate(self.get_config(), self.get_connection(uri, False))
|
||||
- self.windowCreate.connect("action-show-console", self._do_show_console)
|
||||
- self.windowCreate.connect("action-show-terminal", self._do_show_terminal)
|
||||
- self.windowCreate.connect("action-show-help", self._do_show_help)
|
||||
- self.windowCreate.reset_state()
|
||||
- self.windowCreate.show()
|
||||
+ key = 0
|
||||
+ while True:
|
||||
+ if not self.windowCreate.has_key(key):
|
||||
+ break
|
||||
+ key += 1
|
||||
+ window = vmmCreate(virtman=True, key=key)
|
||||
+ self.windowCreate[key] = window
|
||||
+ window.connect("action-show-console", self._do_show_console)
|
||||
+ window.connect("action-show-terminal", self._do_show_terminal)
|
||||
+ window.connect("vmmcreate-closing", self._create_closing)
|
||||
+ window.show()
|
||||
|
||||
def get_connection(self, uri, readOnly=None):
|
||||
if not(self.connections.has_key(uri)):
|
||||
Index: virt-manager--devel/src/virtManager/createnet.py
|
||||
===================================================================
|
||||
--- virt-manager--devel.orig/src/virtManager/createnet.py
|
||||
+++ virt-manager--devel/src/virtManager/createnet.py
|
||||
@@ -22,7 +22,6 @@ import gtk
|
||||
import gtk.gdk
|
||||
import gtk.glade
|
||||
import libvirt
|
||||
-import virtinst
|
||||
import os, sys
|
||||
import logging
|
||||
import dbus
|
@ -1,83 +0,0 @@
|
||||
Index: virt-manager--devel/src/virtManager/connect.py
|
||||
===================================================================
|
||||
--- virt-manager--devel.orig/src/virtManager/connect.py
|
||||
+++ virt-manager--devel/src/virtManager/connect.py
|
||||
@@ -116,4 +116,3 @@ class vmmConnect(gobject.GObject):
|
||||
self.close()
|
||||
self.emit("completed", uri, readOnly)
|
||||
|
||||
-gobject.type_register(vmmConnect)
|
||||
Index: virt-manager--devel/src/virtManager/connection.py
|
||||
===================================================================
|
||||
--- virt-manager--devel.orig/src/virtManager/connection.py
|
||||
+++ virt-manager--devel/src/virtManager/connection.py
|
||||
@@ -641,5 +641,4 @@ class vmmConnection(gobject.GObject):
|
||||
delim = len(url)
|
||||
return url[start:delim], url[delim:]
|
||||
|
||||
-gobject.type_register(vmmConnection)
|
||||
|
||||
Index: virt-manager--devel/src/virtManager/console.py
|
||||
===================================================================
|
||||
--- virt-manager--devel.orig/src/virtManager/console.py
|
||||
+++ virt-manager--devel/src/virtManager/console.py
|
||||
@@ -508,4 +508,3 @@ class vmmConsole(gobject.GObject):
|
||||
self.ignorePause = False
|
||||
|
||||
|
||||
-gobject.type_register(vmmConsole)
|
||||
Index: virt-manager--devel/src/virtManager/details.py
|
||||
===================================================================
|
||||
--- virt-manager--devel.orig/src/virtManager/details.py
|
||||
+++ virt-manager--devel/src/virtManager/details.py
|
||||
@@ -595,4 +595,3 @@ class vmmDetails(gobject.GObject):
|
||||
self.addhw.show()
|
||||
|
||||
|
||||
-gobject.type_register(vmmDetails)
|
||||
Index: virt-manager--devel/src/virtManager/domain.py
|
||||
===================================================================
|
||||
--- virt-manager--devel.orig/src/virtManager/domain.py
|
||||
+++ virt-manager--devel/src/virtManager/domain.py
|
||||
@@ -644,4 +644,3 @@ class vmmDomain(gobject.GObject):
|
||||
memory = int(memory)
|
||||
self.vm.setMaxMemory(memory)
|
||||
|
||||
-gobject.type_register(vmmDomain)
|
||||
Index: virt-manager--devel/src/virtManager/manager.py
|
||||
===================================================================
|
||||
--- virt-manager--devel.orig/src/virtManager/manager.py
|
||||
+++ virt-manager--devel/src/virtManager/manager.py
|
||||
@@ -718,4 +718,3 @@ class vmmManager(gobject.GObject):
|
||||
vm.resume()
|
||||
|
||||
|
||||
-gobject.type_register(vmmManager)
|
||||
Index: virt-manager--devel/src/vncViewer/vnc.py
|
||||
===================================================================
|
||||
--- virt-manager--devel.orig/src/vncViewer/vnc.py
|
||||
+++ virt-manager--devel/src/vncViewer/vnc.py
|
||||
@@ -113,7 +113,6 @@ class GRFBFrameBuffer(rfb.RFBFrameBuffer
|
||||
def move_cursor(self, x, y):
|
||||
logging.error("Unsupported move_cursor operation requested")
|
||||
|
||||
-gobject.type_register(GRFBFrameBuffer)
|
||||
|
||||
|
||||
class GRFBNetworkClient(rfb.RFBNetworkClient, gobject.GObject):
|
||||
@@ -177,7 +176,6 @@ class GRFBNetworkClient(rfb.RFBNetworkCl
|
||||
if y < 0:
|
||||
y = 0
|
||||
self.send(pack('>BBHH', 5, mask, x, y))
|
||||
-gobject.type_register(GRFBNetworkClient)
|
||||
|
||||
|
||||
class GRFBViewer(gtk.DrawingArea):
|
||||
@@ -596,7 +594,6 @@ class GRFBViewer(gtk.DrawingArea):
|
||||
gc = self.window.new_gc()
|
||||
self.window.draw_drawable(gc, self.fb.get_pixmap(), event.area.x, event.area.y, event.area.x, event.area.y, event.area.width, event.area.height)
|
||||
|
||||
-gobject.type_register(GRFBViewer)
|
||||
|
||||
|
||||
def main():
|
13
virtman-xen-uri.diff
Normal file
13
virtman-xen-uri.diff
Normal file
@ -0,0 +1,13 @@
|
||||
Index: virt-manager-0.5.3/src/virtManager/connection.py
|
||||
===================================================================
|
||||
--- virt-manager-0.5.3.orig/src/virtManager/connection.py 2008-01-10 18:17:51.000000000 -0700
|
||||
+++ virt-manager-0.5.3/src/virtManager/connection.py 2008-02-03 13:36:26.000000000 -0700
|
||||
@@ -117,7 +117,7 @@
|
||||
self.connectError = None
|
||||
self.uri = uri
|
||||
if self.uri is None or self.uri.lower() == "xen":
|
||||
- self.uri = "xen:///"
|
||||
+ self.uri = "xen"
|
||||
|
||||
self.state = self.STATE_DISCONNECTED
|
||||
self.vmm = None
|
Loading…
Reference in New Issue
Block a user