filesystem: Fix target validation when editing device (bz #1089422)

details: Explicit warn that 'format' doesn't change image format (bz #1089457)
snapshots: Fix screenshot with qxl+spice (bz #1089780)
Fix using storage when the directory name contains whitespace (bz #1091384)
packageutils: Fix install when one package is already installed (bz #1090181)
This commit is contained in:
Cole Robinson 2014-04-29 14:40:46 -04:00
parent 3e1ed9fdaa
commit 8d445c7717
6 changed files with 394 additions and 1 deletions

View File

@ -0,0 +1,25 @@
From f3d8bec24a5f459d5aab199db309af5d3b5d3d54 Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Mon, 21 Apr 2014 16:51:23 -0400
Subject: [PATCH] filesystem: Fix target validation when editing device (bz
1089422)
(cherry picked from commit e6a67fc7099ac39257108080c8cbcfcdc6371e56)
---
virtinst/devicefilesystem.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/virtinst/devicefilesystem.py b/virtinst/devicefilesystem.py
index f516fed..28eda74 100644
--- a/virtinst/devicefilesystem.py
+++ b/virtinst/devicefilesystem.py
@@ -100,7 +100,8 @@ class VirtualFilesystem(VirtualDevice):
# actually a directory, it is merely a arbitrary string tag
# that is exported to the guest as a hint for where to mount
if (self.conn.is_qemu() and
- (self.type == self.TYPE_DEFAULT or
+ (self.type is None or
+ self.type == self.TYPE_DEFAULT or
self.type == self.TYPE_MOUNT)):
pass
elif not os.path.isabs(val):

View File

@ -0,0 +1,227 @@
From b52f1f0eb36a347971cb380f13044b549a92b9c4 Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Mon, 21 Apr 2014 17:04:33 -0400
Subject: [PATCH] details: Explicit warn that 'format' doesn't change image
format (bz 1089457)
(cherry picked from commit 70da20682c9aba1e2bc738b19dfc6bb714d38496)
---
ui/details.ui | 104 +++++++++++++++++++++++++++++++++++++------------
virtManager/details.py | 7 +++-
2 files changed, 85 insertions(+), 26 deletions(-)
diff --git a/ui/details.ui b/ui/details.ui
index 044654d..92de903 100644
--- a/ui/details.ui
+++ b/ui/details.ui
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.16.0 on Mon Feb 24 22:09:46 2014 -->
+<!-- Generated with glade 3.16.1 -->
<interface>
- <!-- interface-requires gtk+ 3.0 -->
+ <requires lib="gtk+" version="3.0"/>
<object class="GtkAccelGroup" id="accelgroup1"/>
<object class="GtkAdjustment" id="adjustment1">
<property name="lower">1</property>
@@ -1919,12 +1919,12 @@
<property name="climb_rate">1</property>
<property name="numeric">True</property>
<property name="update_policy">if-valid</property>
+ <signal name="changed" handler="on_config_vcpus_changed" swapped="no"/>
<child internal-child="accessible">
<object class="AtkObject" id="config-vcpus-atkobject">
<property name="AtkObject::accessible-name" translatable="yes">Virtual CPU Select</property>
</object>
</child>
- <signal name="changed" handler="on_config_vcpus_changed" swapped="no"/>
</object>
<packing>
<property name="left_attach">1</property>
@@ -2319,12 +2319,12 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">●</property>
+ <signal name="changed" handler="on_config_vcpupin_changed" swapped="no"/>
<child internal-child="accessible">
<object class="AtkObject" id="config-vcpupin-atkobject">
<property name="AtkObject::accessible-name" translatable="yes">Virtual CPU Affinity Select</property>
</object>
</child>
- <signal name="changed" handler="on_config_vcpupin_changed" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
@@ -2553,12 +2553,12 @@
<property name="climb_rate">2</property>
<property name="numeric">True</property>
<property name="update_policy">if-valid</property>
+ <signal name="changed" handler="on_config_memory_changed" swapped="no"/>
<child internal-child="accessible">
<object class="AtkObject" id="config-memory-atkobject">
<property name="AtkObject::accessible-name" translatable="yes">Memory Select</property>
</object>
</child>
- <signal name="changed" handler="on_config_memory_changed" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
@@ -2602,12 +2602,12 @@
<property name="climb_rate">2</property>
<property name="numeric">True</property>
<property name="update_policy">if-valid</property>
+ <signal name="changed" handler="on_config_maxmem_changed" swapped="no"/>
<child internal-child="accessible">
<object class="AtkObject" id="config-maxmem-atkobject">
<property name="AtkObject::accessible-name" translatable="yes">Max Memory Select</property>
</object>
</child>
- <signal name="changed" handler="on_config_maxmem_changed" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
@@ -3517,6 +3517,8 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">1</property>
+ <property name="yalign">0</property>
+ <property name="ypad">4</property>
<property name="label" translatable="yes">Storage forma_t:</property>
<property name="use_underline">True</property>
</object>
@@ -3558,25 +3560,6 @@
</packing>
</child>
<child>
- <object class="GtkComboBox" id="disk-format">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="has_entry">True</property>
- <signal name="changed" handler="on_disk_format_changed" swapped="no"/>
- <child internal-child="entry">
- <object class="GtkEntry" id="combobox-entry9">
- <property name="can_focus">True</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">2</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
<object class="GtkComboBox" id="disk-bus">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -3610,6 +3593,77 @@
<property name="height">1</property>
</packing>
</child>
+ <child>
+ <object class="GtkBox" id="box15">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkComboBox" id="disk-format">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="has_entry">True</property>
+ <signal name="changed" handler="on_disk_format_changed" swapped="no"/>
+ <child internal-child="entry">
+ <object class="GtkEntry" id="combobox-entry9">
+ <property name="can_focus">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="disk-format-warn">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">3</property>
+ <child>
+ <object class="GtkImage" id="image2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-dialog-warning</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label34">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">&lt;small&gt;Changing this will not change the disk image format, it only tells libvirt about the existing image format. &lt;/small&gt;</property>
+ <property name="use_markup">True</property>
+ <property name="wrap">True</property>
+ <property name="max_width_chars">30</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">2</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">False</property>
diff --git a/virtManager/details.py b/virtManager/details.py
index 10b03ce..1bb57d5 100644
--- a/virtManager/details.py
+++ b/virtManager/details.py
@@ -625,7 +625,7 @@ class vmmDetails(vmmGObjectUI):
"on_disk_cache_combo_changed": lambda *x: self.enable_apply(x, EDIT_DISK_CACHE),
"on_disk_io_combo_changed": lambda *x: self.enable_apply(x, EDIT_DISK_IO),
"on_disk_bus_combo_changed": lambda *x: self.enable_apply(x, EDIT_DISK_BUS),
- "on_disk_format_changed": lambda *x: self.enable_apply(x, EDIT_DISK_FORMAT),
+ "on_disk_format_changed": self.disk_format_changed,
"on_disk_serial_changed": lambda *x: self.enable_apply(x, EDIT_DISK_SERIAL),
"on_disk_iotune_changed": self.iotune_changed,
@@ -1787,6 +1787,10 @@ class vmmDetails(vmmGObjectUI):
boot_list.get_selection().emit("changed")
self.enable_apply(EDIT_BOOTORDER)
+ def disk_format_changed(self, ignore):
+ self.widget("disk-format-warn").show()
+ self.enable_apply(EDIT_DISK_FORMAT)
+
# IO Tuning
def iotune_changed(self, ignore):
iotune_rbs = int(self.get_text("disk-iotune-rbs") or 0)
@@ -2682,6 +2686,7 @@ class vmmDetails(vmmGObjectUI):
self.widget("disk-format").set_sensitive(show_format)
self.widget("disk-format").get_child().set_text(driver_type)
+ self.widget("disk-format-warn").hide()
no_default = not self.is_customize_dialog

View File

@ -0,0 +1,26 @@
From c8cb642b0f7069e0eb803d6e0c4d8a44df0c57d2 Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Tue, 29 Apr 2014 13:26:26 -0400
Subject: [PATCH] snapshots: Fix screenshot with qxl+spice (bz 1089780)
(cherry picked from commit 2272166844f84943342fc097af927a09737ee57f)
---
virtManager/snapshots.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/virtManager/snapshots.py b/virtManager/snapshots.py
index 6d4d9ac..56fdc81 100644
--- a/virtManager/snapshots.py
+++ b/virtManager/snapshots.py
@@ -379,6 +379,11 @@ class vmmSnapshotPage(vmmGObjectUI):
return
try:
+ # Perform two screenshots, because qemu + qxl has a bug where
+ # screenshot generally only shows the data from the previous
+ # screenshot request:
+ # https://bugs.launchpad.net/qemu/+bug/1314293
+ self._take_screenshot()
mime, sdata = self._take_screenshot()
except:
logging.exception("Error taking screenshot")

View File

@ -0,0 +1,34 @@
From ca6d90b3d6d759e407855dfd4ba869c4f85542d3 Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Tue, 29 Apr 2014 14:09:14 -0400
Subject: [PATCH] Fix using storage when the directory name contains whitespace
(bz 1091384)
(cherry picked from commit feadd98fed045ec40d5d5cf8250c7b05517eb9c9)
---
virtinst/diskbackend.py | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/virtinst/diskbackend.py b/virtinst/diskbackend.py
index 370996c..3d5aed8 100644
--- a/virtinst/diskbackend.py
+++ b/virtinst/diskbackend.py
@@ -137,13 +137,14 @@ def manage_path(conn, path):
return vol, pool, path_is_pool
dirname = os.path.dirname(path)
- poolname = StoragePool.find_free_name(
- conn, os.path.basename(dirname) or "pool")
+ poolname = os.path.basename(dirname).replace(" ", "_")
+ if not poolname:
+ poolname = "dirpool"
+ poolname = StoragePool.find_free_name(conn, poolname)
logging.debug("Attempting to build pool=%s target=%s", poolname, dirname)
poolxml = StoragePool(conn)
- poolxml.name = poolxml.find_free_name(
- conn, os.path.basename(dirname) or "dirpool")
+ poolxml.name = poolname
poolxml.type = poolxml.TYPE_DIR
poolxml.target_path = dirname
pool = poolxml.install(build=False, create=True, autostart=True)

View File

@ -0,0 +1,46 @@
From aa9a8aedfbbca635eb34f168b8e04ba9730584f5 Mon Sep 17 00:00:00 2001
From: Cole Robinson <crobinso@redhat.com>
Date: Tue, 29 Apr 2014 14:34:31 -0400
Subject: [PATCH] packageutils: Fix install when one package is already
installed (bz 1090181)
(cherry picked from commit 15449eb12601ec1b88aa6d8ee52986ef5ab41ae2)
---
virtManager/packageutils.py | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/virtManager/packageutils.py b/virtManager/packageutils.py
index 34478b7..bb84f45 100644
--- a/virtManager/packageutils.py
+++ b/virtManager/packageutils.py
@@ -53,7 +53,12 @@ def check_packagekit(parent, errbox, packages):
return
try:
- packagekit_install(parent, packages)
+ for package in packages[:]:
+ if packagekit_isinstalled(package):
+ packages.remove(package)
+
+ if packages:
+ packagekit_install(parent, packages)
except Exception, e:
# PackageKit frontend should report an error for us, so just log
# the actual error
@@ -63,6 +68,16 @@ def check_packagekit(parent, errbox, packages):
return True
+def packagekit_isinstalled(package):
+ bus = Gio.bus_get_sync(Gio.BusType.SESSION, None)
+ pk_control = Gio.DBusProxy.new_sync(bus, 0, None,
+ "org.freedesktop.PackageKit",
+ "/org/freedesktop/PackageKit",
+ "org.freedesktop.PackageKit.Query", None)
+
+ return pk_control.IsInstalled("(ss)", package, "")
+
+
def packagekit_install(parent, package_list):
bus = Gio.bus_get_sync(Gio.BusType.SESSION, None)
pk_control = Gio.DBusProxy.new_sync(bus, 0, None,

View File

@ -20,7 +20,7 @@
%define _version 1.0.1
%define _release 2
%define _release 3
# This macro is used for the continuous automated builds. It just
@ -53,6 +53,19 @@ Patch0005: 0005-createpool-Clarify-iscsi-IQN-fields-bz-1084011.patch
# More fixes for errors on libvirtd disconnect (bz #1069351)
Patch0006: 0006-error-Don-t-log-redundant-details-bits.patch
Patch0007: 0007-engine-More-work-to-fix-cascading-error-dialogs.patch
# filesystem: Fix target validation when editing device (bz #1089422)
Patch0008: 0008-filesystem-Fix-target-validation-when-editing-device.patch
# details: Explicit warn that 'format' doesn't change image format (bz
# #1089457)
Patch0009: 0009-details-Explicit-warn-that-format-doesn-t-change-ima.patch
# snapshots: Fix screenshot with qxl+spice (bz #1089780)
Patch0010: 0010-snapshots-Fix-screenshot-with-qxl-spice-bz-1089780.patch
# Fix using storage when the directory name contains whitespace (bz
# #1091384)
Patch0011: 0011-Fix-using-storage-when-the-directory-name-contains-w.patch
# packageutils: Fix install when one package is already installed (bz
# #1090181)
Patch0012: 0012-packageutils-Fix-install-when-one-package-is-already.patch
BuildArch: noarch
@ -132,6 +145,19 @@ machine).
# More fixes for errors on libvirtd disconnect (bz #1069351)
%patch0006 -p1
%patch0007 -p1
# filesystem: Fix target validation when editing device (bz #1089422)
%patch0008 -p1
# details: Explicit warn that 'format' doesn't change image format (bz
# #1089457)
%patch0009 -p1
# snapshots: Fix screenshot with qxl+spice (bz #1089780)
%patch0010 -p1
# Fix using storage when the directory name contains whitespace (bz
# #1091384)
%patch0011 -p1
# packageutils: Fix install when one package is already installed (bz
# #1090181)
%patch0012 -p1
%build
%if %{qemu_user}
@ -241,6 +267,15 @@ fi
%changelog
* Tue Apr 29 2014 Cole Robinson <crobinso@redhat.com> - 1.0.1-3
- filesystem: Fix target validation when editing device (bz #1089422)
- details: Explicit warn that 'format' doesn't change image format (bz
#1089457)
- snapshots: Fix screenshot with qxl+spice (bz #1089780)
- Fix using storage when the directory name contains whitespace (bz #1091384)
- packageutils: Fix install when one package is already installed (bz
#1090181)
* Wed Apr 16 2014 Cole Robinson <crobinso@redhat.com> - 1.0.1-2
- gfxdetails: Show port number for active autoport VM (bz #1081614)
- connection: Hook into domain balloon event (bz #1081424)