Fix 'Resize to VM' graphical option (bz 738806)

Fix deleting guest with managed save data
Fix error when adding default storage
Don't flush XML cache on every tick
Use labels for non-editable network info fields (bz 738751)
Properly update icon cache (bz 733836)
This commit is contained in:
Cole Robinson 2011-09-27 14:02:13 -04:00
parent 50058043de
commit 5bdfcd9ae4
6 changed files with 458 additions and 3 deletions

View File

@ -0,0 +1,25 @@
commit 9dc799af9c3d4fab926ee41685d68642c95593fe
Author: Cole Robinson <crobinso@redhat.com>
Date: Tue Aug 23 15:47:31 2011 -0400
domain: Don't fetch XML on tick to get vcpu count
It's available in the domain info structure. Saves us from hammering
xenstored and just plain doing to much work on every tick.
diff --git a/src/virtManager/domain.py b/src/virtManager/domain.py
index bccf75f..2e4ad4f 100644
--- a/src/virtManager/domain.py
+++ b/src/virtManager/domain.py
@@ -1152,10 +1152,10 @@ class vmmDomain(vmmLibvirtObject):
if not (info[0] in [libvirt.VIR_DOMAIN_SHUTOFF,
libvirt.VIR_DOMAIN_CRASHED]):
+ guestcpus = info[3]
cpuTime = info[4] - prevCpuTime
cpuTimeAbs = info[4]
hostcpus = self.conn.host_active_processor_count()
- guestcpus = self.vcpu_count()
pcentbase = (((cpuTime) * 100.0) /
((now - prevTimestamp) * 1000.0 * 1000.0 * 1000.0))

View File

@ -0,0 +1,30 @@
commit 9a46aa41e092e73ed1596c361acbca65ac3cbe95
Author: Cole Robinson <crobinso@redhat.com>
Date: Tue Aug 30 14:29:08 2011 -0400
util: get_default_path: Handle 'None' in collidelist
diff --git a/src/virtManager/util.py b/src/virtManager/util.py
index d351cb3..0cba349 100644
--- a/src/virtManager/util.py
+++ b/src/virtManager/util.py
@@ -126,14 +126,14 @@ def get_default_path(conn, name, collidelist=None):
target, ignore, suffix = get_ideal_path_info(conn, name)
# Sanitize collidelist to work with the collision checker
- for c in collidelist[:]:
- collidelist.remove(c)
- if os.path.dirname(c) == pool.get_target_path():
- collidelist.append(os.path.basename(c))
+ newcollidelist = []
+ for c in collidelist:
+ if c and os.path.dirname(c) == pool.get_target_path():
+ newcollidelist.append(os.path.basename(c))
path = virtinst.Storage.StorageVolume.find_free_name(name,
pool_object=pool.pool, suffix=suffix,
- collidelist=collidelist)
+ collidelist=newcollidelist)
path = os.path.join(target, path)

View File

@ -0,0 +1,38 @@
commit a815fa17a7c643ddde8ea326399e2bee449dff98
Author: Marc Deslauriers <marc.deslauriers@canonical.com>
Date: Fri Aug 19 11:50:11 2011 -0400
virt-manager: Fix "Resize to VM" menu option
Hello,
This patch fixes the "Resize to VM" menu option by correcting inverted return
values in autodrawer.py.
Thanks,
Marc.
commit 8e666f4b87926c866ed35e58eb82213d2c514e89
Author: Marc Deslauriers <marc.deslauriers@ubuntu.com>
Date: Fri Aug 19 11:46:48 2011 -0400
Fix inverted width and height
diff --git a/src/virtManager/autodrawer.py b/src/virtManager/autodrawer.py
index a0ddec6..9682aa9 100644
--- a/src/virtManager/autodrawer.py
+++ b/src/virtManager/autodrawer.py
@@ -271,10 +271,10 @@ class OverBox(parentclass):
self.underWin = None
def do_size_request(self, req):
- height, width = self._size_request()
+ width, height = self._size_request()
- req.height = height
req.width = width
+ req.height = height
def do_size_allocate(self, newalloc):
self.allocation = newalloc

View File

@ -0,0 +1,285 @@
commit 3d3ac635e1ba33e13961c0d9663f23a2387fa3c4
Author: Cole Robinson <crobinso@redhat.com>
Date: Thu Sep 22 10:43:55 2011 -0400
host: Don't use text entries for fields that aren't editable
Also make some interface labels selectable.
diff --git a/src/vmm-host.glade b/src/vmm-host.glade
index 2a6fde6..532d7c6 100644
--- a/src/vmm-host.glade
+++ b/src/vmm-host.glade
@@ -511,8 +511,8 @@
<property name="border_width">6</property>
<property name="n_rows">4</property>
<property name="n_columns">2</property>
- <property name="column_spacing">3</property>
- <property name="row_spacing">3</property>
+ <property name="column_spacing">6</property>
+ <property name="row_spacing">5</property>
<child>
<widget class="GtkLabel" id="label56">
<property name="visible">True</property>
@@ -525,19 +525,6 @@
</packing>
</child>
<child>
- <widget class="GtkEntry" id="net-name">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">False</property>
- <property name="invisible_char">●</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
<widget class="GtkLabel" id="label58">
<property name="visible">True</property>
<property name="xalign">0</property>
@@ -551,21 +538,6 @@
</packing>
</child>
<child>
- <widget class="GtkEntry" id="net-device">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">False</property>
- <property name="invisible_char">●</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
<widget class="GtkLabel" id="label63">
<property name="visible">True</property>
<property name="xalign">0</property>
@@ -646,6 +618,32 @@
<property name="y_options"></property>
</packing>
</child>
+ <child>
+ <widget class="GtkLabel" id="net-name">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label">label</property>
+ <property name="selectable">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="net-device">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label">label</property>
+ <property name="selectable">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
</widget>
</child>
<child>
@@ -676,8 +674,8 @@
<property name="border_width">6</property>
<property name="n_rows">4</property>
<property name="n_columns">2</property>
- <property name="column_spacing">3</property>
- <property name="row_spacing">3</property>
+ <property name="column_spacing">6</property>
+ <property name="row_spacing">5</property>
<child>
<widget class="GtkLabel" id="label52">
<property name="visible">True</property>
@@ -716,49 +714,6 @@
</packing>
</child>
<child>
- <widget class="GtkEntry" id="net-ip4-network">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">False</property>
- <property name="invisible_char">●</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkEntry" id="net-ip4-dhcp-start">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">False</property>
- <property name="invisible_char">●</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkEntry" id="net-ip4-dhcp-end">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">False</property>
- <property name="invisible_char">●</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
<widget class="GtkLabel" id="label22">
<property name="visible">True</property>
<property name="xalign">0</property>
@@ -808,6 +763,49 @@
<property name="y_options">GTK_FILL</property>
</packing>
</child>
+ <child>
+ <widget class="GtkLabel" id="net-ip4-network">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label">label</property>
+ <property name="selectable">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="net-ip4-dhcp-start">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label">label</property>
+ <property name="selectable">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="net-ip4-dhcp-end">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label">label</property>
+ <property name="selectable">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
</widget>
</child>
<child>
@@ -1070,7 +1068,7 @@
<property name="n_rows">5</property>
<property name="n_columns">2</property>
<property name="column_spacing">8</property>
- <property name="row_spacing">3</property>
+ <property name="row_spacing">5</property>
<child>
<widget class="GtkLabel" id="label73">
<property name="visible">True</property>
@@ -1140,21 +1138,6 @@
</packing>
</child>
<child>
- <widget class="GtkEntry" id="pool-location">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">False</property>
- <property name="invisible_char">●</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
<widget class="GtkLabel" id="label75">
<property name="visible">True</property>
<property name="xalign">0</property>
@@ -1237,6 +1220,20 @@
<property name="y_options"></property>
</packing>
</child>
+ <child>
+ <widget class="GtkLabel" id="pool-location">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label">label</property>
+ <property name="selectable">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
@@ -1611,6 +1608,7 @@
<property name="xalign">0</property>
<property name="yalign">0</property>
<property name="label">insert mac</property>
+ <property name="selectable">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
@@ -1792,6 +1790,7 @@
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label">label</property>
+ <property name="selectable">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
@@ -1869,6 +1868,7 @@
<property name="xalign">0</property>
<property name="yalign">0</property>
<property name="label">label</property>
+ <property name="selectable">True</property>
</widget>
<packing>
<property name="left_attach">1</property>

View File

@ -0,0 +1,43 @@
commit db21a2a8331c8518f27b136d0013a56cf84df7e6
Author: Cole Robinson <crobinso@redhat.com>
Date: Mon Aug 29 14:01:40 2011 -0400
delete: Properly raise 'undefine' errors
diff --git a/src/virtManager/delete.py b/src/virtManager/delete.py
index 79d267e..22f3b23 100644
--- a/src/virtManager/delete.py
+++ b/src/virtManager/delete.py
@@ -183,7 +183,7 @@ class vmmDeleteDialog(vmmGObjectUI):
for errinfo in storage_errors:
storage_errstr += "%s\n%s\n" % (errinfo[0], errinfo[1])
- if not storage_errstr:
+ if not storage_errstr and not details:
return
# We had extra storage errors. If there was another error message,
commit b36ec4b8c2ec7ed72404db7f71cadfaecfea719e
Author: Cole Robinson <crobinso@redhat.com>
Date: Mon Aug 29 14:03:50 2011 -0400
domain: Remove managed save state before delete
Newer libvirt forbids 'undefine' in this case
diff --git a/src/virtManager/domain.py b/src/virtManager/domain.py
index 2e4ad4f..679dfc4 100644
--- a/src/virtManager/domain.py
+++ b/src/virtManager/domain.py
@@ -1055,6 +1055,11 @@ class vmmDomain(vmmLibvirtObject):
self.force_update_status()
def delete(self):
+ if self.hasSavedImage():
+ try:
+ self._backend.managedSaveRemove(0)
+ except:
+ logging.exception("Failed to remove managed save state")
self._backend.undefine()
def resume(self):

View File

@ -2,7 +2,7 @@
%define _package virt-manager
%define _version 0.9.0
%define _release 6
%define _release 7
%define virtinst_version 0.600.0
%define qemu_user "qemu"
@ -36,6 +36,16 @@ URL: http://virt-manager.org/
Source0: http://virt-manager.org/download/sources/%{name}/%{name}-%{version}.tar.gz
# Fix typo that broke net stats reporting
Patch1: %{name}-fix-net-stats.patch
# Fix 'Resize to VM' graphical option (bz 738806)
Patch2: %{name}-fix-resize-to-vm.patch
# Fix deleting guest with managed save data
Patch3: %{name}-managed-save-delete.patch
# Fix error when adding default storage
Patch4: %{name}-default-storage-error.patch
# Don't flush XML cache on every tick
Patch5: %{name}-cache-xml-fix.patch
# Use labels for non-editable network info fields (bz 738751)
Patch6: %{name}-host-net-labels.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@ -100,6 +110,10 @@ Requires(preun): GConf2
Requires(post): desktop-file-utils
Requires(postun): desktop-file-utils
%if %{with_spice}
%define default_graphics "spice"
%endif
%description
Virtual Machine Manager provides a graphical tool for administering virtual
machines for KVM, Xen, and QEmu. Start, stop, add or remove virtual devices,
@ -141,6 +155,11 @@ Common files used by the different Virtual Machine Manager interfaces.
%prep
%setup -q
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%build
%if %{qemu_user}
@ -163,7 +182,7 @@ Common files used by the different Virtual Machine Manager interfaces.
%define _disable_unsupported_rhel --disable-unsupported-rhel-options
%endif
%if %{default_graphics}
%if %{?default_graphics}
%define _default_graphics --with-default-graphics=%{default_graphics}
%endif
@ -178,7 +197,7 @@ Common files used by the different Virtual Machine Manager interfaces.
%{?_kvm_packages} \
%{?_libvirt_packages} \
%{?_preferred_distros} \
%{?_enable_unsupported_rhel} \
%{?_disable_unsupported_rhel} \
%{?_default_graphics}
make %{?_smp_mflags}
@ -195,15 +214,22 @@ rm -rf $RPM_BUILD_ROOT
%gconf_schema_prepare %{name}
%post
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
update-desktop-database -q %{_datadir}/applications
%gconf_schema_upgrade %{name}
%postun
if [ $1 -eq 0 ] ; then
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi
update-desktop-database -q %{_datadir}/applications
%preun
%gconf_schema_remove %{name}
%posttrans
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%if %{with_tui}
%files
@ -251,6 +277,14 @@ update-desktop-database -q %{_datadir}/applications
%endif
%changelog
* Tue Sep 27 2011 Cole Robinson <crobinso@redhat.com> - 0.9.0-7
- Fix 'Resize to VM' graphical option (bz 738806)
- Fix deleting guest with managed save data
- Fix error when adding default storage
- Don't flush XML cache on every tick
- Use labels for non-editable network info fields (bz 738751)
- Properly update icon cache (bz 733836)
* Tue Aug 02 2011 Cole Robinson <crobinso@redhat.com> - 0.9.0-6
- Fix python-newt_syrup dep