Accepting request 60111 from Virtualization

Accepted submit request 60111 from user charlesa

OBS-URL: https://build.opensuse.org/request/show/60111
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/virt-manager?expand=0&rev=48
This commit is contained in:
Ruediger Oertel 2011-02-07 11:24:44 +00:00 committed by Git OBS Bridge
commit fb156a89e2
3 changed files with 61 additions and 1 deletions

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Tue Jan 18 11:21:29 MST 2011 - carnold@novell.com
- bnc#657272 - virt-manager creates default 'dir' storage pool in
/var/lib/libvirt/images on xen host
virtman-storage-pool.diff
-------------------------------------------------------------------
Fri Jan 7 16:31:05 MST 2011 - carnold@novell.com

View File

@ -1,5 +1,5 @@
#
# spec file for package virt-manager
# spec file for package virt-manager (Version 0.8.5)
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@ -51,6 +51,7 @@ Patch58: virtman-keycombo.diff
Patch59: virtman-autoconnect.diff
Patch60: virtman-device-flags.diff
Patch61: virtman-autorestart.diff
Patch62: virtman-storage-pool.diff
Patch81: virtinst-cdrom.diff
Patch82: virtinst-storage-ocfs2.diff
ExclusiveArch: %{ix86} x86_64
@ -146,6 +147,7 @@ Authors:
%patch59 -p1
%patch60 -p1
%patch61 -p1
%patch62 -p1
pushd $RPM_BUILD_DIR/%{virtinst_name}
%patch81 -p1
%patch82 -p1

51
virtman-storage-pool.diff Normal file
View File

@ -0,0 +1,51 @@
When connecting to a xen host, create default dir storage pool
in /var/lib/xen/images instead of /var/lib/libvirt/images.
Index: virt-manager-0.8.5/src/virtManager/connection.py
===================================================================
--- virt-manager-0.8.5.orig/src/virtManager/connection.py
+++ virt-manager-0.8.5/src/virtManager/connection.py
@@ -1144,7 +1144,8 @@ class vmmConnection(gobject.GObject):
else:
# Try to create the default storage pool
try:
- util.build_default_pool(self.vmm)
+ util.build_default_pool(self.vmm, \
+ self.config.get_default_image_dir(self))
except Exception, e:
logging.debug("Building default pool failed: %s" % str(e))
Index: virt-manager-0.8.5/src/virtManager/util.py
===================================================================
--- virt-manager-0.8.5.orig/src/virtManager/util.py
+++ virt-manager-0.8.5/src/virtManager/util.py
@@ -31,9 +31,8 @@ import virtManager
import virtinst
DEFAULT_POOL_NAME = "default"
-DEFAULT_POOL_PATH = "/var/lib/libvirt/images"
-def build_default_pool(conn):
+def build_default_pool(conn, path):
"""
Helper to build the 'default' storage pool
"""
@@ -54,15 +53,15 @@ def build_default_pool(conn):
try:
logging.debug("Attempting to build default pool with target '%s'" %
- DEFAULT_POOL_PATH)
+ path)
defpool = virtinst.Storage.DirectoryPool(conn=conn,
name=DEFAULT_POOL_NAME,
- target_path=DEFAULT_POOL_PATH)
+ target_path=path)
newpool = defpool.install(build=True, create=True)
newpool.setAutostart(True)
except Exception, e:
raise RuntimeError(_("Couldn't create default storage pool '%s': %s") %
- (DEFAULT_POOL_PATH, str(e)))
+ (path, str(e)))
def get_ideal_path_info(conn, config, name):
path = get_default_dir(conn, config)