- 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

OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=243
This commit is contained in:
Charles Arnold 2015-07-29 15:03:15 +00:00 committed by Git OBS Bridge
parent dd8a28d4b2
commit 4e26d07e08
3 changed files with 80 additions and 2 deletions

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
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
-------------------------------------------------------------------
Wed Jul 8 11:29:25 MDT 2015 - carnold@suse.com

View File

@ -1,7 +1,7 @@
#
# spec file for package virt-manager
#
# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -15,6 +15,7 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define with_guestfs 0
%define askpass_package "openssh-askpass"
%define qemu_user "qemu"
@ -76,6 +77,7 @@ Patch152: virtman-increase-setKeepAlive-count.patch
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
Patch160: virtinst-xen-drive-type.patch
Patch161: virtinst-xenbus-disk-index-fix.patch
Patch162: virtinst-refresh_before_fetch_pool.patch
@ -88,7 +90,6 @@ Requires: avahi
Requires: dbus-1-x11
Requires: dconf
Requires: gtk3
Requires: libosinfo >= 0.2.10
Requires: python-gconf
Requires: virt-manager-common = %{verrel}
Requires: vm-install >= 0.5.6
@ -201,6 +202,7 @@ machine).
%patch153 -p1
%patch154 -p1
%patch155 -p1
%patch156 -p1
%patch160 -p1
%patch161 -p1
%patch162 -p1

View File

@ -0,0 +1,69 @@
Reference: bsc#938942
When a disk is added to an existing virtual machine and the storage format for
that disk is selected to be something other than qcow2 reset the image name
extension from qcow2 to the format selected. This is for a new disk that needs
to be created.
Index: virt-manager-1.2.1/virtManager/addstorage.py
===================================================================
--- virt-manager-1.2.1.orig/virtManager/addstorage.py
+++ virt-manager-1.2.1/virtManager/addstorage.py
@@ -58,9 +58,10 @@ class vmmAddStorage(vmmGObjectUI):
def _get_default_dir(self):
return virtinst.StoragePool.get_default_dir(self.conn.get_backend())
- def _get_ideal_path_info(self, name):
+ def _get_ideal_path_info(self, name, fmt=None):
path = self._get_default_dir()
- fmt = self.conn.get_default_storage_format()
+ if fmt is None:
+ fmt = self.conn.get_default_storage_format()
suffix = virtinst.StorageVolume.get_file_extension_for_format(fmt)
return (path, name, suffix or ".img")
@@ -208,7 +209,7 @@ class vmmAddStorage(vmmGObjectUI):
use_storage.set_sensitive(True)
storage_area.set_tooltip_text(storage_tooltip or "")
- def get_default_path(self, name, collidelist=None):
+ def get_default_path(self, name, fmt=None, collidelist=None):
collidelist = collidelist or []
pool = self.conn.get_default_pool()
@@ -217,15 +218,16 @@ class vmmAddStorage(vmmGObjectUI):
def path_exists(p):
return os.path.exists(p) or p in collidelist
+ target, ignore, suffix = self._get_ideal_path_info(name, fmt)
if not pool:
# Use old generating method
- origf = os.path.join(default_dir, name + ".img")
+ origf = os.path.join(default_dir, name + suffix)
f = origf
n = 1
while path_exists(f) and n < 100:
f = os.path.join(default_dir, name +
- "-" + str(n) + ".img")
+ "-" + str(n) + suffix)
n += 1
if path_exists(f):
@@ -233,8 +235,6 @@ class vmmAddStorage(vmmGObjectUI):
path = f
else:
- target, ignore, suffix = self._get_ideal_path_info(name)
-
# Sanitize collidelist to work with the collision checker
newcollidelist = []
for c in collidelist:
@@ -310,7 +310,7 @@ class vmmAddStorage(vmmGObjectUI):
not self.widget("config-storage-nosparse").get_active())
if path is None:
if is_default:
- path = self.get_default_path(vmname, collidelist)
+ path = self.get_default_path(vmname, fmt, collidelist)
else:
path = self.widget("config-storage-entry").get_text().strip()