Commit eaef94b8 authored by Guido Günther's avatar Guido Günther

Merge branch 'upstream'

parents a3367d8f 205082fa
......@@ -28,6 +28,7 @@ Further patches have been submitted by:
Bernhard Kaindl <bk-at-suse-dot-de>
Eduardo Habkost <ehabkost-at-redhat-dot-com>
Dan Hork <dan-at-danny-dot-cz>
Soren Hansen <soren-at-ubuntu-dot-com>
<...send a patch & get your name here...>
......
2008-03-10 "Daniel P. Berrange <berrange@redhat.com>
* NEWS, configure.ac, virt-manager.spec.in:
Update for new release
[81d87628fd7b] [tip]
* src/virtManager/create.py:
Fix disk field visibility
[2ccd1c5ccd1a]
2008-03-09 "Daniel P. Berrange <berrange@redhat.com>
* src/virtManager/connection.py, src/virtManager/create.py, src/vmm-
create.glade, virt-manager.spec.in:
Control create wizard state based on capabilities info
[215779fe46c6]
2008-03-07 "Daniel P. Berrange <berrange@redhat.com>
* src/virtManager/console.py, src/vmm-console.glade:
Enable VNC window scaling
[9ef26db66b0b]
2008-03-06 "Cole Robinson <crobinso@redhat.com>
* src/virtManager/details.py:
Have max memory consider current mem allocation when altered
directly (Adam Stokes)
[1f1ee216fcef]
* src/virtManager/details.py, src/virtManager/domain.py, src/vmm-
details.glade:
Add autostart and boot device selection support.
[4770f435ab01]
2008-03-05 "Daniel P. Berrange <berrange@redhat.com>
* src/virtManager/connection.py:
Merge heads
[0b213f9406fd]
2008-03-04 "Cole Robinson <crobinso@redhat.com>
* src/virtManager/domain.py:
Actually fix cdrom connect/disconnect error reporting
[4d2416cd81ec]
* src/virtManager/host.py:
Don't allow adding virtual networks is we are disconnected.
[35372d4a6ffa]
2008-03-03 "Cole Robinson <crobinso@redhat.com>
* src/virtManager/connection.py:
Fix typo in creds scanning.
[7fcbb49d9add]
2008-02-28 "Cole Robinson <crobinso@redhat.com>
* src/virtManager/domain.py:
Raise cdrom connect/disconnect failures.
[191b7b0e2f21]
* src/virtManager/details.py:
Raise previously ignored exceptions in widget update function.
[49bba0b0389d]
2008-02-25 "Cole Robinson <crobinso@redhat.com>
* src/virt-manager.py.in:
Add custom libvirt error handler.
The handler will ignore all libvirt _errors_, as these should be
dealt with as exceptions. This will also prevent libvirt errors from
being printed to the console when an exception is deliberately
ignored. All other libvirt messages (warnings) will be logged.
[bc4b197cdc1f]
* src/virtManager/manager.py:
Fix delete button sensitivity if selected guest is shutdown.
[dc9c723e13ff]
2008-02-22 "Cole Robinson <crobinso@redhat.com>
* src/virtManager/domain.py:
Check vm maxmem directly before we set current mem value. (Thanks
Adam Stokes)
Prevents a race when we set maxmem and current mem to new values at
the same time. Maxmem isn't updated in time, so we check the vm info
directly when setting the current mem to get the most up to date
value.
[8a68171fe280]
2008-02-21 "Cole Robinson <crobinso@redhat.com>
* src/virtManager/addhardware.py:
Only offer SCSI disk option for xen hvm: qemu doesn't like sd*
disks.
[1eeb1546b21b]
2008-02-22 "Cole Robinson <crobinso@redhat.com>
* src/virtManager/connection.py:
Reuse virtinst.util.get_max_vcpus
[f46dcf034d35]
2008-03-05 "Daniel P. Berrange <berrange@redhat.com>
* src/virtManager/connection.py, src/virtManager/console.py,
src/virtManager/create.py, src/virtManager/createnet.py,
src/virtManager/opticalhelper.py:
Fix use of DBus objects to always go via an explicit interface
[43d82ba67ffa]
2008-02-23 "Daniel P. Berrange <berrange@redhat.com>
* src/virtManager/connection.py:
Force connection to readonly if non-root and local HV uri and no
policykit (Saori Fukuta)
[d1c6390bbea9]
* Merge heads
[01c1acc34b1c]
2008-02-21 "Daniel P. Berrange <berrange@redhat.com>
* src/virtManager/connection.py:
Skip bonding if /sys/class/net/bonding_masters doesn't exist
(Shigeki Sakamoto)
[5c86a029ee3a]
2008-02-23 "Daniel P. Berrange <berrange@redhat.com>
* src/virtManager/create.py, src/vmm-create.glade:
Allow choice between local CDROM & kernel/initrd network install for
fullvirt guests
[ea6903353938]
2008-02-18 "Daniel P. Berrange <berrange@redhat.com>
* Merge heads
[07ff9bffe54d]
* src/virtManager/connection.py:
Support bonding & VLAN devices for attaching guest NICs (S.Sakamoto)
[6a155cfe437c]
2008-02-16 "Daniel P. Berrange <berrange@redhat.com>
* src/virtManager/engine.py, src/virtManager/host.py:
Wire up hosts dialog about menu entry (Henry Zhang)
[4a5c3994af32]
2008-02-14 "Cole Robinson <crobinso@redhat.com>
* src/virtManager/addhardware.py, src/virtManager/create.py:
Auto add usermode nic during create and addhardware when
appropriate: everything was in place but it was broken.
[402283b6aa0a]
2008-02-03 "Daniel P. Berrange <berrange@redhat.com>
* src/virtManager/serialcon.py:
Use pty.slave_open for Solaris portability (Henry Zhang)
[a623336112b9]
2008-01-31 "Daniel P. Berrange <berrange@redhat.com>
* po/fr.po:
Refresh French translation from Gauthier Ancelin
[7bcfffba3a97]
* README, TODO, src/virt-manager.py.in, src/virtManager/connect.py,
src/virtManager/connection.py, src/vmm-open-connection.glade, virt-
manager.spec.in:
Added support for libvirt authentication
[1892867ca5c7]
2008-01-30 "Cole Robinson <crobinso@redhat.com>
* src/vmm-modify-file-storage.glade:
Remove unused vmm-modify-file-storage
[28067b47f82c]
* src/virtManager/addhardware.py:
Fix adding virtual blktap disk to pv guest via addhardware wizard.
rhbz 430926
[90dd30034ebc]
2008-01-16 "Cole Robinson <crobinso@redhat.com>
* src/virtManager/addhardware.py, src/virtManager/create.py:
Fix disk size sensitivity: opening and closing the file chooser
would make the disk size field sensitive even if nothing was
selected.
[384724cb14e0]
* src/virtManager/addhardware.py:
Adding a bridged network device was broken, adding the display name
and not the interface name. Fix similar to cset 597. Fixes bug
392881.
[dbd25721f588]
2008-01-15 "Daniel P. Berrange <berrange@redhat.com>
* AUTHORS, src/virtManager/console.py, src/virtManager/create.py,
src/virtManager/domain.py, src/virtManager/manager.py:
Pass libvirt connection username through to VNC console instead of
hardcoding root (Soren Hansen)
[49c55daf788d]
2008-01-10 "Daniel P. Berrange <berrange@redhat.com>
* .hgtags:
Added tag RELEASE-0.5.3-1 for changeset 49f8c16f0acc
[d99010f79088]
* ChangeLog:
Refresh changelog
[49f8c16f0acc] [RELEASE-0.5.3-1]
* po/bg.po, po/bn_IN.po, po/bs.po, po/ca.po, po/cs.po, po/da.po,
po/de.po, po/es.po, po/fi.po, po/fr.po, po/gu.po, po/hi.po,
po/hr.po, po/hu.po, po/is.po, po/it.po, po/ja.po, po/kn.po,
......@@ -8,7 +228,7 @@
po/ru.po, po/sr.po, po/sr@Latn.po, po/sv.po, po/ta.po, po/te.po,
po/tr.po, po/uk.po, po/virt-manager.pot, po/zh_CN.po, po/zh_TW.po:
Refresh po files
[c95c688762cf] [tip]
[c95c688762cf]
* configure.ac, virt-manager.spec.in:
Update in prep for new release
......
Virtual Machine Manager News
============================
Release 0.5.4
-------------
This release focuses on minor feature enhancement and bug fixes. Using
the new GTK-VNC accelerated scaling support, the guest console window
can be smoothly resized to fill the screen. The SSH username is passed
through to the VNC console when tunnelling. Adding bridged network
devices is fixed. Support for all libvirt authentication methods is
enabled including Kerberos and PolicyKit. Solaris portability fix for
the text console. Support for detecting bonding and VLAN devices for
attaching guest NICs. Allow fullvirt guests to install off kernel and
initrd as well as existing CDROM methods. Fix invocation of DBus methods
to use an interface. Allow setting of autostart flag, and changing boot
device ordering. Control the new VM wizard based on declared hypervisor
capabilities.
Release 0.5.3
-------------
This is a bug fix release. The sizing of the VNC window is fixed for
screens where the physical size is less than the guest screen size.
The 'new vm' button is switched back to its old (more obvious style/
placement). Restore of VMs is working again for local connections. A
menu for sending special key sequences to the guest is added. Lots of
other misc bug fixes
Release 0.5.2
-------------
......
......@@ -28,14 +28,15 @@ please report any success to the mailing lists
python >= 2.4
pygtk2 >= 1.99.12-6
gnome-python2-gconf >= 1.99.11-7
libvirt-python >= 0.2.1
libvirt-python >= 0.4.0
dbus-python >= 0.61
gnome-keyring >= 0.4.9
gnome-python-desktop >= 2.15.4
libxml2-python >= 2.6.23
vte >= 0.12.2
gtk-vnc >= 0.0.1
python-virtinst >= 0.103.0
python-virtinst >= 0.300.0
PolicyKit >= 0.6
The latter is available from
......
......@@ -4,17 +4,10 @@
A list of random items which need implementing in no particular
order / importance:
1. Handle renaming of domains. Libvirt caches the name when you get
the initial handle to the domain, so this may be more difficult
than it seems - particularly since we really want to minimize as
may XenD RPC/HTTP calls as possible
2. Implement tracking of network & disk stats. Needs support in
2. Implement tracking of network & disk stats. Needs support in
libvirt.
3. Support for dealing with inactive / passive domains
6. Ability to send arbitrary keystrokes to VNC (ie keys which local
WM would otherwise capture, eg Ctrl+Alt+F1 to switch console)
......@@ -2332,7 +2332,7 @@ fi
# Define the identity of the package.
PACKAGE=virt-manager
VERSION=0.5.3
VERSION=0.5.4
cat >>confdefs.h <<_ACEOF
......
AC_INIT(virt-manager.spec.in)
AM_INIT_AUTOMAKE(virt-manager, 0.5.3)
AM_INIT_AUTOMAKE(virt-manager, 0.5.4)
ALL_LINGUAS="bg bn_IN bs ca cs da de es fi fr gu hi hr hu is it ja kn ko ml mr ms nb nl or pa pl pt_BR pt ro ru sr@Latn sr sv ta te tr uk zh_CN zh_TW"
IT_PROG_INTLTOOL([0.35.0], [no-xml])
......
This diff is collapsed.
......@@ -23,6 +23,8 @@ import os
import os.path
import sys
import libvirt
import locale
import gettext
import logging
......@@ -125,6 +127,13 @@ def setup_logging():
rootLogger.addHandler(fileHandler)
logging.info("Application startup")
# Register libvirt handler
def libvirt_callback(ctx, err):
if err[3] != libvirt.VIR_ERR_ERROR:
# Don't log libvirt errors: global error handler will do that
logging.warn("Non-error from libvirt: '%s'" % err[2])
libvirt.registerErrorHandler(f=libvirt_callback, ctx=None)
# Log uncaught exceptions
def exception_log(type, val, tb):
import traceback
......@@ -172,12 +181,9 @@ def show_engine(engine, show, uri, uuid):
if engine.config.get_connections() is None or len(engine.config.get_connections()) == 0:
tryuri = None
if os.path.exists("/var/lib/xend") and os.path.exists("/proc/xen"):
tryuri = "xen"
tryuri = "xen:///"
elif os.path.exists("/usr/bin/qemu"):
if os.getuid() == 0:
tryuri = "qemu:///system"
else:
tryuri = "qemu:///session"
tryuri = "qemu:///system"
if tryuri is not None:
conn = engine.add_connection(tryuri)
engine.show_manager()
......
......@@ -122,12 +122,12 @@ class vmmAddHardware(gobject.GObject):
network_list.add_attribute(text, 'text', 1)
device_list = self.window.get_widget("net-device")
device_model = gtk.ListStore(str, bool)
device_model = gtk.ListStore(str, str, bool)
device_list.set_model(device_model)
text = gtk.CellRendererText()
device_list.pack_start(text, True)
device_list.add_attribute(text, 'text', 0)
device_list.add_attribute(text, 'sensitive', 1)
device_list.add_attribute(text, 'text', 1)
device_list.add_attribute(text, 'sensitive', 2)
target_list = self.window.get_widget("target-device")
target_model = gtk.ListStore(str, int, str, str, str)
......@@ -210,10 +210,11 @@ class vmmAddHardware(gobject.GObject):
model = self.window.get_widget("hardware-type").get_model()
model.clear()
model.append(["Storage device", gtk.STOCK_HARDDISK, PAGE_DISK])
# User mode networking only allows a single card for now
if (self.vm.get_connection().get_type().lower() == "qemu" and \
os.getuid() == 0) or \
self.vm.get_connection().get_type().lower() == "xen":
# Can't use shared or virtual networking as regular user
# Can only have one usermode network device
if (os.getuid() == 0 or
(self.vm.get_connection().get_type().lower() == "qemu" and
len(self.vm.get_network_devices()) == 0)):
model.append(["Network card", gtk.STOCK_NETWORK, PAGE_NETWORK])
# Can only customize HVM guests, no Xen PV
......@@ -222,14 +223,15 @@ class vmmAddHardware(gobject.GObject):
model.append(["Graphics device", gtk.STOCK_SELECT_COLOR, PAGE_GRAPHICS])
def forward(self, ignore=None):
notebook = self.window.get_widget("create-pages")
if(self.validate(notebook.get_current_page()) != True):
return
if notebook.get_current_page() == PAGE_INTRO:
notebook.set_current_page(self.get_config_hardware_type())
hwtype = self.get_config_hardware_type()
if notebook.get_current_page() == PAGE_INTRO and \
(hwtype != PAGE_NETWORK or os.getuid() == 0):
notebook.set_current_page(hwtype)
else:
notebook.set_current_page(PAGE_SUMMARY)
self.window.get_widget("create-finish").show()
......@@ -240,7 +242,11 @@ class vmmAddHardware(gobject.GObject):
notebook = self.window.get_widget("create-pages")
if notebook.get_current_page() == PAGE_SUMMARY:
notebook.set_current_page(self.get_config_hardware_type())
hwtype = self.get_config_hardware_type()
if hwtype == PAGE_NETWORK and os.getuid() != 0:
notebook.set_current_page(PAGE_INTRO)
else:
notebook.set_current_page(hwtype)
self.window.get_widget("create-finish").hide()
else:
notebook.set_current_page(PAGE_INTRO)
......@@ -436,6 +442,8 @@ class vmmAddHardware(gobject.GObject):
self.close()
def add_network(self):
if self._net is None and os.getuid() != 0:
self._net = virtinst.VirtualNetworkInterface(type="user")
self._net.setup(self.vm.get_connection().vmm)
self.add_device(self._net.get_xml_config())
......@@ -539,7 +547,6 @@ class vmmAddHardware(gobject.GObject):
self.window.get_widget("storage-partition-address").set_text(part)
def browse_storage_file_address(self, src, ignore=None):
self.window.get_widget("storage-file-size").set_sensitive(True)
folder = self.config.get_default_image_dir(self.vm.get_connection())
file = self._browse_file(_("Locate or Create New Storage File"), \
folder=folder, confirm_overwrite=True)
......@@ -701,7 +708,7 @@ class vmmAddHardware(gobject.GObject):
device=device)
if self._disk.type == virtinst.VirtualDisk.TYPE_FILE and \
not self.vm.is_hvm() and virtinst.util.is_blktap_capable():
disk.driver_name = virtinst.VirtualDisk.DRIVER_TAP
self._disk.driver_name = virtinst.VirtualDisk.DRIVER_TAP
except ValueError, e:
self._validation_error_box(_("Invalid Storage Parameters"), \
str(e))
......@@ -820,9 +827,9 @@ class vmmAddHardware(gobject.GObject):
net = self.vm.get_connection().get_net_device(name)
if net.is_shared():
hasShared = True
model.append(["%s (%s %s)" % (net.get_name(), _("Bridge"), net.get_bridge()), True])
model.append([net.get_bridge(), "%s (%s %s)" % (net.get_name(), _("Bridge"), net.get_bridge()), True])
else:
model.append(["%s (%s)" % (net.get_name(), _("Not bridged")), False])
model.append([net.get_bridge(), "%s (%s)" % (net.get_name(), _("Not bridged")), False])
return hasShared
def populate_target_device_model(self, model):
......@@ -831,8 +838,8 @@ class vmmAddHardware(gobject.GObject):
model.append(["hd", 4, virtinst.VirtualDisk.DEVICE_DISK, gtk.STOCK_HARDDISK, "IDE disk"])
model.append(["hd", 4, virtinst.VirtualDisk.DEVICE_CDROM, gtk.STOCK_CDROM, "IDE cdrom"])
model.append(["fd", 2, virtinst.VirtualDisk.DEVICE_FLOPPY, gtk.STOCK_FLOPPY, "Floppy disk"])
model.append(["sd", 7, virtinst.VirtualDisk.DEVICE_DISK, gtk.STOCK_HARDDISK, "SCSI disk"])
if self.vm.get_connection().get_type().lower() == "xen":
model.append(["sd", 7, virtinst.VirtualDisk.DEVICE_DISK, gtk.STOCK_HARDDISK, "SCSI disk"])
model.append(["xvd", 26, virtinst.VirtualDisk.DEVICE_DISK, gtk.STOCK_HARDDISK, "Virtual disk"])
#model.append(["usb", virtinst.VirtualDisk.DEVICE_DISK, gtk.STOCK_HARDDISK, "USB disk"])
else:
......
......@@ -28,8 +28,9 @@ HV_XEN = 0
HV_QEMU = 1
CONN_LOCAL = 0
CONN_TLS = 1
CONN_SSH = 2
CONN_TCP = 1
CONN_TLS = 2
CONN_SSH = 3
class vmmConnect(gobject.GObject):
__gsignals__ = {
......@@ -95,23 +96,22 @@ class vmmConnect(gobject.GObject):
pass
elif hv == HV_XEN:
if conn == CONN_LOCAL:
uri = "xen"
if os.getuid() != 0:
readOnly = True
uri = "xen:///"
elif conn == CONN_TLS:
uri = "xen+tls://" + host + "/"
elif conn == CONN_SSH:
uri = "xen+ssh://root@" + host + "/"
elif conn == CONN_TCP:
uri = "xen+tcp://" + host + "/"
else:
if conn == CONN_LOCAL:
if os.getuid() == 0:
uri = "qemu:///system"
else:
uri = "qemu:///session"
uri = "qemu:///system"
elif conn == CONN_TLS:
uri = "qemu+tls://" + host + "/system"
elif conn == CONN_SSH:
uri = "qemu+ssh://root@" + host + "/system"
elif conn == CONN_TCP:
uri = "qemu+tcp://" + host + "/system"
logging.debug("Connection to open is %s" % uri)
self.close()
......
This diff is collapsed.
......@@ -75,16 +75,17 @@ class vmmConsole(gobject.GObject):
self.gtk_settings_accel = None
self.vncViewer = gtkvnc.Display()
self.window.get_widget("console-vnc-align").add(self.vncViewer)
self.window.get_widget("console-vnc-viewport").add(self.vncViewer)
self.vncViewer.realize()
self.vncTunnel = None
if self.config.get_console_keygrab() == 2:
self.vncViewer.set_keyboard_grab(True)
self.vncViewer.set_pointer_grab(True)
else:
self.vncViewer.set_keyboard_grab(False)
self.vncViewer.set_pointer_grab(False)
self.vncViewer.set_pointer_local(True)
self.vncViewer.set_pointer_grab(True)
if not topwin.is_composited():
self.vncViewer.set_scaling(True)
self.window.get_widget("menu-view-scale-display").set_active(True)
self.vncViewer.connect("vnc-pointer-grab", self.notify_grabbed)
self.vncViewer.connect("vnc-pointer-ungrab", self.notify_ungrabbed)
......@@ -147,6 +148,8 @@ class vmmConsole(gobject.GObject):
"on_menu_send_caf7_activate": self.send_key,
"on_menu_send_caf8_activate": self.send_key,
"on_menu_send_printscreen_activate": self.send_key,
"on_menu_view_scale_display_activate": self.scale_display,
})
self.vm.connect("status-changed", self.update_widget_states)
......@@ -165,8 +168,10 @@ class vmmConsole(gobject.GObject):
# widget it still seems to show scrollbars. So we do evil stuff here
def _force_resize(self, src, size):
w,h = src.get_size_request()
if w == -1 or h == -1:
return
self.window.get_widget("console-screenshot").set_size_request(w, h)
self.window.get_widget("console-vnc-scroll").set_size_request(w, h)
topw,toph = self.window.get_widget("vmm-console").size_request()
padx = topw-w
......@@ -178,6 +183,7 @@ class vmmConsole(gobject.GObject):
maxh = rooth - 100 - pady
self.window.get_widget("console-vnc-viewport").set_size_request(w, h)
self.window.get_widget("console-screenshot-viewport").set_size_request(w, h)
self.window.get_widget("console-vnc-scroll").set_size_request(w, h)
if w > maxw or h > maxh:
self.window.get_widget("console-vnc-scroll").set_policy(gtk.POLICY_ALWAYS, gtk.POLICY_ALWAYS)
self.window.get_widget("console-screenshot-scroll").set_policy(gtk.POLICY_ALWAYS, gtk.POLICY_ALWAYS)
......@@ -185,22 +191,6 @@ class vmmConsole(gobject.GObject):
self.window.get_widget("console-vnc-scroll").set_policy(gtk.POLICY_NEVER, gtk.POLICY_NEVER)
self.window.get_widget("console-screenshot-scroll").set_policy(gtk.POLICY_NEVER, gtk.POLICY_NEVER)
# Auto-increase the window size to fit the console - within reason
# though, cos we don't want a min window size greater than the screen
# the user has scrollbars anyway if they want it smaller / it can't fit
def autosize(self, src, size):
rootWidth = gtk.gdk.screen_width()
rootHeight = gtk.gdk.screen_height()
vncWidth, vncHeight = src.get_size_request()
if vncWidth > (rootWidth-200):
vncWidth = rootWidth - 200
if vncHeight > (rootHeight-200):
vncHeight = rootHeight - 200
self.window.get_widget("console-vnc-vp").set_size_request(vncWidth+2, vncHeight+2)
def send_key(self, src):
keys = None
if src.get_name() == "menu-send-cad":
......@@ -287,10 +277,14 @@ class vmmConsole(gobject.GObject):
def keygrab_changed(self, src, ignore1=None,ignore2=None,ignore3=None):
if self.config.get_console_keygrab() == 2:
self.vncViewer.set_keyboard_grab(True)
self.vncViewer.set_pointer_grab(True)
else:
self.vncViewer.set_keyboard_grab(False)
self.vncViewer.set_pointer_grab(False)
def scale_display(self, src):
if src.get_active():
self.vncViewer.set_scaling(True)
else:
self.vncViewer.set_scaling(False)
def toggle_fullscreen(self, src):
if src.get_active():
......@@ -393,7 +387,7 @@ class vmmConsole(gobject.GObject):
finally:
gtk.gdk.threads_leave()
def open_tunnel(self, server, vncaddr ,vncport):
def open_tunnel(self, server, vncaddr, vncport, username):
if self.vncTunnel is not None:
return
......@@ -407,7 +401,11 @@ class vmmConsole(gobject.GObject):
os.close(1)
os.dup(fds[1].fileno())
os.dup(fds[1].fileno())
os.execlp("ssh", "ssh", "-p", "22", "-l", "root", server, "nc", vncaddr, str(vncport))
argv = ["ssh", "ssh", "-p", "22"]
if username:
argv += ['-l', username]
argv += [ server, "nc", vncaddr, str(vncport) ]
os.execlp(*argv)
os._exit(1)
else:
fds[1].close()
......@@ -433,14 +431,18 @@ class vmmConsole(gobject.GObject):
logging.debug("Trying console login")
password = self.window.get_widget("console-auth-password").get_text()
protocol, host, port, trans = self.vm.get_graphics_console()
protocol, host, port, trans, username = self.vm.get_graphics_console()
if protocol is None:
logging.debug("No graphics configured in guest")
self.activate_unavailable_page(_("Console not configured for guest"))
return
uri = str(protocol) + "://" + str(host) + ":" + str(port)
uri = str(protocol) + "://"
if username:
uri = uri + str(username) + '@'
uri = uri + str(host) + ":" + str(port)
logging.debug("Graphics console configured at " + uri)
if protocol != "vnc":
......@@ -457,7 +459,7 @@ class vmmConsole(gobject.GObject):
logging.debug("Starting connect process for %s %s" % (host, str(port)))
try:
if trans is not None and trans in ("ssh", "ext"):
fd = self.open_tunnel(host, "127.0.0.1", port)
fd = self.open_tunnel(host, "127.0.0.1", port, username)
self.vncViewer.open_fd(fd)
else:
self.vncViewer.open_host(host, str(port))
......@@ -661,6 +663,8 @@ class vmmConsole(gobject.GObject):
cr.show_text(overlay)
screenshot.set_from_pixmap(pixmap, None)
self.activate_screenshot_page()
elif self.window.get_widget("console-pages").get_current_page() == PAGE_SCREENSHOT:
pass
else:
if self.window.get_widget("console-pages").get_current_page() != PAGE_UNAVAILABLE:
self.vncViewer.close()
......
This diff is collapsed.
......@@ -404,10 +404,11 @@ class vmmCreateNetwork(gobject.GObject):
# Find info about all current present media
for d in self.hal_iface.FindDeviceByCapability("volume"):
vol = self.bus.get_object("org.freedesktop.Hal", d)
if vol.GetPropertyBoolean("volume.is_disc") and \
vol.GetPropertyBoolean("volume.disc.has_data"):
devnode = vol.GetProperty("block.device")
label = vol.GetProperty("volume.label")
volif = dbus.Interface(vol, "org.freedesktop.Hal.Device")
if volif.GetPropertyBoolean("volume.is_disc") and \
volif.GetPropertyBoolean("volume.disc.has_data"):
devnode = volif.GetProperty("block.device")
label = volif.GetProperty("volume.label")
if label == None or len(label) == 0:
label = devnode
vollabel[devnode] = label
......@@ -416,7 +417,8 @@ class vmmCreateNetwork(gobject.GObject):
for d in self.hal_iface.FindDeviceByCapability("storage.cdrom"):
dev = self.bus.get_object("org.freedesktop.Hal", d)
devnode = dev.GetProperty("block.device")
devif = dbus.Interface(dev, "org.freedesktop.Hal.Device")
devnode = devif.GetProperty("block.device")
if vollabel.has_key(devnode):
model.append([devnode, vollabel[devnode], True, volpath[devnode]])
else:
......
......@@ -49,6 +49,7 @@ HW_LIST_TYPE_DISK = 2
HW_LIST_TYPE_NIC = 3
HW_LIST_TYPE_INPUT = 4
HW_LIST_TYPE_GRAPHICS = 5
HW_LIST_TYPE_BOOT = 6
class vmmDetails(gobject.GObject):
__gsignals__ = {
......@@ -134,6 +135,9 @@ class vmmDetails(gobject.GObject):
"on_config_memory_changed": self.config_memory_changed,
"on_config_maxmem_changed": self.config_maxmem_changed,
"on_config_memory_apply_clicked": self.config_memory_apply,
"on_config_boot_device_changed": self.config_boot_options_changed,
"on_config_autostart_changed": self.config_boot_options_changed,
"on_config_boot_apply_clicked": self.config_boot_options_apply,
"on_details_help_activate": self.show_help,
"on_config_cdrom_connect_clicked": self.toggle_cdrom,
......@@ -216,6 +220,9 @@ class vmmDetails(gobject.GObject):
self.refresh_input_page()
elif pagetype == HW_LIST_TYPE_GRAPHICS:
self.refresh_graphics_page()
elif pagetype == HW_LIST_TYPE_BOOT:
self.refresh_boot_page()
self.window.get_widget("config-boot-options-apply").set_sensitive(False)
else:
pagenum = -1
......@@ -298,6 +305,7 @@ class vmmDetails(gobject.GObject):
self.window.get_widget("details-menu-pause").set_active(False)
except:
self.ignorePause = False
raise
self.ignorePause = False
self.window.get_widget("overview-status-text").set_text(self.vm.run_status())
......@@ -495,6 +503,40 @@ class vmmDetails(gobject.GObject):
else:
self.window.get_widget("config-input-remove").set_sensitive(True)
def refresh_boot_page(self):
# Refresh autostart
try:
autoval = self.vm.get_autostart()