virtman-allow-other-disk-formats.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=244
This commit is contained in:
Charles Arnold 2015-07-30 22:00:56 +00:00 committed by Git OBS Bridge
parent 4e26d07e08
commit 19009636f3
3 changed files with 51 additions and 0 deletions

View File

@ -4,6 +4,7 @@ Thu Jul 23 09:39:26 MDT 2015 - carnold@suse.com
- bsc#938942 - Can't create a vmguest with raw format image with
virt-manager at first installation (option disable)
virtman-reset-image-filename-based-on-format.patch
virtman-allow-other-disk-formats.patch
-------------------------------------------------------------------
Wed Jul 8 11:29:25 MDT 2015 - carnold@suse.com

View File

@ -78,6 +78,7 @@ Patch153: virtman-allow-destroy-from-shutdown-menu-of-crashed-vm.patch
Patch154: virtman-check-for-valid-display.patch
Patch155: virtman-allow-creating-i686-vm.patch
Patch156: virtman-reset-image-filename-based-on-format.patch
Patch157: virtman-allow-other-disk-formats.patch
Patch160: virtinst-xen-drive-type.patch
Patch161: virtinst-xenbus-disk-index-fix.patch
Patch162: virtinst-refresh_before_fetch_pool.patch
@ -203,6 +204,7 @@ machine).
%patch154 -p1
%patch155 -p1
%patch156 -p1
%patch157 -p1
%patch160 -p1
%patch161 -p1
%patch162 -p1

View File

@ -0,0 +1,48 @@
Reference: bsc#938942
Allow something other than qcow2 to be selected as the initial boot disk
from the 'Customize configuration before install' screen. This is valid
only when the disk has not yet been created.
Index: virt-manager-1.2.1/virtManager/details.py
===================================================================
--- virt-manager-1.2.1.orig/virtManager/details.py
+++ virt-manager-1.2.1/virtManager/details.py
@@ -1830,7 +1830,13 @@ class vmmDetails(vmmGObjectUI):
self.enable_apply(EDIT_BOOTORDER)
def disk_format_changed(self, ignore):
- self.widget("disk-format-warn").show()
+ # Allow changing the disk format if disk hasn't yet been created
+ disk = self.get_hw_selection(HW_LIST_COL_DEVICE)
+ show_warn = (disk and \
+ virtinst.VirtualDisk.path_definitely_exists(disk.conn, disk.path)) and not \
+ self.is_customize_dialog
+ if show_warn:
+ self.widget("disk-format-warn").show()
self.enable_apply(EDIT_DISK_FORMAT)
# IO Tuning
@@ -2694,10 +2700,22 @@ class vmmDetails(vmmGObjectUI):
iotune_wbs = (disk.iotune_wbs or 0) / 1024
iotune_wis = (disk.iotune_wis or 0)
- show_format = (not self.is_customize_dialog or
+ show_format = (not self.is_customize_dialog or not
virtinst.VirtualDisk.path_definitely_exists(
disk.conn, disk.path))
+ # If customizing and disk doesn't exist, allow format type to change
+ if show_format and self.is_customize_dialog:
+ fmt = uiutil.get_list_selection(self.widget("disk-format"))
+ guest = self.vm.get_backend()
+ if guest and fmt:
+ for d in guest.get_devices("disk"):
+ if d.path == disk.path:
+ dvol = d.get_vol_install()
+ if fmt in dvol.list_formats():
+ dvol.format = fmt
+ break
+
size = _("Unknown")
if not path:
size = "-"