- Fix selection of network volumes (bsc#1100558)
5a7698c7-fix-select-network-vol.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=433
This commit is contained in:
parent
70473cbdd6
commit
476fb9a620
65
5a7698c7-fix-select-network-vol.patch
Normal file
65
5a7698c7-fix-select-network-vol.patch
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
commit 5a7698c7998d673e0742046478630824162966b4
|
||||||
|
Author: Jim Fehlig <jfehlig@suse.com>
|
||||||
|
Date: Tue Oct 9 14:30:09 2018 -0600
|
||||||
|
|
||||||
|
Fix selection of network volumes
|
||||||
|
|
||||||
|
When creating a new VM and selecting a volume from a network-based
|
||||||
|
storage pool such as rbd, the volume is not recognized as network-based
|
||||||
|
and is treated as a volume from a directory storage pool.
|
||||||
|
|
||||||
|
This patch adds a method to check if the volume's path points to a
|
||||||
|
network-based volume, then uses the method to avoid actions like
|
||||||
|
setting unix file permissions on the volume, which doesn't make
|
||||||
|
sense for a network-based volume.
|
||||||
|
|
||||||
|
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
|
||||||
|
|
||||||
|
(crobinso: rebase, tweak lookup logic)
|
||||||
|
|
||||||
|
Index: virt-manager-1.5.1/virtinst/diskbackend.py
|
||||||
|
===================================================================
|
||||||
|
--- virt-manager-1.5.1.orig/virtinst/diskbackend.py
|
||||||
|
+++ virt-manager-1.5.1/virtinst/diskbackend.py
|
||||||
|
@@ -156,7 +156,7 @@ def manage_path(conn, path):
|
||||||
|
if not path:
|
||||||
|
return None, None
|
||||||
|
|
||||||
|
- if not path_is_url(path):
|
||||||
|
+ if not path_is_url(path) and not path_is_network_vol(conn, path):
|
||||||
|
path = os.path.abspath(path)
|
||||||
|
vol, pool = check_if_path_managed(conn, path)
|
||||||
|
if vol or pool or not _can_auto_manage(path):
|
||||||
|
@@ -188,6 +188,19 @@ def path_is_url(path):
|
||||||
|
return bool(re.match("[a-zA-Z]+(\+[a-zA-Z]+)?://.*", path))
|
||||||
|
|
||||||
|
|
||||||
|
+def path_is_network_vol(conn, path):
|
||||||
|
+ """
|
||||||
|
+ Detect if path is a network volume such as rbd, gluster, etc
|
||||||
|
+ """
|
||||||
|
+ if not path:
|
||||||
|
+ return False
|
||||||
|
+
|
||||||
|
+ for volxml in conn.fetch_all_vols():
|
||||||
|
+ if volxml.target_path == path:
|
||||||
|
+ return volxml.type == "network"
|
||||||
|
+ return False
|
||||||
|
+
|
||||||
|
+
|
||||||
|
def _get_dev_type(path, vol_xml, vol_object, pool_xml, remote):
|
||||||
|
"""
|
||||||
|
Try to get device type for volume.
|
||||||
|
Index: virt-manager-1.5.1/virtinst/devicedisk.py
|
||||||
|
===================================================================
|
||||||
|
--- virt-manager-1.5.1.orig/virtinst/devicedisk.py
|
||||||
|
+++ virt-manager-1.5.1/virtinst/devicedisk.py
|
||||||
|
@@ -216,6 +216,8 @@ class VirtualDisk(VirtualDevice):
|
||||||
|
return []
|
||||||
|
if diskbackend.path_is_url(path):
|
||||||
|
return []
|
||||||
|
+ if diskbackend.path_is_network_vol(conn, path):
|
||||||
|
+ return []
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Get UID for string name
|
@ -1,3 +1,9 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Oct 16 02:24:29 UTC 2018 - James Fehlig <jfehlig@suse.com>
|
||||||
|
|
||||||
|
- Fix selection of network volumes (bsc#1100558)
|
||||||
|
5a7698c7-fix-select-network-vol.patch
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Fri Jul 13 16:03:17 MDT 2018 - carnold@suse.com
|
Fri Jul 13 16:03:17 MDT 2018 - carnold@suse.com
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
# license that conforms to the Open Source Definition (Version 1.9)
|
# license that conforms to the Open Source Definition (Version 1.9)
|
||||||
# published by the Open Source Initiative.
|
# published by the Open Source Initiative.
|
||||||
|
|
||||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
@ -41,6 +41,7 @@ Source3: virt-manager-supportconfig
|
|||||||
Patch1: 27d4b167-virtinst-update-location-for-opensuse.patch
|
Patch1: 27d4b167-virtinst-update-location-for-opensuse.patch
|
||||||
Patch2: d15b78ab-virtinst-read-CPU-model-from-domain-capabilities.patch
|
Patch2: d15b78ab-virtinst-read-CPU-model-from-domain-capabilities.patch
|
||||||
Patch3: fd6a8154-virtinst-compare-host-and-domain-cpu-models.patch
|
Patch3: fd6a8154-virtinst-compare-host-and-domain-cpu-models.patch
|
||||||
|
Patch4: 5a7698c7-fix-select-network-vol.patch
|
||||||
# SUSE Only
|
# SUSE Only
|
||||||
Patch70: virtman-desktop.patch
|
Patch70: virtman-desktop.patch
|
||||||
Patch71: virtman-kvm.patch
|
Patch71: virtman-kvm.patch
|
||||||
@ -186,6 +187,7 @@ machine).
|
|||||||
%patch1 -p1
|
%patch1 -p1
|
||||||
%patch2 -p1
|
%patch2 -p1
|
||||||
%patch3 -p1
|
%patch3 -p1
|
||||||
|
%patch4 -p1
|
||||||
# SUSE Only
|
# SUSE Only
|
||||||
%patch70 -p1
|
%patch70 -p1
|
||||||
%patch71 -p1
|
%patch71 -p1
|
||||||
|
@ -325,7 +325,7 @@ Index: virt-manager-1.5.1/virtinst/devicedisk.py
|
|||||||
|
|
||||||
|
|
||||||
class _Host(XMLBuilder):
|
class _Host(XMLBuilder):
|
||||||
@@ -453,7 +453,7 @@ class VirtualDisk(VirtualDevice):
|
@@ -455,7 +455,7 @@ class VirtualDisk(VirtualDevice):
|
||||||
digit = 1
|
digit = 1
|
||||||
|
|
||||||
seen_valid = True
|
seen_valid = True
|
||||||
@ -334,7 +334,7 @@ Index: virt-manager-1.5.1/virtinst/devicedisk.py
|
|||||||
|
|
||||||
return gen_t
|
return gen_t
|
||||||
|
|
||||||
@@ -1054,11 +1054,11 @@ class VirtualDisk(VirtualDevice):
|
@@ -1056,11 +1056,11 @@ class VirtualDisk(VirtualDevice):
|
||||||
def get_target():
|
def get_target():
|
||||||
first_found = None
|
first_found = None
|
||||||
|
|
||||||
@ -554,7 +554,7 @@ Index: virt-manager-1.5.1/virtinst/diskbackend.py
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- virt-manager-1.5.1.orig/virtinst/diskbackend.py
|
--- virt-manager-1.5.1.orig/virtinst/diskbackend.py
|
||||||
+++ virt-manager-1.5.1/virtinst/diskbackend.py
|
+++ virt-manager-1.5.1/virtinst/diskbackend.py
|
||||||
@@ -391,7 +391,7 @@ class CloneStorageCreator(_StorageCreato
|
@@ -404,7 +404,7 @@ class CloneStorageCreator(_StorageCreato
|
||||||
else:
|
else:
|
||||||
vfs = os.statvfs(os.path.dirname(self._path))
|
vfs = os.statvfs(os.path.dirname(self._path))
|
||||||
avail = vfs.f_frsize * vfs.f_bavail
|
avail = vfs.f_frsize * vfs.f_bavail
|
||||||
@ -563,7 +563,7 @@ Index: virt-manager-1.5.1/virtinst/diskbackend.py
|
|||||||
if need > avail:
|
if need > avail:
|
||||||
if self._sparse:
|
if self._sparse:
|
||||||
msg = _("The filesystem will not have enough free space"
|
msg = _("The filesystem will not have enough free space"
|
||||||
@@ -411,7 +411,7 @@ class CloneStorageCreator(_StorageCreato
|
@@ -424,7 +424,7 @@ class CloneStorageCreator(_StorageCreato
|
||||||
text = (_("Cloning %(srcfile)s") %
|
text = (_("Cloning %(srcfile)s") %
|
||||||
{'srcfile': os.path.basename(self._input_path)})
|
{'srcfile': os.path.basename(self._input_path)})
|
||||||
|
|
||||||
|
@ -2,11 +2,11 @@ References: bsc#989639
|
|||||||
When the device added is a cdrom device (/dev/sr0), don't use
|
When the device added is a cdrom device (/dev/sr0), don't use
|
||||||
"phy" as the driver name but instead use "qemu".
|
"phy" as the driver name but instead use "qemu".
|
||||||
|
|
||||||
Index: virt-manager-1.5.0/virtinst/devicedisk.py
|
Index: virt-manager-1.5.1/virtinst/devicedisk.py
|
||||||
===================================================================
|
===================================================================
|
||||||
--- virt-manager-1.5.0.orig/virtinst/devicedisk.py
|
--- virt-manager-1.5.1.orig/virtinst/devicedisk.py
|
||||||
+++ virt-manager-1.5.0/virtinst/devicedisk.py
|
+++ virt-manager-1.5.1/virtinst/devicedisk.py
|
||||||
@@ -561,7 +561,8 @@ class VirtualDisk(VirtualDevice):
|
@@ -563,7 +563,8 @@ class VirtualDisk(VirtualDevice):
|
||||||
# Recommended xen defaults from here:
|
# Recommended xen defaults from here:
|
||||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1171550#c9
|
# https://bugzilla.redhat.com/show_bug.cgi?id=1171550#c9
|
||||||
# If type block, use name=phy. Otherwise do the same as qemu
|
# If type block, use name=phy. Otherwise do the same as qemu
|
||||||
|
@ -2,11 +2,11 @@ Reference: bnc#813082
|
|||||||
Virt-manager on Xen doesn't fill in any type thereby defaulting to
|
Virt-manager on Xen doesn't fill in any type thereby defaulting to
|
||||||
'raw'. This patch will generate the correct XML on Xen.
|
'raw'. This patch will generate the correct XML on Xen.
|
||||||
|
|
||||||
Index: virt-manager-1.5.0/virtinst/devicedisk.py
|
Index: virt-manager-1.5.1/virtinst/devicedisk.py
|
||||||
===================================================================
|
===================================================================
|
||||||
--- virt-manager-1.5.0.orig/virtinst/devicedisk.py
|
--- virt-manager-1.5.1.orig/virtinst/devicedisk.py
|
||||||
+++ virt-manager-1.5.0/virtinst/devicedisk.py
|
+++ virt-manager-1.5.1/virtinst/devicedisk.py
|
||||||
@@ -579,6 +579,10 @@ class VirtualDisk(VirtualDevice):
|
@@ -581,6 +581,10 @@ class VirtualDisk(VirtualDevice):
|
||||||
http://lists.gnu.org/archive/html/qemu-devel/2008-04/msg00675.html
|
http://lists.gnu.org/archive/html/qemu-devel/2008-04/msg00675.html
|
||||||
"""
|
"""
|
||||||
if self.driver_name != self.DRIVER_NAME_QEMU:
|
if self.driver_name != self.DRIVER_NAME_QEMU:
|
||||||
|
@ -6,11 +6,11 @@ types (ide vs xen) it added xvda with hda. These disks were then
|
|||||||
passed to qemu where it error'ed out with the disks having the same
|
passed to qemu where it error'ed out with the disks having the same
|
||||||
index (in this case both are 0).
|
index (in this case both are 0).
|
||||||
|
|
||||||
Index: virt-manager-1.5.0/virtinst/devicedisk.py
|
Index: virt-manager-1.5.1/virtinst/devicedisk.py
|
||||||
===================================================================
|
===================================================================
|
||||||
--- virt-manager-1.5.0.orig/virtinst/devicedisk.py
|
--- virt-manager-1.5.1.orig/virtinst/devicedisk.py
|
||||||
+++ virt-manager-1.5.0/virtinst/devicedisk.py
|
+++ virt-manager-1.5.1/virtinst/devicedisk.py
|
||||||
@@ -1036,6 +1036,17 @@ class VirtualDisk(VirtualDevice):
|
@@ -1038,6 +1038,17 @@ class VirtualDisk(VirtualDevice):
|
||||||
@rtype C{str}
|
@rtype C{str}
|
||||||
"""
|
"""
|
||||||
prefix, maxnode = self.get_target_prefix(skip_targets)
|
prefix, maxnode = self.get_target_prefix(skip_targets)
|
||||||
@ -28,7 +28,7 @@ Index: virt-manager-1.5.0/virtinst/devicedisk.py
|
|||||||
skip_targets = [t for t in skip_targets if t and t.startswith(prefix)]
|
skip_targets = [t for t in skip_targets if t and t.startswith(prefix)]
|
||||||
skip_targets.sort()
|
skip_targets.sort()
|
||||||
|
|
||||||
@@ -1049,7 +1060,12 @@ class VirtualDisk(VirtualDevice):
|
@@ -1051,7 +1062,12 @@ class VirtualDisk(VirtualDevice):
|
||||||
ran = range(pref_ctrl * 7, (pref_ctrl + 1) * 7)
|
ran = range(pref_ctrl * 7, (pref_ctrl + 1) * 7)
|
||||||
|
|
||||||
for i in ran:
|
for i in ran:
|
||||||
|
Loading…
Reference in New Issue
Block a user