Update to 0.8.4

- 'Import' install option, to create a VM around an existing OS image
- Support multiple boot devices and boot order
- Watchdog device support
- Enable setting a human readable VM description.
- Option to manually specifying a bridge name, if bridge isn't detected
This commit is contained in:
Cole Robinson 2010-03-25 00:05:29 +00:00
parent a6a15d4ac1
commit 01726b091f
10 changed files with 45 additions and 91053 deletions

View File

@ -1 +1 @@
virt-manager-0.8.3.tar.gz virt-manager-0.8.4.tar.gz

View File

@ -1 +1 @@
2994055bd83b7fe621f0258089e171f4 virt-manager-0.8.3.tar.gz 133723a0495b79669b0903533d4a4671 virt-manager-0.8.4.tar.gz

View File

@ -1,940 +0,0 @@
# HG changeset patch
# User Cole Robinson <crobinso@redhat.com>
# Date 1265909520 18000
# Node ID 2a65e0b160a98b1969484ff61a8dcafc66f508d2
# Parent 40fb60222e4e1cc6a03942bbcfb9d2e727236410
Make sure all idle and timeout routines are thread safe.
Unbeknownst to me, these functions are not run thread safe:
http://library.gnome.org/devel/gdk/unstable/gdk-Threads.html
However since they are run from the main loop, the chance of them conflicting
with another running thread is slim, since we have very few threads that
actually update the UI.
diff -r 40fb60222e4e -r 2a65e0b160a9 src/virtManager/connection.py
--- a/src/virtManager/connection.py Thu Feb 11 09:32:05 2010 -0500
+++ b/src/virtManager/connection.py Thu Feb 11 12:32:00 2010 -0500
@@ -988,8 +988,8 @@
self.vms.keys())
if self.state == self.STATE_DISCONNECTED:
- gobject.idle_add(util.idle_emit, self, "connect-error",
- self.connectError)
+ util.safe_idle_add(util.idle_emit, self, "connect-error",
+ self.connectError)
self.connectError = None
finally:
self.connectThreadEvent.set()
@@ -1445,7 +1445,7 @@
for name in newNodedevs:
self.emit("nodedev-added", self.uri, name)
- gobject.idle_add(tick_send_signals)
+ util.safe_idle_add(tick_send_signals)
# Finally, we sample each domain
now = time()
@@ -1468,7 +1468,7 @@
if not noStatsUpdate:
self._recalculate_stats(now)
- gobject.idle_add(util.idle_emit, self, "resources-sampled")
+ util.safe_idle_add(util.idle_emit, self, "resources-sampled")
return 1
diff -r 40fb60222e4e -r 2a65e0b160a9 src/virtManager/console.py
--- a/src/virtManager/console.py Thu Feb 11 09:32:05 2010 -0500
+++ b/src/virtManager/console.py Thu Feb 11 12:32:00 2010 -0500
@@ -477,7 +478,7 @@
logging.error("Too many connection failures, not retrying again")
return
logging.warn("Retrying connection in %d ms", self.vncViewerRetryDelay)
- gobject.timeout_add(self.vncViewerRetryDelay, self.retry_login)
+ util.safe_timeout_add(self.vncViewerRetryDelay, self.retry_login)
if self.vncViewerRetryDelay < 2000:
self.vncViewerRetryDelay = self.vncViewerRetryDelay * 2
@@ -489,12 +490,8 @@
libvirt.VIR_DOMAIN_CRASHED ]:
return
- gtk.gdk.threads_enter()
- try:
- self.try_login()
- return
- finally:
- gtk.gdk.threads_leave()
+ self.try_login()
+ return
def open_tunnel(self, server, vncaddr, vncport, username, sshport):
if self.vncTunnel is not None:
@@ -676,7 +673,7 @@
def unset_cb(src):
src.queue_resize_no_redraw()
- gobject.idle_add(restore_scroll, src)
+ util.safe_idle_add(restore_scroll, src)
return False
def request_cb(src, req):
@@ -686,7 +683,7 @@
src.disconnect(signal_id)
- gobject.idle_add(unset_cb, widget)
+ util.safe_idle_add(unset_cb, widget)
return False
# Disable scroll bars while we resize, since resizing to the VM's
diff -r 40fb60222e4e -r 2a65e0b160a9 src/virtManager/create.py
--- a/src/virtManager/create.py Thu Feb 11 09:32:05 2010 -0500
+++ b/src/virtManager/create.py Thu Feb 11 12:32:00 2010 -0500
@@ -349,7 +349,7 @@
# Storage
if not self.host_storage_timer:
- self.host_storage_timer = gobject.timeout_add(3 * 1000,
+ self.host_storage_timer = util.safe_timeout_add(3 * 1000,
self.host_space_tick)
self.window.get_widget("enable-storage").set_active(True)
self.window.get_widget("config-storage-create").set_active(True)
diff -r 40fb60222e4e -r 2a65e0b160a9 src/virtManager/domain.py
--- a/src/virtManager/domain.py Thu Feb 11 09:32:05 2010 -0500
+++ b/src/virtManager/domain.py Thu Feb 11 12:32:00 2010 -0500
@@ -1357,7 +1357,7 @@
if origxml != self._xml:
# 'tick' to make sure we have the latest time
self.tick(time.time())
- gobject.idle_add(util.idle_emit, self, "config-changed")
+ util.safe_idle_add(util.idle_emit, self, "config-changed")
def _redefine(self, xml_func, *args):
"""
@@ -1848,7 +1848,7 @@
self._startup_vcpus = None
self.vcpu_max_count()
self.lastStatus = status
- gobject.idle_add(util.idle_emit, self, "status-changed", status)
+ util.safe_idle_add(util.idle_emit, self, "status-changed", status)
def tick(self, now):
@@ -1917,7 +1917,7 @@
self.record.insert(0, newStats)
self._update_status(info[0])
- gobject.idle_add(util.idle_emit, self, "resources-sampled")
+ util.safe_idle_add(util.idle_emit, self, "resources-sampled")
class vmmDomainVirtinst(vmmDomainBase):
diff -r 40fb60222e4e -r 2a65e0b160a9 src/virtManager/engine.py
--- a/src/virtManager/engine.py Thu Feb 11 09:32:05 2010 -0500
+++ b/src/virtManager/engine.py Thu Feb 11 12:32:00 2010 -0500
@@ -191,6 +191,8 @@
gobject.source_remove(self.timer)
self.timer = None
+ # No need to use 'safe_timeout_add', the tick should be
+ # manually made thread safe
self.timer = gobject.timeout_add(interval, self.tick)
def tick(self):
@@ -205,7 +207,7 @@
self._tick_thread = threading.Thread(name="Tick thread",
target=self._tick, args=())
- self._tick_thread.daemon = False
+ self._tick_thread.daemon = True
self._tick_thread.start()
return 1
@@ -221,7 +223,7 @@
logging.exception("Could not refresh connection %s." % uri)
logging.debug("Closing connection since libvirtd "
"appears to have stopped.")
- gobject.idle_add(conn.close)
+ util.safe_idle_add(conn.close)
else:
raise
return 1
diff -r 40fb60222e4e -r 2a65e0b160a9 src/virtManager/mediadev.py
--- a/src/virtManager/mediadev.py Thu Feb 11 09:32:05 2010 -0500
+++ b/src/virtManager/mediadev.py Thu Feb 11 12:32:00 2010 -0500
@@ -23,6 +23,8 @@
import virtinst
+from virtManager import util
+
MEDIA_FLOPPY = "floppy"
MEDIA_CDROM = "cdrom"
@@ -136,8 +138,8 @@
if self.poll_signal:
return
- self.poll_signal = gobject.timeout_add(MEDIA_TIMEOUT * 1000,
- self._poll_for_media)
+ self.poll_signal = util.safe_timeout_add(MEDIA_TIMEOUT * 1000,
+ self._poll_for_media)
def disable_poll_for_media(self):
self.poll_signal = None
diff -r 40fb60222e4e -r 2a65e0b160a9 src/virtManager/util.py
--- a/src/virtManager/util.py Thu Feb 11 09:32:05 2010 -0500
+++ b/src/virtManager/util.py Thu Feb 11 12:32:00 2010 -0500
@@ -18,12 +18,14 @@
# MA 02110-1301 USA.
#
-import logging
import gtk
-import libxml2
-import os.path
+import gobject
import libvirt
+import libxml2
+
+import logging
+import os.path
import virtManager
import virtinst
@@ -245,6 +247,25 @@
self.emit(signal, *args)
return False
+def _safe_wrapper(func, *args):
+ gtk.gdk.threads_enter()
+ try:
+ func(*args)
+ finally:
+ gtk.gdk.threads_leave()
+
+def safe_idle_add(func, *args):
+ """
+ Make sure idle functions are run thread safe
+ """
+ return gobject.idle_add(_safe_wrapper, func, *args)
+
+def safe_timeout_add(timeout, func, *args):
+ """
+ Make sure timeout functions are run thread safe
+ """
+ return gobject.timeout_add(timeout, _safe_wrapper, func, *args)
+
def uuidstr(rawuuid):
hx = ['0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f']
uuid = []
diff -rup virt-manager-0.8.3/src/virtManager/connection.py new/src/virtManager/connection.py
--- virt-manager-0.8.3/src/virtManager/connection.py 2010-03-22 10:17:19.000000000 -0400
+++ new/src/virtManager/connection.py 2010-03-22 10:18:23.000000000 -0400
@@ -935,14 +935,14 @@ class vmmConnection(gobject.GObject):
# We want to kill off this thread asap, so schedule a gobject
# idle even to inform the UI of result
logging.debug("Background open thread complete, scheduling notify")
- gobject.idle_add(self._open_notify)
+ util.safe_idle_add(self._open_notify)
self.connectThread = None
def _open_notify(self):
logging.debug("Notifying open result")
try:
- gobject.idle_add(util.idle_emit, self, "state-changed")
+ util.safe_idle_add(util.idle_emit, self, "state-changed")
if self.state == self.STATE_ACTIVE:
logging.debug("%s capabilities:\n%s" %
diff -rup virt-manager-0.8.3/src/virtManager/console.py new/src/virtManager/console.py
--- virt-manager-0.8.3/src/virtManager/console.py 2010-03-22 10:17:19.000000000 -0400
+++ new/src/virtManager/console.py 2010-03-22 10:18:58.000000000 -0400
@@ -30,6 +30,7 @@ import gtkvnc
import os
import socket
+from virtManager import util
from virtManager.error import vmmErrorDialog
# Console pages
# HG changeset patch
# User Cole Robinson <crobinso@redhat.com>
# Date 1266506262 18000
# Node ID 6124400e5d9f7241519a2fdfed17dd5463dbe79c
# Parent cea6cdd27c83d70d0191d94d1cedab447c095001
util: Fix return value of safe idle timeouts
diff -r cea6cdd27c83 -r 6124400e5d9f src/virtManager/util.py
--- a/src/virtManager/util.py Wed Feb 17 16:40:33 2010 -0500
+++ b/src/virtManager/util.py Thu Feb 18 10:17:42 2010 -0500
@@ -250,7 +250,7 @@
def _safe_wrapper(func, *args):
gtk.gdk.threads_enter()
try:
- func(*args)
+ return func(*args)
finally:
gtk.gdk.threads_leave()
diff -rup abc/src/virtManager/asyncjob.py virt-manager-0.8.3/src/virtManager/asyncjob.py
--- abc/src/virtManager/asyncjob.py 2010-03-21 22:43:09.000000000 -0400
+++ virt-manager-0.8.3/src/virtManager/asyncjob.py 2010-03-21 22:44:22.000000000 -0400
@@ -25,25 +25,31 @@ import gtk.gdk
import gtk.glade
import gobject
-# Displays a progress bar while executing the "callback" method.
+from virtManager import util
-class vmmAsyncJob(gobject.GObject):
- # This thin wrapper only exists so we can put debugging
- # code in the run() method every now & then
- class asyncJobWorker(threading.Thread):
- def __init__(self, callback, args):
- threading.Thread.__init__(self, target=callback, args=args)
+# This thin wrapper only exists so we can put debugging
+# code in the run() method every now & then
+class asyncJobWorker(threading.Thread):
+ def __init__(self, callback, args):
+ threading.Thread.__init__(self, target=callback, args=args)
+
+ def run(self):
+ threading.Thread.run(self)
- def run(self):
- threading.Thread.run(self)
+# Displays a progress bar while executing the "callback" method.
+class vmmAsyncJob(gobject.GObject):
def __init__(self, config, callback, args=None,
text=_("Please wait a few moments..."),
- title=_("Operation in progress")):
+ title=_("Operation in progress"),
+ run_main=True):
self.__gobject_init__()
self.config = config
+ self.run_main = bool(run_main)
- self.window = gtk.glade.XML(config.get_glade_dir() + "/vmm-progress.glade", "vmm-progress", domain="virt-manager")
+ self.window = gtk.glade.XML(config.get_glade_dir() + \
+ "/vmm-progress.glade",
+ "vmm-progress", domain="virt-manager")
self.window.get_widget("pbar-text").set_text(text)
self.topwin = self.window.get_widget("vmm-progress")
@@ -52,20 +58,27 @@ class vmmAsyncJob(gobject.GObject):
# Callback sets this if there is an error
self._error_info = None
+ self._data = None
+
self.stage = self.window.get_widget("pbar-stage")
self.pbar = self.window.get_widget("pbar")
args.append(self)
- self.bg_thread = vmmAsyncJob.asyncJobWorker(callback, args)
+ self.bg_thread = asyncJobWorker(callback, args)
self.bg_thread.setDaemon(True)
self.is_pulsing = True
def run(self):
- timer = gobject.timeout_add (100, self.exit_if_necessary)
+ timer = gobject.timeout_add(100, self.exit_if_necessary)
self.topwin.present()
self.topwin.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH))
- self.bg_thread.start()
- gtk.main()
+
+ if self.run_main:
+ self.bg_thread.start()
+ gtk.main()
+ else:
+ self.bg_thread.run()
+
gobject.source_remove(timer)
timer = 0
@@ -74,7 +87,7 @@ class vmmAsyncJob(gobject.GObject):
# async dialog is running. This forces us to clean up properly
# and not leave a dead process around.
logging.debug("Forcing main_quit from async job.")
- self._exit_if_necessary(force_exit=True)
+ self.exit_if_necessary(force_exit=True)
self.topwin.destroy()
@@ -132,6 +145,11 @@ class vmmAsyncJob(gobject.GObject):
return (None, None)
return self._error_info
+ def set_data(self, data):
+ self._data = data
+ def get_data(self):
+ return self._data
+
def exit_if_necessary(self):
gtk.gdk.threads_enter()
try:
@@ -140,11 +158,15 @@ class vmmAsyncJob(gobject.GObject):
gtk.gdk.threads_leave()
def _exit_if_necessary(self, force_exit=False):
- if self.bg_thread.isAlive() and not force_exit:
- if(self.is_pulsing):
+ thread_active = (self.bg_thread.isAlive() or not self.run_main)
+
+ if thread_active and not force_exit:
+ if (self.is_pulsing):
+ # Don't call pulse_pbar: this function is thread wrapped
self.pbar.pulse()
return True
else:
- gtk.main_quit()
+ if self.run_main:
+ gtk.main_quit()
return False
# HG changeset patch
# User Cole Robinson <crobinso@redhat.com>
# Date 1267580154 18000
# Node ID a52c2654d7db28dca4e28f2170f23fea7a727b24
# Parent da1c162094663d6ffa474d6b2a05130277ec01dc
manager: Improve startup error when no default connection.
diff -r da1c16209466 -r a52c2654d7db src/virtManager/manager.py
--- a/src/virtManager/manager.py Tue Mar 02 12:18:48 2010 -0500
+++ b/src/virtManager/manager.py Tue Mar 02 20:35:54 2010 -0500
@@ -130,7 +130,6 @@
self.engine = engine
self.delete_dialog = None
- self.startup_error = None
self.ignore_pause = False
# Mapping of VM UUID -> tree model rows to
@@ -207,13 +206,13 @@
# Select first list entry
vmlist = self.window.get_widget("vm-list")
if len(vmlist.get_model()) == 0:
- self.startup_error = _("Could not populate a default connection. "
- "Make sure the appropriate virtualization "
- "packages are installed (kvm, qemu, etc.) "
- "and that libvirtd has been restarted to "
- "notice the changes.\n\n"
- "A hypervisor connection can be manually "
- "added via \nFile->Add Connection")
+ msg = _("Could not detect a default hypervisor. Make\n"
+ "sure the appropriate virtualization packages\n"
+ "are installed (kvm, qemu, libvirt, etc.), and\n"
+ "that libvirtd is running.\n\n"
+ "A hypervisor connection can be manually added\n"
+ "via File->Add Connection")
+ self.set_startup_error(msg)
else:
vmlist.get_selection().select_iter(vmlist.get_model().get_iter_first())
@@ -229,10 +228,6 @@
self.engine.increment_window_counter()
- if self.startup_error:
- self.err.val_err(_("Error determining default hypervisor."),
- self.startup_error, _("Startup Error"))
- self.startup_error = None
def close(self, src=None, src2=None):
if self.is_visible():
@@ -246,6 +241,9 @@
return 1
return 0
+ def set_startup_error(self, msg):
+ self.window.get_widget("vm-notebook").set_current_page(1)
+ self.window.get_widget("startup-error-label").set_text(msg)
################
# Init methods #
@@ -430,6 +428,7 @@
def init_vmlist(self):
vmlist = self.window.get_widget("vm-list")
+ self.window.get_widget("vm-notebook").set_show_tabs(False)
# Handle, name, markup, status, status icon, key/uuid, hint, is conn,
# is conn connected, is vm, is vm running, fg color
@@ -905,6 +904,9 @@
return _iter
def _add_connection(self, engine, conn):
+ # Make sure error page isn't showing
+ self.window.get_widget("vm-notebook").set_current_page(0)
+
if self.rows.has_key(conn.get_uri()):
return
diff -r da1c16209466 -r a52c2654d7db src/vmm-manager.glade
--- a/src/vmm-manager.glade Tue Mar 02 12:18:48 2010 -0500
+++ b/src/vmm-manager.glade Tue Mar 02 20:35:54 2010 -0500
@@ -342,23 +342,59 @@
</packing>
</child>
<child>
- <widget class="GtkScrolledWindow" id="scrolledwindow1">
+ <widget class="GtkNotebook" id="vm-notebook">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="hscrollbar_policy">automatic</property>
- <property name="vscrollbar_policy">automatic</property>
- <property name="shadow_type">in</property>
+ <property name="can_focus">True</property>
<child>
- <widget class="GtkTreeView" id="vm-list">
+ <widget class="GtkScrolledWindow" id="scrolledwindow1">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <signal name="button_press_event" handler="on_vm_list_button_press_event"/>
- <signal name="row_expanded" handler="on_vm_list_row_expanded"/>
- <signal name="key_press_event" handler="on_vm_list_key_press_event"/>
- <signal name="row_collapsed" handler="on_vm_list_row_collapsed"/>
- <signal name="row_activated" handler="on_vm_list_row_activated"/>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <widget class="GtkTreeView" id="vm-list">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <signal name="button_press_event" handler="on_vm_list_button_press_event"/>
+ <signal name="row_expanded" handler="on_vm_list_row_expanded"/>
+ <signal name="key_press_event" handler="on_vm_list_key_press_event"/>
+ <signal name="row_collapsed" handler="on_vm_list_row_collapsed"/>
+ <signal name="row_activated" handler="on_vm_list_row_activated"/>
+ </widget>
+ </child>
</widget>
</child>
+ <child>
+ <widget class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="label">manager</property>
+ </widget>
+ <packing>
+ <property name="tab_fill">False</property>
+ <property name="type">tab</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="startup-error-label">
+ <property name="visible">True</property>
+ <property name="label">error</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="label">error</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ <property name="tab_fill">False</property>
+ <property name="type">tab</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="position">1</property>
# HG changeset patch
# User Cole Robinson <crobinso@redhat.com>
# Date 1267550328 18000
# Node ID da1c162094663d6ffa474d6b2a05130277ec01dc
# Parent 7473bf514f915b537ba0d29550c6741fb5b72cac
engine: Remove redundant function
diff -r 7473bf514f91 -r da1c16209466 src/virtManager/engine.py
--- a/src/virtManager/engine.py Tue Mar 02 11:56:04 2010 -0500
+++ b/src/virtManager/engine.py Tue Mar 02 12:18:48 2010 -0500
@@ -137,9 +137,6 @@
self.connect_to_uri(uri)
def connect_to_uri(self, uri, readOnly=None, autoconnect=False):
- return self._connect_to_uri(None, uri, readOnly, autoconnect)
-
- def _connect_to_uri(self, connect, uri, readOnly, autoconnect):
self.windowConnect = None
try:
@@ -316,7 +313,7 @@
def show_connect(self):
if self.windowConnect == None:
self.windowConnect = vmmConnect(self.get_config(), self)
- self.windowConnect.connect("completed", self._connect_to_uri)
+ self.windowConnect.connect("completed", self.connect_to_uri)
self.windowConnect.connect("cancelled", self._connect_cancelled)
self.windowConnect.show()
# HG changeset patch
# User Cole Robinson <crobinso@redhat.com>
# Date 1267653530 18000
# Node ID 437cb7da4c9741ebbbf2baca7e90f3699eb2756d
# Parent 711c94d23f4c81e5997dfbeac6a30ae556b38c82
PackageKit integration for first start hypervisor detection
Check to make sure the expected local packages are installed for
the default connection (KVM).
diff -r 711c94d23f4c -r 437cb7da4c97 src/virt-manager.py.in
--- a/src/virt-manager.py.in Wed Mar 03 16:55:00 2010 -0500
+++ b/src/virt-manager.py.in Wed Mar 03 16:58:50 2010 -0500
@@ -203,17 +203,6 @@
return optParser.parse_args()
-def default_uri():
- tryuri = None
- if os.path.exists("/var/lib/xend") and os.path.exists("/proc/xen"):
- tryuri = "xen:///"
- elif (os.path.exists("/usr/bin/qemu") or
- os.path.exists("/usr/bin/qemu-kvm") or
- os.path.exists("/usr/bin/kvm")):
- tryuri = "qemu:///system"
-
- return tryuri
-
def launch_specific_window(engine, show, uri, uuid):
if not engine.wait_for_open(uri):
# Connection failed, don't attempt to continue
@@ -238,15 +227,10 @@
args=(engine, show, uri, uuid),
name="Launching '%s' window" % show)
thread.start()
+
elif show=='summary' or uri:
engine.connect_to_uri(uri)
else:
- if engine.config.get_connections() is None \
- or len(engine.config.get_connections()) == 0:
-
- tryuri = default_uri()
- if tryuri is not None:
- engine.add_connection(tryuri, autoconnect=True)
engine.show_manager()
if not no_conn_auto:
diff -r 711c94d23f4c -r 437cb7da4c97 src/virtManager/engine.py
--- a/src/virtManager/engine.py Wed Mar 03 16:55:00 2010 -0500
+++ b/src/virtManager/engine.py Wed Mar 03 16:58:50 2010 -0500
@@ -24,9 +24,11 @@
import logging
import traceback
import threading
+import os
import libvirt
import virtinst
+import dbus
from virtManager.about import vmmAbout
from virtManager.halhelper import vmmHalHelper
@@ -44,6 +46,149 @@
from virtManager.systray import vmmSystray
import virtManager.util as util
+
+# List of packages to look for via packagekit at first startup.
+# If this list is empty, no attempt to contact packagekit is made
+LIBVIRT_DAEMON = "libvirt"
+PACKAGEKIT_PACKAGES = [LIBVIRT_DAEMON, "qemu-system-x86"]
+
+
+def default_uri():
+ tryuri = None
+ if os.path.exists("/var/lib/xend") and os.path.exists("/proc/xen"):
+ tryuri = "xen:///"
+ elif (os.path.exists("/usr/bin/qemu") or
+ os.path.exists("/usr/bin/qemu-kvm") or
+ os.path.exists("/usr/bin/kvm")):
+ tryuri = "qemu:///system"
+
+ return tryuri
+
+#############################
+# PackageKit lookup helpers #
+#############################
+
+def check_packagekit(config, errbox):
+ """
+ Returns None when we determine nothing useful.
+ Returns (success, did we just install libvirt) otherwise.
+ """
+ if not PACKAGEKIT_PACKAGES:
+ return
+
+ logging.debug("Asking PackageKit what's installed locally.")
+ try:
+ session = dbus.SystemBus()
+
+ pk_control = dbus.Interface(
+ session.get_object("org.freedesktop.PackageKit",
+ "/org/freedesktop/PackageKit"),
+ "org.freedesktop.PackageKit")
+ except Exception:
+ logging.exception("Couldn't connect to packagekit")
+ return
+
+ found = []
+ progWin = vmmAsyncJob(config, _do_async_search,
+ [session, pk_control],
+ _("Searching for available hypervisors..."),
+ run_main=False)
+ progWin.run()
+ error, ignore = progWin.get_error()
+ if error:
+ return
+
+ found = progWin.get_data()
+
+ not_found = filter(lambda x: x not in found, PACKAGEKIT_PACKAGES)
+ logging.debug("Missing packages: %s" % not_found)
+
+ do_install = not_found
+ if not do_install:
+ if not not_found:
+ # Got everything we wanted, try to connect
+ logging.debug("All packages found locally.")
+ return (True, False)
+
+ else:
+ logging.debug("No packages are available for install.")
+ return
+
+ msg = (_("The following packages are not installed:\n%s\n\n"
+ "These are required to create KVM guests locally.\n"
+ "Would you like to install them now?") %
+ reduce(lambda x, y: x + "\n" + y, do_install, ""))
+
+ ret = errbox.yes_no(_("Packages required for KVM usage"), msg)
+
+ if not ret:
+ logging.debug("Package install declined.")
+ return
+
+ try:
+ packagekit_install(do_install)
+ except Exception, e:
+ errbox.show_err(_("Error talking to PackageKit: %s") % str(e),
+ "".join(traceback.format_exc()))
+ return
+
+ return (True, LIBVIRT_DAEMON in do_install)
+
+def _do_async_search(session, pk_control, asyncjob):
+ found = []
+ try:
+ for name in PACKAGEKIT_PACKAGES:
+ ret_found = packagekit_search(session, pk_control, name)
+ found += ret_found
+
+ except Exception, e:
+ logging.exception("Error searching for installed packages")
+ asyncjob.set_error(str(e), "".join(traceback.format_exc()))
+
+ asyncjob.set_data(found)
+
+def packagekit_install(package_list):
+ session = dbus.SessionBus()
+
+ pk_control = dbus.Interface(
+ session.get_object("org.freedesktop.PackageKit",
+ "/org/freedesktop/PackageKit"),
+ "org.freedesktop.PackageKit.Modify")
+
+ logging.debug("Installing packages: %s" % package_list)
+ pk_control.InstallPackageNames(0, package_list, "hide-confirm-search")
+
+def packagekit_search(session, pk_control, package_name):
+ tid = pk_control.GetTid()
+ pk_trans = dbus.Interface(
+ session.get_object("org.freedesktop.PackageKit", tid),
+ "org.freedesktop.PackageKit.Transaction")
+
+ found = []
+ def package(info, package_id, summary):
+ found_name = str(package_id.split(";")[0])
+ if found_name in PACKAGEKIT_PACKAGES:
+ found.append(found_name)
+
+ def error(code, details):
+ raise RuntimeError("PackageKit search failure: %s %s" %
+ (code, details))
+
+ def finished(ignore, runtime):
+ gtk.main_quit()
+
+ pk_trans.connect_to_signal('Finished', finished)
+ pk_trans.connect_to_signal('ErrorCode', error)
+ pk_trans.connect_to_signal('Package', package)
+ pk_trans.SearchNames("installed", [package_name])
+
+ # Call main() so this function is synchronous
+ gtk.main()
+
+ return found
+
+
+
class vmmEngine(gobject.GObject):
__gsignals__ = {
"connection-added": (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
@@ -96,6 +241,7 @@
self.load_stored_uris()
self.tick()
+
def init_systray(self):
if self.systray:
return
@@ -123,6 +269,60 @@
self.hal_helper = vmmHalHelper()
return self.hal_helper
+
+ # First run helpers
+
+ def add_default_connection(self):
+ # Only add default if no connections are currently known
+ if self.config.get_connections():
+ return
+
+ # Manager fail message
+ msg = _("Could not detect a default hypervisor. Make\n"
+ "sure the appropriate virtualization packages\n"
+ "are installed (kvm, qemu, libvirt, etc.), and\n"
+ "that libvirtd is running.\n\n"
+ "A hypervisor connection can be manually\n"
+ "added via File->Add Connection")
+
+ manager = self.get_manager()
+ logging.debug("Determining default libvirt URI")
+
+ ret = None
+ did_install_libvirt = False
+ try:
+ ret = check_packagekit(self.config, self.err)
+ except:
+ logging.exception("Error talking to PackageKit")
+
+ if ret:
+ # We found the default packages via packagekit: use default URI
+ ignore, did_install_libvirt = ret
+ tryuri = "qemu:///system"
+
+ else:
+ tryuri = default_uri()
+
+ if tryuri is None:
+ manager.set_startup_error(msg)
+ return
+
+ if did_install_libvirt:
+ warnmsg = _(
+ "Libvirt was just installed, so the 'libvirtd' service will\n"
+ "will need to be started. This can be done with one \n"
+ "of the following:\n\n"
+ "- From GNOME menus: System->Administration->Services\n"
+ "- From the terminal: su -c 'service libvirtd restart'\n"
+ "- Restart your computer\n\n"
+ "virt-manager will connect to libvirt on the next application\n"
+ "start up.")
+ self.err.ok(_("Libvirt service must be started"), warnmsg)
+
+ self.connect_to_uri(tryuri, autoconnect=True,
+ do_start=not did_install_libvirt)
+
+
def load_stored_uris(self):
uris = self.config.get_connections()
if uris != None:
@@ -136,7 +336,8 @@
if conn.get_autoconnect():
self.connect_to_uri(uri)
- def connect_to_uri(self, uri, readOnly=None, autoconnect=False):
+ def connect_to_uri(self, uri, readOnly=None, autoconnect=False,
+ do_start=True):
self.windowConnect = None
try:
@@ -146,7 +347,8 @@
conn = self.add_connection(uri, readOnly, autoconnect)
self.show_manager()
- conn.open()
+ if do_start:
+ conn.open()
return conn
except Exception:
return None
diff -r 711c94d23f4c -r 437cb7da4c97 src/virtManager/error.py
--- a/src/virtManager/error.py Wed Mar 03 16:55:00 2010 -0500
+++ b/src/virtManager/error.py Wed Mar 03 16:58:50 2010 -0500
@@ -145,6 +145,9 @@
def ok_cancel(self, text1, text2=None):
return self._show_warning(gtk.BUTTONS_OK_CANCEL, text1, text2)
+ def ok(self, text1, text2=None):
+ return self._show_warning(gtk.BUTTONS_OK, text1, text2)
+
def warn_chkbox(self, text1, text2=None, chktext=None, buttons=None):
chkbox = vmmCheckDialog(self.get_transient_for(),
gtk.MESSAGE_WARNING, buttons)
diff -r 711c94d23f4c -r 437cb7da4c97 src/virtManager/manager.py
--- a/src/virtManager/manager.py Wed Mar 03 16:55:00 2010 -0500
+++ b/src/virtManager/manager.py Wed Mar 03 16:58:50 2010 -0500
@@ -21,6 +21,7 @@
import gobject
import gtk
import gtk.glade
+
import logging
import traceback
@@ -205,16 +206,12 @@
# Select first list entry
vmlist = self.window.get_widget("vm-list")
- if len(vmlist.get_model()) == 0:
- msg = _("Could not detect a default hypervisor. Make\n"
- "sure the appropriate virtualization packages\n"
- "are installed (kvm, qemu, libvirt, etc.), and\n"
- "that libvirtd is running.\n\n"
- "A hypervisor connection can be manually added\n"
- "via File->Add Connection")
- self.set_startup_error(msg)
- else:
- vmlist.get_selection().select_iter(vmlist.get_model().get_iter_first())
+ if len(vmlist.get_model()) != 0:
+ vmlist.get_selection().select_iter(
+ vmlist.get_model().get_iter_first())
+
+ # Queue up the default connection detector
+ gobject.idle_add(self.engine.add_default_connection)
##################
# Common methods #
@@ -228,7 +225,6 @@
self.engine.increment_window_counter()
-
def close(self, src=None, src2=None):
if self.is_visible():
win = self.window.get_widget("vmm-manager")

View File

@ -1,173 +0,0 @@
# HG changeset patch
# User Cole Robinson <crobinso@redhat.com>
# Date 1268858510 14400
# Node ID fc1360e7ded9029e6b5ad3e9eadc0f694f5d5b52
# Parent 91818a16657ccc11abe20179691ce7ca2127d05a
Attempt to 'fake' reboot if it isn't supported
We do this by attempting vm.shutdown(), followed by a vm.start() when
the vm actually stops. Any manual 'shutdown' or 'destroy' call will undo
the reboot command, similar to how xen acts (on RHEL5 at least).
diff -r 91818a16657c -r fc1360e7ded9 src/virtManager/domain.py
--- a/src/virtManager/domain.py Wed Mar 17 08:49:06 2010 +0000
+++ b/src/virtManager/domain.py Wed Mar 17 16:41:50 2010 -0400
@@ -1231,7 +1233,47 @@
def disk_write_rate(self):
return self._get_record_helper("diskWrRate")
+ def _unregister_reboot_listener(self):
+ if self.reboot_listener == None:
+ return
+
+ try:
+ self.disconnect(self.reboot_listener)
+ self.reboot_listener = None
+ except:
+ pass
+
+ def manual_reboot(self):
+ # Attempt a manual reboot via 'shutdown' followed by startup
+ def reboot_listener(vm, ignore1, self):
+ if vm.is_crashed():
+ # Abandon reboot plans
+ self.reboot_listener = None
+ return True
+
+ if not vm.is_shutoff():
+ # Not shutoff, continue waiting
+ return
+
+ try:
+ logging.debug("Fake reboot detected shutdown. Restarting VM")
+ vm.startup()
+ except:
+ logging.exception("Fake reboot startup failed")
+
+ self.reboot_listener = None
+ return True
+
+ self._unregister_reboot_listener()
+
+ # Request a shutdown
+ self.shutdown()
+
+ self.reboot_listener = util.connect_opt_out(self, "status-changed",
+ reboot_listener, self)
+
def shutdown(self):
+ self._unregister_reboot_listener()
self._backend.shutdown()
self._update_status()
@@ -1265,7 +1307,9 @@
self._update_status()
def destroy(self):
+ self._unregister_reboot_listener()
self._backend.destroy()
+ self._update_status()
def interfaceStats(self, device):
return self._backend.interfaceStats(device)
diff -r 91818a16657c -r fc1360e7ded9 src/virtManager/engine.py
--- a/src/virtManager/engine.py Wed Mar 17 08:49:06 2010 +0000
+++ b/src/virtManager/engine.py Wed Mar 17 16:41:50 2010 -0400
@@ -834,10 +834,30 @@
self.config.set_confirm_poweroff(not skip_prompt)
logging.debug("Rebooting vm '%s'." % vm.get_name())
+ no_support = False
+ reboot_err = None
try:
vm.reboot()
- except Exception, e:
- self.err.show_err(_("Error shutting down domain: %s" % str(e)),
+ except Exception, reboot_err:
+ no_support = virtinst.support.is_error_nosupport(reboot_err)
+ if not no_support:
+ self.err.show_err(_("Error rebooting domain: %s" %
+ str(reboot_err)),
+ "".join(traceback.format_exc()))
+
+ if not no_support:
+ return
+
+ # Reboot isn't supported. Let's try to emulate it
+ logging.debug("Hypervisor doesn't support reboot, let's fake it")
+ try:
+ vm.manual_reboot()
+ except:
+ logging.exception("Could not fake a reboot")
+
+ # Raise the original error message
+ self.err.show_err(_("Error rebooting domain: %s" %
+ str(reboot_err)),
"".join(traceback.format_exc()))
def migrate_domain(self, uri, uuid):
diff -rup old/src/virtManager/domain.py virt-manager-0.8.3/src/virtManager/domain.py
--- old/src/virtManager/domain.py 2010-03-21 22:10:03.000000000 -0400
+++ virt-manager-0.8.3/src/virtManager/domain.py 2010-03-21 22:10:41.000000000 -0400
@@ -1145,6 +1145,8 @@ class vmmDomain(vmmDomainBase):
self.toggle_sample_network_traffic()
self.toggle_sample_disk_io()
+ self.reboot_listener = None
+
# Determine available XML flags (older libvirt versions will error
# out if passed SECURE_XML, INACTIVE_XML, etc)
self._set_dom_flags()
diff -r c9d3c8dec04f -r 976f202f5dbd src/virtManager/util.py
--- a/src/virtManager/util.py Sat Feb 27 10:42:43 2010 -0500
+++ b/src/virtManager/util.py Sun Feb 28 19:40:06 2010 -0500
@@ -240,6 +240,33 @@
return label
+def connect_once(obj, signal, func, *args):
+ id_list = []
+
+ def wrap_func(*wrapargs):
+ if id_list:
+ obj.disconnect(id_list[0])
+
+ return func(*wrapargs)
+
+ conn_id = obj.connect(signal, wrap_func, *args)
+ id_list.append(conn_id)
+
+ return conn_id
+
+def connect_opt_out(obj, signal, func, *args):
+ id_list = []
+
+ def wrap_func(*wrapargs):
+ ret = func(*wrapargs)
+ if ret and id_list:
+ obj.disconnect(id_list[0])
+
+ conn_id = obj.connect(signal, wrap_func, *args)
+ id_list.append(conn_id)
+
+ return conn_id
+
def idle_emit(self, signal, *args):
"""
Safe wrapper for using 'self.emit' with gobject.idle_add
diff -rup virt-manager-0.8.3/src/virtManager/domain.py new/src/virtManager/domain.py
--- virt-manager-0.8.3/src/virtManager/domain.py 2010-03-22 10:57:56.526155000 -0400
+++ new/src/virtManager/domain.py 2010-03-22 11:05:35.723429000 -0400
@@ -1025,6 +1025,12 @@ class vmmDomainBase(gobject.GObject):
def disk_io_vector_limit(self, limit):
return self.in_out_vector_limit(self.disk_io_vector(), limit)
+ def is_shutoff(self):
+ return self.status() == libvirt.VIR_DOMAIN_SHUTOFF
+
+ def is_crashed(self):
+ return self.status() == libvirt.VIR_DOMAIN_CRASHED
+
def is_stoppable(self):
return self.status() in [libvirt.VIR_DOMAIN_RUNNING,
libvirt.VIR_DOMAIN_PAUSED]

View File

@ -1,52 +0,0 @@
# HG changeset patch
# User Cole Robinson <crobinso@redhat.com>
# Date 1266002236 18000
# Node ID 831fa7210e0467ddd9039cc9f372f11b2b22c5b5
# Parent 9fb5880026535f6e373d3487ab31069eeae51489
create: Allow using a manually created 'default' pool
diff -r 9fb588002653 -r 831fa7210e04 src/virtManager/create.py
--- a/src/virtManager/create.py Fri Feb 12 14:01:59 2010 -0500
+++ b/src/virtManager/create.py Fri Feb 12 14:17:16 2010 -0500
@@ -454,7 +454,6 @@
self.usepool = False
try:
if is_storage_capable:
- # FIXME: Emit 'pool-added' or something?
util.build_default_pool(self.conn.vmm)
self.usepool = True
except Exception, e:
@@ -845,7 +844,6 @@
return self.failed_guest.disks[0].path
if not self.usepool:
-
# Use old generating method
d = self.config.get_default_image_dir(self.conn)
origf = os.path.join(d, name + ".img")
@@ -860,12 +858,22 @@
f = origf
path = f
+
else:
- pool = self.conn.vmm.storagePoolLookupByName(util.DEFAULT_POOL_NAME)
+ pool = None
+ for uuid in self.conn.list_pool_uuids():
+ p = self.conn.get_pool(uuid)
+ if p.get_name() == util.DEFAULT_POOL_NAME:
+ pool = p
+
+ if not pool:
+ raise RuntimeError(_("Did not find pool '%s'") %
+ util.DEFAULT_POOL_NAME)
+
path = virtinst.Storage.StorageVolume.find_free_name(name,
- pool_object=pool, suffix=".img")
+ pool_object=pool.pool, suffix=".img")
- path = os.path.join(util.DEFAULT_POOL_PATH, path)
+ path = os.path.join(pool.get_target_path(), path)
return path

File diff suppressed because it is too large Load Diff

View File

@ -1,244 +0,0 @@
# HG changeset patch
# User Cole Robinson <crobinso@redhat.com>
# Date 1266952692 18000
# Node ID 962e52a4b4c0441eb5e9e8aeb1bb17597282579c
# Parent 4e4e674d4921264cfe376ed48dcab10c8d3a3b69
Drop redundant calls to window.show()
diff -r 4e4e674d4921 -r 962e52a4b4c0 src/virtManager/about.py
--- a/src/virtManager/about.py Tue Feb 23 09:03:13 2010 +0000
+++ b/src/virtManager/about.py Tue Feb 23 14:18:12 2010 -0500
@@ -48,7 +48,6 @@
def show(self):
dialog = self.window.get_widget("vmm-about")
dialog.set_version(self.config.get_appversion())
- dialog.show_all()
dialog.present()
def close(self,ignore1=None,ignore2=None):
diff -r 4e4e674d4921 -r 962e52a4b4c0 src/virtManager/addhardware.py
--- a/src/virtManager/addhardware.py Tue Feb 23 09:03:13 2010 +0000
+++ b/src/virtManager/addhardware.py Tue Feb 23 14:18:12 2010 -0500
@@ -166,7 +166,6 @@
def show(self):
self.reset_state()
- self.topwin.show()
self.topwin.present()
def close(self, ignore1=None,ignore2=None):
diff -r 4e4e674d4921 -r 962e52a4b4c0 src/virtManager/clone.py
--- a/src/virtManager/clone.py Tue Feb 23 09:03:13 2010 +0000
+++ b/src/virtManager/clone.py Tue Feb 23 14:18:12 2010 -0500
@@ -140,7 +140,6 @@
def show(self):
self.reset_state()
- self.topwin.show()
self.topwin.present()
def close(self, ignore1=None, ignore2=None):
diff -r 4e4e674d4921 -r 962e52a4b4c0 src/virtManager/connect.py
--- a/src/virtManager/connect.py Tue Feb 23 09:03:13 2010 +0000
+++ b/src/virtManager/connect.py Tue Feb 23 14:18:12 2010 -0500
@@ -108,7 +108,6 @@
def show(self):
win = self.window.get_widget("vmm-open-connection")
- win.show_all()
win.present()
self.reset_state()
diff -r 4e4e674d4921 -r 962e52a4b4c0 src/virtManager/createinterface.py
--- a/src/virtManager/createinterface.py Tue Feb 23 09:03:13 2010 +0000
+++ b/src/virtManager/createinterface.py Tue Feb 23 14:18:12 2010 -0500
@@ -124,7 +124,6 @@
def show(self):
self.reset_state()
- self.topwin.show()
self.topwin.present()
def show_bond_config(self, src):
diff -r 4e4e674d4921 -r 962e52a4b4c0 src/virtManager/createnet.py
--- a/src/virtManager/createnet.py Tue Feb 23 09:03:13 2010 +0000
+++ b/src/virtManager/createnet.py Tue Feb 23 14:18:12 2010 -0500
@@ -82,7 +82,6 @@
self.set_initial_state()
def show(self):
- self.topwin.show()
self.reset_state()
self.topwin.present()
diff -r 4e4e674d4921 -r 962e52a4b4c0 src/virtManager/createpool.py
--- a/src/virtManager/createpool.py Tue Feb 23 09:03:13 2010 +0000
+++ b/src/virtManager/createpool.py Tue Feb 23 14:18:12 2010 -0500
@@ -115,7 +115,6 @@
self.set_initial_state()
def show(self):
- self.topwin.show()
self.reset_state()
self.topwin.present()
diff -r 4e4e674d4921 -r 962e52a4b4c0 src/virtManager/createvol.py
--- a/src/virtManager/createvol.py Tue Feb 23 09:03:13 2010 +0000
+++ b/src/virtManager/createvol.py Tue Feb 23 14:18:12 2010 -0500
@@ -89,7 +89,6 @@
def show(self):
self.reset_state()
- self.topwin.show()
self.topwin.present()
def close(self, ignore1=None, ignore2=None):
diff -r 4e4e674d4921 -r 962e52a4b4c0 src/virtManager/delete.py
--- a/src/virtManager/delete.py Tue Feb 23 09:03:13 2010 +0000
+++ b/src/virtManager/delete.py Tue Feb 23 14:18:12 2010 -0500
@@ -85,7 +85,6 @@
def show(self):
self.reset_state()
- self.topwin.show()
self.topwin.present()
def close(self, ignore1=None, ignore2=None):
diff -r 4e4e674d4921 -r 962e52a4b4c0 src/virtManager/details.py
--- a/src/virtManager/details.py Tue Feb 23 09:03:13 2010 +0000
+++ b/src/virtManager/details.py Tue Feb 23 14:18:12 2010 -0500
@@ -302,7 +302,6 @@
if self.is_visible():
self.topwin.present()
return
- self.topwin.show()
self.topwin.present()
self.engine.increment_window_counter()
diff -r 4e4e674d4921 -r 962e52a4b4c0 src/virtManager/domain.py
--- a/src/virtManager/domain.py Tue Feb 23 09:03:13 2010 +0000
+++ b/src/virtManager/domain.py Tue Feb 23 14:18:12 2010 -0500
@@ -134,7 +134,7 @@
def set_autostart(self, val):
raise NotImplementedError()
- def attach_device(self, devobj):
+ def attach_device(self, devobj, devxml=None):
raise NotImplementedError()
def detach_device(self, devtype, dev_id_info):
raise NotImplementedError()
@@ -1314,13 +1314,17 @@
def get_id(self):
return self._backend.ID()
- def attach_device(self, devobj):
+ def attach_device(self, devobj, devxml=None):
"""
Hotplug device to running guest
"""
- if self.is_active():
- xml = devobj.get_xml_config()
- self._backend.attachDevice(xml)
+ if not self.is_active():
+ return
+
+ if not devxml:
+ devxml = devobj.get_xml_config()
+
+ self._backend.attachDevice(devxml)
def detach_device(self, devtype, dev_id_info):
"""
@@ -1591,7 +1595,7 @@
ignore, diskxml = util.xml_parse_wrapper(self.get_xml(), func,
dev_id_info, newpath, _type)
- self.attach_device(diskxml)
+ self.attach_device(None, diskxml)
# VCPU changing
def define_vcpus(self, vcpus):
diff -r 4e4e674d4921 -r 962e52a4b4c0 src/virtManager/host.py
--- a/src/virtManager/host.py Tue Feb 23 09:03:13 2010 +0000
+++ b/src/virtManager/host.py Tue Feb 23 14:18:12 2010 -0500
@@ -294,8 +294,10 @@
def show(self):
- dialog = self.window.get_widget("vmm-host")
- dialog.present()
+ if self.is_visible():
+ self.topwin.present()
+ return
+ self.topwin.present()
self.engine.increment_window_counter()
diff -r 4e4e674d4921 -r 962e52a4b4c0 src/virtManager/manager.py
--- a/src/virtManager/manager.py Tue Feb 23 09:03:13 2010 +0000
+++ b/src/virtManager/manager.py Tue Feb 23 14:18:12 2010 -0500
@@ -124,6 +124,8 @@
0, gtk.MESSAGE_ERROR, gtk.BUTTONS_CLOSE,
_("Unexpected Error"),
_("An unexpected error occurred"))
+ self.topwin = self.window.get_widget("vmm-manager")
+
self.config = config
self.engine = engine
@@ -136,8 +138,7 @@
self.rows = {}
w, h = self.config.get_manager_window_size()
- self.window.get_widget("vmm-manager").set_default_size(w or 550,
- h or 550)
+ self.topwin.set_default_size(w or 550, h or 550)
self.init_vmlist()
self.init_stats()
@@ -221,12 +222,11 @@
##################
def show(self):
- win = self.window.get_widget("vmm-manager")
if self.is_visible():
- win.present()
+ self.topwin.present()
return
- win.show()
- win.present()
+ self.topwin.present()
+
self.engine.increment_window_counter()
if self.startup_error:
diff -r 4e4e674d4921 -r 962e52a4b4c0 src/virtManager/preferences.py
--- a/src/virtManager/preferences.py Tue Feb 23 09:03:13 2010 +0000
+++ b/src/virtManager/preferences.py Tue Feb 23 14:18:12 2010 -0500
@@ -37,7 +37,6 @@
self.config = config
self.topwin = self.window.get_widget("vmm-preferences")
- self.topwin.hide()
self.config.on_view_system_tray_changed(self.refresh_view_system_tray)
self.config.on_console_popup_changed(self.refresh_console_popup)
@@ -102,7 +101,6 @@
return 1
def show(self):
- self.topwin.show()
self.topwin.present()
#########################
diff -r 4e4e674d4921 -r 962e52a4b4c0 src/virtManager/storagebrowse.py
--- a/src/virtManager/storagebrowse.py Tue Feb 23 09:03:13 2010 +0000
+++ b/src/virtManager/storagebrowse.py Tue Feb 23 14:18:12 2010 -0500
@@ -90,7 +90,6 @@
def show(self, conn=None):
self.reset_state(conn)
- self.topwin.show()
self.topwin.present()
def close(self, ignore1=None, ignore2=None):

View File

@ -0,0 +1,14 @@
diff -rup virt-manager-0.8.4/src/virtManager/engine.py new/src/virtManager/engine.py
--- virt-manager-0.8.4/src/virtManager/engine.py 2010-03-24 11:21:39.000000000 -0400
+++ new/src/virtManager/engine.py 2010-03-24 19:57:56.000000000 -0400
@@ -49,8 +49,8 @@ import virtManager.util as util
# List of packages to look for via packagekit at first startup.
# If this list is empty, no attempt to contact packagekit is made
-LIBVIRT_DAEMON = ""
-HV_PACKAGE = ""
+LIBVIRT_DAEMON = "libvirt"
+HV_PACKAGE = "qemu-system-x86"
OTHER_PACKAGES = []
PACKAGEKIT_PACKAGES = []

View File

@ -0,0 +1,12 @@
diff -rup virt-manager-0.8.1/src/virtManager/uihelpers.py new/src/virtManager/uihelpers.py
--- virt-manager-0.8.1/src/virtManager/uihelpers.py 2009-12-03 16:15:01.000000000 -0500
+++ new/src/virtManager/uihelpers.py 2009-12-03 17:15:09.101994000 -0500
@@ -38,7 +38,7 @@ OPTICAL_MEDIA_KEY = 4
# may use a nonroot user, so simply changing this will cause several UI
# pieces to attempt to verify that permissions are correct. Eventually this
# should be exposed via capabilities so we can determine this programmatically.
-QEMU_SYSTEM_EMULATOR_USER = "root"
+QEMU_SYSTEM_EMULATOR_USER = "qemu"
##############################################################
# Initialize an error object to use for validation functions #

View File

@ -7,8 +7,8 @@
%define _extra_release %{?dist:%{dist}}%{!?dist:%{?extra_release:%{extra_release}}} %define _extra_release %{?dist:%{dist}}%{!?dist:%{?extra_release:%{extra_release}}}
Name: virt-manager Name: virt-manager
Version: 0.8.3 Version: 0.8.4
Release: 2%{_extra_release} Release: 1%{_extra_release}
Summary: Virtual Machine Manager Summary: Virtual Machine Manager
Group: Applications/Emulators Group: Applications/Emulators
@ -20,15 +20,7 @@ BuildArch: noarch
# Check QEMU permissions against the qemu user # Check QEMU permissions against the qemu user
Patch1: %{name}-%{version}-perms-qemu-user.patch Patch1: %{name}-%{version}-perms-qemu-user.patch
# Fix using a manual 'default' pool (bz 557020) # Fix using a manual 'default' pool (bz 557020)
Patch2: %{name}-%{version}-manual-default-pool.patch Patch2: %{name}-%{version}-packagekit-packages.patch
# Don't force grab focus when app is run (bz 548430)
Patch3: %{name}-%{version}-stop-focus-grab.patch
# Check packagekit for KVM and libvirtd (bz 513494)
Patch4: %{name}-%{version}-check-packagekit.patch
# Fake a reboot implementation if libvirt doesn't support it (bz 532216)
Patch5: %{name}-%{version}-fake-reboot.patch
# Mark some strings as translatable (bz 572645)
Patch6: %{name}-%{version}-mark-translatable-strings.patch
# These two are just the oldest version tested # These two are just the oldest version tested
Requires: pygtk2 >= 1.99.12-6 Requires: pygtk2 >= 1.99.12-6
@ -48,7 +40,7 @@ Requires: gnome-python2-gnomekeyring >= 2.15.4
# Minimum we've tested with # Minimum we've tested with
Requires: libxml2-python >= 2.6.23 Requires: libxml2-python >= 2.6.23
# Required to install Xen & QEMU guests # Required to install Xen & QEMU guests
Requires: python-virtinst >= 0.500.2 Requires: python-virtinst >= 0.500.3
# Required for loading the glade UI # Required for loading the glade UI
Requires: pygtk2-libglade Requires: pygtk2-libglade
# Required for our graphics which are currently SVG format # Required for our graphics which are currently SVG format
@ -89,10 +81,6 @@ management API.
%setup -q %setup -q
%patch1 -p1 %patch1 -p1
%patch2 -p1 %patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%build %build
%configure %configure
@ -154,6 +142,11 @@ fi
%{_datadir}/%{name}/pixmaps/*.png %{_datadir}/%{name}/pixmaps/*.png
%{_datadir}/%{name}/pixmaps/*.svg %{_datadir}/%{name}/pixmaps/*.svg
%dir %{_datadir}/%{name}/pixmaps/hicolor/
%dir %{_datadir}/%{name}/pixmaps/hicolor/*/
%dir %{_datadir}/%{name}/pixmaps/hicolor/*/*/
%{_datadir}/%{name}/pixmaps/hicolor/*/*/*.png
%dir %{_datadir}/%{name}/virtManager/ %dir %{_datadir}/%{name}/virtManager/
%{_datadir}/%{name}/virtManager/*.py %{_datadir}/%{name}/virtManager/*.py
%{_datadir}/%{name}/virtManager/*.pyc %{_datadir}/%{name}/virtManager/*.pyc
@ -166,6 +159,14 @@ fi
%{_datadir}/dbus-1/services/%{name}.service %{_datadir}/dbus-1/services/%{name}.service
%changelog %changelog
* Wed Mar 24 2010 Cole Robinson <crobinso@redhat.com> - 0.8.4-1.fc14
- Update to version 0.8.4
- 'Import' install option, to create a VM around an existing OS image
- Support multiple boot devices and boot order
- Watchdog device support
- Enable setting a human readable VM description.
- Option to manually specifying a bridge name, if bridge isn't detected
* Mon Mar 22 2010 Cole Robinson <crobinso@redhat.com> - 0.8.3-2.fc14 * Mon Mar 22 2010 Cole Robinson <crobinso@redhat.com> - 0.8.3-2.fc14
- Fix using a manual 'default' pool (bz 557020) - Fix using a manual 'default' pool (bz 557020)
- Don't force grab focus when app is run (bz 548430) - Don't force grab focus when app is run (bz 548430)