From 19009636f3719fe32bc854a8a09fcc93e8d7ed14 Mon Sep 17 00:00:00 2001 From: Charles Arnold Date: Thu, 30 Jul 2015 22:00:56 +0000 Subject: [PATCH] virtman-allow-other-disk-formats.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=244 --- virt-manager.changes | 1 + virt-manager.spec | 2 ++ virtman-allow-other-disk-formats.patch | 48 ++++++++++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 virtman-allow-other-disk-formats.patch diff --git a/virt-manager.changes b/virt-manager.changes index 5f6cea93..8c3e122c 100644 --- a/virt-manager.changes +++ b/virt-manager.changes @@ -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 diff --git a/virt-manager.spec b/virt-manager.spec index 6d61bb02..b4fea74f 100644 --- a/virt-manager.spec +++ b/virt-manager.spec @@ -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 diff --git a/virtman-allow-other-disk-formats.patch b/virtman-allow-other-disk-formats.patch new file mode 100644 index 00000000..a5495a3d --- /dev/null +++ b/virtman-allow-other-disk-formats.patch @@ -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 = "-"