merge heads

This commit is contained in:
Daniel P. Berrange 2007-09-06 21:00:49 -04:00
commit db9086e189
9 changed files with 210 additions and 181 deletions

View File

@ -26,6 +26,7 @@ Further patches have been submitted by:
Cole Robinson <crobinso-at-redhat-dot-com>
Alexander Todorov <atodorov-at-redhat-dot-com>
Bernhard Kaindl <bk-at-suse-dot-de>
Eduardo Habkost <ehabkost-at-redhat-dot-com>
<...send a patch & get your name here...>

View File

@ -73,13 +73,25 @@ def get_transport(uri):
try:
(scheme, username, netloc, path, query, fragment) = uri_split(uri)
if scheme:
offset = scheme.index("+")
offset = scheme.find("+")
if offset > 0:
return [scheme[offset:], username]
except:
pass
return [None, None]
def get_driver(uri):
try:
(scheme, username, netloc, path, query, fragment) = uri_split(uri)
if scheme:
offset = scheme.find("+")
if offset > 0:
return scheme[:offset]
return scheme
except Exception, e:
pass
return None
# Standard python urlparse is utterly braindead - refusing to parse URIs
# in any useful fashion unless the 'scheme' is in some pre-defined white
# list. Theis functions is a hacked version of urlparse
@ -207,10 +219,12 @@ class vmmConnection(gobject.GObject):
# welcomed...
sysfspath = obj.GetPropertyString("linux.sysfs_path")
# Sick, disgusting hack for Xen netloop crack which renames
# ethN -> pethN, but which HAL never sees
# If running a device in bridged mode, there's a reasonable
# chance that the actual ethernet device has been renamed to
# something else. ethN -> pethN
psysfspath = sysfspath[0:len(sysfspath)-len(name)] + "p" + name
if os.path.exists(psysfspath):
name = "p" + name
sysfspath = psysfspath
brportpath = os.path.join(sysfspath, "brport")

View File

@ -172,12 +172,12 @@ class vmmCreate(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)
# set up the lists for the os-type/os-variant widgets
os_type_list = self.window.get_widget("os-type")
@ -1141,9 +1141,9 @@ class vmmCreate(gobject.GObject):
net = self.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 change_os_type(self, box):

View File

@ -414,7 +414,10 @@ class vmmManager(gobject.GObject):
row.insert(ROW_STATUS, _("Disconnected"))
row.insert(ROW_ACTION, gtk.STOCK_DELETE)
row.insert(ROW_NAME, static_conn.get_short_hostname(uri))
row.insert(ROW_ID, "")
drv = static_conn.get_driver(uri)
if drv is None:
drv = "xen"
row.insert(ROW_ID, drv)
row.insert(ROW_STATUS_ICON, None)
row.insert(ROW_CPU, "")
row.insert(ROW_VCPUS, 0)

View File

@ -305,7 +305,7 @@
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="wrap">True</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>

View File

@ -4,6 +4,7 @@
<glade-interface>
<widget class="GtkWindow" id="vmm-create">
<property name="border_width">6</property>
<property name="visible">True</property>
<property name="title" translatable="yes">Create a new virtual system</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
@ -24,7 +25,7 @@
<widget class="GtkVBox" id="vbox23">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<property name="spacing">6</property>
<child>
<widget class="GtkNotebook" id="create-pages">
@ -566,12 +567,13 @@
<child>
<widget class="GtkTable" id="table13">
<property name="border_width">6</property>
<property name="visible">True</property>
<property name="n_rows">2</property>
<property name="n_columns">2</property>
<property name="homogeneous">False</property>
<property name="row_spacing">3</property>
<property name="column_spacing">4</property>
<property name="column_spacing">3</property>
<child>
<widget class="GtkLabel" id="label173">

View File

@ -268,7 +268,7 @@
<child>
<widget class="GtkNotebook" id="details-pages">
<property name="border_width">3</property>
<property name="border_width">6</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="show_tabs">True</property>

View File

@ -88,7 +88,7 @@
<child>
<widget class="GtkNotebook" id="details-tabs">
<property name="border_width">3</property>
<property name="border_width">6</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="show_tabs">True</property>

View File

@ -9,7 +9,7 @@
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
<property name="default_width">600</property>
<property name="default_width">700</property>
<property name="default_height">500</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
@ -335,29 +335,93 @@
</child>
<child>
<widget class="GtkHBox" id="hbox1">
<property name="border_width">3</property>
<widget class="GtkVBox" id="vbox2">
<property name="border_width">6</property>
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<property name="spacing">3</property>
<child>
<widget class="GtkLabel" id="label1">
<widget class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<property name="label" translatable="yes">_View:</property>
<property name="use_underline">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_RIGHT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">1</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_START</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="label" translatable="yes">_View:</property>
<property name="use_underline">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_RIGHT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">1</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_START</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkComboBox" id="vm-view">
<property name="visible">True</property>
<property name="items" translatable="yes">All virtual machines
Active virtual machines
Inactive virtual machines</property>
<property name="add_tearoffs">False</property>
<property name="focus_on_click">True</property>
<signal name="changed" handler="on_vm_view_changed" last_modification_time="Tue, 10 Oct 2006 20:44:44 GMT"/>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkScrolledWindow" id="scrolledwindow1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="shadow_type">GTK_SHADOW_IN</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child>
<widget class="GtkTreeView" id="vm-list">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">True</property>
<property name="rules_hint">True</property>
<property name="reorderable">False</property>
<property name="enable_search">True</property>
<property name="fixed_height_mode">False</property>
<property name="hover_selection">False</property>
<property name="hover_expand">False</property>
<signal name="row_activated" handler="on_vm_list_row_activated" last_modification_time="Mon, 03 Apr 2006 13:43:20 GMT"/>
<signal name="button_press_event" handler="on_vm_list_button_press_event" last_modification_time="Mon, 03 Apr 2006 14:14:43 GMT"/>
<signal name="row_expanded" handler="on_vm_list_row_expanded" last_modification_time="Tue, 14 Aug 2007 15:19:41 GMT"/>
<signal name="row_collapsed" handler="on_vm_list_row_collapsed" last_modification_time="Tue, 14 Aug 2007 15:19:50 GMT"/>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
@ -367,17 +431,100 @@
</child>
<child>
<widget class="GtkComboBox" id="vm-view">
<widget class="GtkHButtonBox" id="hbuttonbox2">
<property name="visible">True</property>
<property name="items" translatable="yes">All virtual machines
Active virtual machines
Inactive virtual machines</property>
<property name="add_tearoffs">False</property>
<property name="focus_on_click">True</property>
<accessibility>
<atkproperty name="AtkObject::accessible_name" translatable="yes">View Select</atkproperty>
</accessibility>
<signal name="changed" handler="on_vm_view_changed" last_modification_time="Tue, 10 Oct 2006 20:44:44 GMT"/>
<property name="layout_style">GTK_BUTTONBOX_END</property>
<property name="spacing">3</property>
<child>
<widget class="GtkButton" id="vm-details">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_vm_details_clicked" last_modification_time="Tue, 28 Mar 2006 17:04:34 GMT"/>
<child>
<widget class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xscale">0</property>
<property name="yscale">0</property>
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">0</property>
<property name="right_padding">0</property>
<child>
<widget class="GtkHBox" id="hbox7">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">2</property>
<child>
<widget class="GtkImage" id="image5">
<property name="visible">True</property>
<property name="stock">gtk-properties</property>
<property name="icon_size">4</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label34">
<property name="visible">True</property>
<property name="label" translatable="yes">De_tails</property>
<property name="use_underline">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkButton" id="vm-open">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-open</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_vm_open_clicked" last_modification_time="Mon, 03 Apr 2006 09:52:21 GMT"/>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
@ -386,150 +533,12 @@ Inactive virtual machines</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkScrolledWindow" id="scrolledwindow1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="shadow_type">GTK_SHADOW_IN</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child>
<widget class="GtkTreeView" id="vm-list">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">True</property>
<property name="rules_hint">True</property>
<property name="reorderable">False</property>
<property name="enable_search">True</property>
<property name="fixed_height_mode">False</property>
<property name="hover_selection">False</property>
<property name="hover_expand">False</property>
<signal name="row_activated" handler="on_vm_list_row_activated" last_modification_time="Mon, 03 Apr 2006 13:43:20 GMT"/>
<signal name="button_press_event" handler="on_vm_list_button_press_event" last_modification_time="Mon, 03 Apr 2006 14:14:43 GMT"/>
<signal name="row_expanded" handler="on_vm_list_row_expanded" last_modification_time="Tue, 14 Aug 2007 15:19:41 GMT"/>
<signal name="row_collapsed" handler="on_vm_list_row_collapsed" last_modification_time="Tue, 14 Aug 2007 15:19:50 GMT"/>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkHButtonBox" id="hbuttonbox2">
<property name="border_width">3</property>
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property>
<property name="spacing">3</property>
<child>
<widget class="GtkButton" id="vm-details">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_vm_details_clicked" last_modification_time="Tue, 28 Mar 2006 17:04:34 GMT"/>
<child>
<widget class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xscale">0</property>
<property name="yscale">0</property>
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">0</property>
<property name="right_padding">0</property>
<child>
<widget class="GtkHBox" id="hbox7">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">2</property>
<child>
<widget class="GtkImage" id="image5">
<property name="visible">True</property>
<property name="stock">gtk-properties</property>
<property name="icon_size">4</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label34">
<property name="visible">True</property>
<property name="label" translatable="yes">De_tails</property>
<property name="use_underline">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkButton" id="vm-open">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-open</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_vm_open_clicked" last_modification_time="Mon, 03 Apr 2006 09:52:21 GMT"/>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
</child>
</widget>