- Upstream bug fixes

531db6a7-new-volume-tooltip-logic.patch
  531dbfa7-handle-errors-when-deregistering-events-on-close.patch

- Upstream bug fixes
  5318a2cd-cpu-model-fallback-failure-fix.patch
  5318a626-adding-filesystem-device-fix.patch
  5318aa88-invalid-libvirt-volume-XML.patch
  5318b486-virtinstall-location-iso-fix.patch
  5319db07-customize-add-disk-fix.patch

- Allow the installation repos provided by zypper to be selected
  as network installation sources
  virtman-show-suse-install-repos.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=148
This commit is contained in:
Charles Arnold 2014-03-10 13:54:17 +00:00 committed by Git OBS Bridge
parent 9dab6bfcb9
commit 6786659bca
15 changed files with 700 additions and 28 deletions

View File

@ -0,0 +1,30 @@
Subject: details: Fix fallback if fetching CPU models fails (bz 1072704)
From: Cole Robinson crobinso@redhat.com Thu Mar 6 11:31:09 2014 -0500
Date: Thu Mar 6 11:31:09 2014 -0500:
Git: b078ba8c3d69b62fe748d9182babef8971914277
Index: virt-manager-1.0.0/virtManager/details.py
===================================================================
--- virt-manager-1.0.0.orig/virtManager/details.py
+++ virt-manager-1.0.0/virtManager/details.py
@@ -969,8 +969,9 @@ class vmmDetails(vmmGObjectUI):
no_default = not self.is_customize_dialog
try:
- cpu_values = caps.get_cpu_values(self.vm.get_arch())
+ cpu_names = caps.get_cpu_values(self.vm.get_arch()).cpus
except:
+ cpu_names = []
logging.exception("Error populating CPU model list")
# CPU model combo
@@ -991,7 +992,7 @@ class vmmDetails(vmmGObjectUI):
model.append([_("Clear CPU configuration"), "3",
virtinst.CPU.SPECIAL_MODE_CLEAR, False])
model.append([None, None, None, True])
- for name in [c.model for c in cpu_values.cpus]:
+ for name in [c.model for c in cpu_names]:
model.append([name, name, name, False])
# Disk cache combo

View File

@ -0,0 +1,22 @@
Subject: fsdetails: Fix adding a filesystem device (bz 1073067)
From: Cole Robinson crobinso@redhat.com Thu Mar 6 11:45:26 2014 -0500
Date: Thu Mar 6 11:45:26 2014 -0500:
Git: 9074fc6c6080cf650cf97457dda799700ee2b635
Index: virt-manager-1.0.0/virtManager/fsdetails.py
===================================================================
--- virt-manager-1.0.0.orig/virtManager/fsdetails.py
+++ virt-manager-1.0.0/virtManager/fsdetails.py
@@ -158,8 +158,9 @@ class vmmFSDetails(vmmGObjectUI):
rowindex=0, check_visible=True)
def get_config_fs_readonly(self):
- return uiutil.get_list_selection(self.widget("fs-readonly"),
- rowindex=0, check_visible=True)
+ if not self.widget("fs-readonly").is_visible():
+ return None
+ return self.widget("fs-readonly").get_active()
def get_config_fs_driver(self):
return uiutil.get_list_selection(self.widget("fs-driver-combo"),

View File

@ -0,0 +1,32 @@
Subject: Handle libvirt generating invalid volume XML (bz 1072770)
From: Cole Robinson crobinso@redhat.com Thu Mar 6 12:04:08 2014 -0500
Date: Thu Mar 6 12:04:08 2014 -0500:
Git: df7012a68b6a13a676e2019523f6863617a110d8
diff --git a/virtManager/connection.py b/virtManager/connection.py
index 96dfa1c..57e143d 100644
--- a/virtManager/connection.py
+++ b/virtManager/connection.py
@@ -179,7 +179,7 @@ class vmmConnection(vmmGObject):
for vol in pool.get_volumes(refresh=False).values():
try:
ret.append(vol.get_xmlobj(refresh_if_nec=False))
- except libvirt.libvirtError, e:
+ except Exception, e:
logging.debug("Fetching volume XML failed: %s", e)
return ret
self._backend.cb_fetch_all_vols = fetch_all_vols
diff --git a/virtinst/connection.py b/virtinst/connection.py
index a915f25..3cc5b79 100644
--- a/virtinst/connection.py
+++ b/virtinst/connection.py
@@ -222,7 +222,7 @@ class VirtualConnection(object):
try:
xml = vol.XMLDesc(0)
ret.append(StorageVolume(weakref.ref(self), parsexml=xml))
- except libvirt.libvirtError, e:
+ except Exception, e:
logging.debug("Fetching volume XML failed: %s", e)
if self.cache_object_fetch:

View File

@ -0,0 +1,287 @@
Subject: virt-install: Fix --location iso again, and test it (bz 1071513)
From: Cole Robinson crobinso@redhat.com Thu Mar 6 12:35:01 2014 -0500
Date: Thu Mar 6 12:46:46 2014 -0500:
Git: 797afb3b273d08a74119c878b689730f0b36a252
Index: virt-manager-1.0.0/tests/__init__.py
===================================================================
--- virt-manager-1.0.0.orig/tests/__init__.py
+++ virt-manager-1.0.0/tests/__init__.py
@@ -21,6 +21,8 @@ import logging
import os
os.environ["VIRTINST_TEST_SUITE"] = "1"
+os.environ["VIRTINST_TEST_URL_DIR"] = os.path.abspath(
+ "tests/cli-test-xml/fakefedoratree/")
import virtinst
virtinst.stable_defaults = False
Index: virt-manager-1.0.0/tests/cli-test-xml/compare/virt-install-location-iso.xml
===================================================================
--- /dev/null
+++ virt-manager-1.0.0/tests/cli-test-xml/compare/virt-install-location-iso.xml
@@ -0,0 +1,129 @@
+<domain type="kvm">
+ <name>foobar</name>
+ <uuid>00000000-1111-2222-3333-444444444444</uuid>
+ <memory>65536</memory>
+ <currentMemory>65536</currentMemory>
+ <vcpu>1</vcpu>
+ <os>
+ <type arch="x86_64">hvm</type>
+ <kernel>./virtinst-vmlinuz.</kernel>
+ <initrd>./virtinst-initrd.img.</initrd>
+ </os>
+ <features>
+ <acpi/>
+ <apic/>
+ <pae/>
+ </features>
+ <cpu mode="custom" match="exact">
+ <model>core2duo</model>
+ </cpu>
+ <clock offset="utc">
+ <timer name="rtc" tickpolicy="catchup"/>
+ <timer name="pit" tickpolicy="delay"/>
+ <timer name="hpet" present="no"/>
+ </clock>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>destroy</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-kvm</emulator>
+ <disk type="file" device="cdrom">
+ <driver name="qemu"/>
+ <source file="/home/crobinso/src/virt-manager/tests/cli-test-xml/fake.iso"/>
+ <target dev="hda" bus="ide"/>
+ <readonly/>
+ </disk>
+ <controller type="usb" index="0" model="ich9-ehci1"/>
+ <controller type="usb" index="0" model="ich9-uhci1">
+ <master startport="0"/>
+ </controller>
+ <controller type="usb" index="0" model="ich9-uhci2">
+ <master startport="2"/>
+ </controller>
+ <controller type="usb" index="0" model="ich9-uhci3">
+ <master startport="4"/>
+ </controller>
+ <interface type="bridge">
+ <source bridge="eth0"/>
+ <mac address="00:11:22:33:44:55"/>
+ <model type="virtio"/>
+ </interface>
+ <input type="tablet" bus="usb"/>
+ <graphics type="spice" port="-1" tlsPort="-1" autoport="yes"/>
+ <console type="pty"/>
+ <channel type="spicevmc">
+ <target type="virtio" name="com.redhat.spice.0"/>
+ </channel>
+ <sound model="ich6"/>
+ <video>
+ <model type="qxl"/>
+ </video>
+ <redirdev bus="usb" type="spicevmc"/>
+ <redirdev bus="usb" type="spicevmc"/>
+ <redirdev bus="usb" type="spicevmc"/>
+ <redirdev bus="usb" type="spicevmc"/>
+ </devices>
+</domain>
+<domain type="kvm">
+ <name>foobar</name>
+ <uuid>00000000-1111-2222-3333-444444444444</uuid>
+ <memory>65536</memory>
+ <currentMemory>65536</currentMemory>
+ <vcpu>1</vcpu>
+ <os>
+ <type arch="x86_64">hvm</type>
+ <boot dev="hd"/>
+ </os>
+ <features>
+ <acpi/>
+ <apic/>
+ <pae/>
+ </features>
+ <cpu mode="custom" match="exact">
+ <model>core2duo</model>
+ </cpu>
+ <clock offset="utc">
+ <timer name="rtc" tickpolicy="catchup"/>
+ <timer name="pit" tickpolicy="delay"/>
+ <timer name="hpet" present="no"/>
+ </clock>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>restart</on_reboot>
+ <on_crash>restart</on_crash>
+ <devices>
+ <emulator>/usr/bin/qemu-kvm</emulator>
+ <disk type="block" device="cdrom">
+ <target dev="hda" bus="ide"/>
+ <readonly/>
+ </disk>
+ <controller type="usb" index="0" model="ich9-ehci1"/>
+ <controller type="usb" index="0" model="ich9-uhci1">
+ <master startport="0"/>
+ </controller>
+ <controller type="usb" index="0" model="ich9-uhci2">
+ <master startport="2"/>
+ </controller>
+ <controller type="usb" index="0" model="ich9-uhci3">
+ <master startport="4"/>
+ </controller>
+ <interface type="bridge">
+ <source bridge="eth0"/>
+ <mac address="00:11:22:33:44:55"/>
+ <model type="virtio"/>
+ </interface>
+ <input type="tablet" bus="usb"/>
+ <graphics type="spice" port="-1" tlsPort="-1" autoport="yes"/>
+ <console type="pty"/>
+ <channel type="spicevmc">
+ <target type="virtio" name="com.redhat.spice.0"/>
+ </channel>
+ <sound model="ich6"/>
+ <video>
+ <model type="qxl"/>
+ </video>
+ <redirdev bus="usb" type="spicevmc"/>
+ <redirdev bus="usb" type="spicevmc"/>
+ <redirdev bus="usb" type="spicevmc"/>
+ <redirdev bus="usb" type="spicevmc"/>
+ </devices>
+</domain>
Index: virt-manager-1.0.0/tests/clitest.py
===================================================================
--- virt-manager-1.0.0.orig/tests/clitest.py
+++ virt-manager-1.0.0/tests/clitest.py
@@ -528,6 +528,7 @@ c.add_compare("--os-variant fedora20 --n
c.add_compare("--arch armv7l --machine vexpress-a9 --boot kernel=/f19-arm.kernel,initrd=/f19-arm.initrd,dtb=/f19-arm.dtb,extra_args=\"console=ttyAMA0 rw root=/dev/mmcblk0p3\" --disk %(EXISTIMG1)s --nographics", "arm-vexpress-plain", skip_check=support.SUPPORT_CONN_DISK_SD)
c.add_compare("--arch armv7l --machine vexpress-a15 --boot kernel=/f19-arm.kernel,initrd=/f19-arm.initrd,dtb=/f19-arm.dtb,kernel_args=\"console=ttyAMA0 rw root=/dev/vda3\",extra_args=foo --disk %(EXISTIMG1)s --nographics --os-variant fedora19", "arm-vexpress-f19", skip_check=support.SUPPORT_CONN_VIRTIO_MMIO)
c.add_compare("--arch ppc64 --machine pseries --boot network --disk %(EXISTIMG1)s --os-variant fedora20", "ppc64-pseries-f20")
+c.add_compare("--nodisks --location tests/cli-test-xml/fake.iso", "location-iso") # Using --location iso mounting
c.add_valid("--cdrom %(EXISTIMG2)s --file %(EXISTIMG1)s --os-variant win2k3 --wait 0 --sound") # HVM windows install with disk
c.add_valid("--os-variant fedora20 --file %(EXISTIMG1)s --location %(TREEDIR)s --extra-args console=ttyS0 --sound") # F14 Directory tree URL install with extra-args
c.add_invalid("--nodisks --boot network --machine foobar") # Unknown machine type
Index: virt-manager-1.0.0/virtinst/distroinstaller.py
===================================================================
--- virt-manager-1.0.0.orig/virtinst/distroinstaller.py
+++ virt-manager-1.0.0/virtinst/distroinstaller.py
@@ -299,11 +299,12 @@ def _upload_media(conn, scratchdir, syst
# Enum of the various install media types we can have
-(MEDIA_LOCATION_PATH,
+(MEDIA_LOCATION_DIR,
+ MEDIA_LOCATION_CDROM,
MEDIA_LOCATION_URL,
MEDIA_CDROM_PATH,
MEDIA_CDROM_URL,
- MEDIA_CDROM_IMPLIED) = range(1, 6)
+ MEDIA_CDROM_IMPLIED) = range(1, 7)
class DistroInstaller(Installer):
@@ -324,7 +325,11 @@ class DistroInstaller(Installer):
if self.location and _is_url(self.conn, self.location):
return self.cdrom and MEDIA_CDROM_URL or MEDIA_LOCATION_URL
- return self.cdrom and MEDIA_CDROM_PATH or MEDIA_LOCATION_PATH
+ if self.cdrom:
+ return MEDIA_CDROM_PATH
+ if self.location and os.path.isdir(self.location):
+ return MEDIA_LOCATION_DIR
+ return MEDIA_LOCATION_CDROM
def _prepare_local(self):
transient = True
@@ -374,7 +379,7 @@ class DistroInstaller(Installer):
def _get_bootdev(self, isinstall, guest):
mediatype = self._get_media_type()
local = mediatype in [MEDIA_CDROM_PATH, MEDIA_CDROM_IMPLIED,
- MEDIA_LOCATION_PATH]
+ MEDIA_LOCATION_DIR, MEDIA_LOCATION_CDROM]
persistent_cd = (local and
self.cdrom and
self.livecd)
@@ -420,9 +425,10 @@ class DistroInstaller(Installer):
return
dev = None
- if mediatype == MEDIA_CDROM_PATH:
+ if mediatype == MEDIA_CDROM_PATH or mediatype == MEDIA_LOCATION_CDROM:
dev = self._prepare_local()
- else:
+
+ if mediatype != MEDIA_CDROM_PATH:
fetcher = urlfetcher.fetcherForURI(self.location,
scratchdir, meter)
try:
@@ -454,7 +460,7 @@ class DistroInstaller(Installer):
mediatype = self._get_media_type()
return mediatype in [MEDIA_CDROM_URL, MEDIA_LOCATION_URL,
- MEDIA_LOCATION_PATH]
+ MEDIA_LOCATION_DIR, MEDIA_LOCATION_CDROM]
def check_location(self, guest):
mediatype = self._get_media_type()
Index: virt-manager-1.0.0/virtinst/urlfetcher.py
===================================================================
--- virt-manager-1.0.0.orig/virtinst/urlfetcher.py
+++ virt-manager-1.0.0/virtinst/urlfetcher.py
@@ -189,10 +189,16 @@ class _MountedImageFetcher(_LocalImageFe
Fetcher capable of extracting files from a NFS server
or loopback mounted file, or local CDROM device
"""
+ _in_test_suite = bool("VIRTINST_TEST_SUITE" in os.environ)
+
def prepareLocation(self):
cmd = None
- self.srcdir = tempfile.mkdtemp(prefix="virtinstmnt.",
- dir=self.scratchdir)
+
+ if self._in_test_suite:
+ self.srcdir = os.environ["VIRTINST_TEST_URL_DIR"]
+ else:
+ self.srcdir = tempfile.mkdtemp(prefix="virtinstmnt.",
+ dir=self.scratchdir)
mountcmd = "/bin/mount"
logging.debug("Preparing mount at " + self.srcdir)
@@ -207,21 +213,24 @@ class _MountedImageFetcher(_LocalImageFe
logging.debug("mount cmd: %s", cmd)
- ret = subprocess.call(cmd)
- if ret != 0:
- self.cleanupLocation()
- raise ValueError(_("Mounting location '%s' failed") %
- (self.location))
+ if not self._in_test_suite:
+ ret = subprocess.call(cmd)
+ if ret != 0:
+ self.cleanupLocation()
+ raise ValueError(_("Mounting location '%s' failed") %
+ (self.location))
return True
def cleanupLocation(self):
logging.debug("Cleaning up mount at " + self.srcdir)
- cmd = ["/bin/umount", self.srcdir]
- subprocess.call(cmd)
- try:
- os.rmdir(self.srcdir)
- except:
- pass
+
+ if not self._in_test_suite:
+ cmd = ["/bin/umount", self.srcdir]
+ subprocess.call(cmd)
+ try:
+ os.rmdir(self.srcdir)
+ except:
+ pass
class _DirectImageFetcher(_LocalImageFetcher):

View File

@ -0,0 +1,28 @@
Subject: addhardware: Fix adding disk through 'customize' dialog (bz 1073808)
From: Cole Robinson crobinso@redhat.com Fri Mar 7 09:37:08 2014 -0500
Date: Fri Mar 7 09:43:19 2014 -0500:
Git: 7ef9d7fbfc4173b6a6e88b6fb74e895293ffda55
diff --git a/virtManager/addhardware.py b/virtManager/addhardware.py
index 75238d2..18f2aef 100644
--- a/virtManager/addhardware.py
+++ b/virtManager/addhardware.py
@@ -1477,6 +1477,7 @@ class vmmAddHardware(vmmGObjectUI):
disk.driver_cache = cache
# Generate target
+ disks = []
if not self.is_customize_dialog:
disks = (self.vm.get_disk_devices() +
self.vm.get_disk_devices(inactive=True))
@@ -1484,7 +1485,8 @@ class vmmAddHardware(vmmGObjectUI):
if d.target not in used:
used.append(d.target)
- prefer_ctrl = self._set_disk_controller(disk, controller_model, disks)
+ prefer_ctrl = self._set_disk_controller(
+ disk, controller_model, disks)
if not self.is_customize_dialog:
disk.generate_target(used, prefer_ctrl)

View File

@ -0,0 +1,42 @@
Subject: storagebrowse: Duplicate tooltip logic for 'new volume' button
From: Cole Robinson crobinso@redhat.com Mon Mar 10 08:56:51 2014 -0400
Date: Mon Mar 10 08:57:11 2014 -0400:
Git: cfc52051b71bcfbf3f58ea6eddf457298f186727
diff --git a/virtManager/storagebrowse.py b/virtManager/storagebrowse.py
index 314a6ab..3f61352 100644
--- a/virtManager/storagebrowse.py
+++ b/virtManager/storagebrowse.py
@@ -208,7 +208,8 @@ class vmmStorageBrowser(vmmGObjectUI):
self.local_args["dialog_type"] = data.get("dialog_type")
self.local_args["choose_button"] = data.get("choose_button")
- self.widget("new-volume").set_visible(self.can_new_volume)
+ self.widget("new-volume").set_visible(
+ self.can_new_volume and self.allow_create())
# Convenience helpers
@@ -302,13 +303,17 @@ class vmmStorageBrowser(vmmGObjectUI):
def pool_selected(self, src_ignore=None):
pool = self.current_pool()
- newvol = bool(pool)
+ can_new_vol = False
+ tt = ""
if pool:
pool.tick()
- newvol = pool.is_active()
+ can_new_vol = (pool.is_active() and
+ pool.supports_volume_creation())
+ if not can_new_vol:
+ tt = _("Pool does not support volume creation")
- newvol = newvol and self.allow_create()
- self.widget("new-volume").set_sensitive(newvol)
+ self.widget("new-volume").set_sensitive(can_new_vol)
+ self.widget("new-volume").set_tooltip_text(tt)
self.populate_storage_volumes()

View File

@ -0,0 +1,48 @@
Subject: connection: Handle errors when deregistering events on close (bz 1069351)
From: Cole Robinson crobinso@redhat.com Mon Mar 10 09:33:04 2014 -0400
Date: Mon Mar 10 09:35:35 2014 -0400:
Git: 081e34715ffa5a210e1e0c8670fe3a1a3ec5180b
Otherwise this interrupts the close/cleanup routine, and the connection
never appears to disconnect in the UI. This causes error dialog spamming
when libvirtd goes down.
diff --git a/virtManager/connection.py b/virtManager/connection.py
index 57e143d..4c034b8 100644
--- a/virtManager/connection.py
+++ b/virtManager/connection.py
@@ -929,16 +929,25 @@ class vmmConnection(vmmGObject):
def close(self):
def cleanup(devs):
for dev in devs.values():
- dev.cleanup()
-
- if not self._backend.is_closed():
- if self._domain_cb_id is not None:
- self._backend.domainEventDeregisterAny(self._domain_cb_id)
- self._domain_cb_id = None
+ try:
+ dev.cleanup()
+ except:
+ logging.debug("Failed to cleanup %s", exc_info=True)
- if self._network_cb_id is not None:
- self._backend.networkEventDeregisterAny(self._network_cb_id)
- self._network_cb_id = None
+ try:
+ if not self._backend.is_closed():
+ if self._domain_cb_id is not None:
+ self._backend.domainEventDeregisterAny(
+ self._domain_cb_id)
+ self._domain_cb_id = None
+
+ if self._network_cb_id is not None:
+ self._backend.networkEventDeregisterAny(
+ self._network_cb_id)
+ self._network_cb_id = None
+ except:
+ logging.debug("Failed to deregister events in conn cleanup",
+ exc_info=True)
self._backend.close()
self.record = []

View File

@ -1,3 +1,27 @@
-------------------------------------------------------------------
Fri Mar 10 07:46:16 MDT 2014 - carnold@suse.com
- Upstream bug fixes
531db6a7-new-volume-tooltip-logic.patch
531dbfa7-handle-errors-when-deregistering-events-on-close.patch
-------------------------------------------------------------------
Fri Mar 7 10:26:16 MST 2014 - carnold@suse.com
- Upstream bug fixes
5318a2cd-cpu-model-fallback-failure-fix.patch
5318a626-adding-filesystem-device-fix.patch
5318aa88-invalid-libvirt-volume-XML.patch
5318b486-virtinstall-location-iso-fix.patch
5319db07-customize-add-disk-fix.patch
-------------------------------------------------------------------
Thu Mar 6 15:16:39 MST 2014 - carnold@suse.com
- Allow the installation repos provided by zypper to be selected
as network installation sources
virtman-show-suse-install-repos.patch
-------------------------------------------------------------------
Mon Mar 3 09:26:39 MST 2014 - carnold@suse.com

View File

@ -53,6 +53,13 @@ Patch15: 5310e3ac-set-show_arrow-to-true.patch
Patch16: 5310e3ac-vmmConsolePages-toggle-visibilities-on-page-change.patch
Patch17: 5310e3ac-vmmDetails-toggle-visibilities-on-page-change.patch
Patch18: 5310e52d-fix-setting-default-window-size.patch
Patch19: 5318a2cd-cpu-model-fallback-failure-fix.patch
Patch20: 5318a626-adding-filesystem-device-fix.patch
Patch21: 5318aa88-invalid-libvirt-volume-XML.patch
Patch22: 5318b486-virtinstall-location-iso-fix.patch
Patch23: 5319db07-customize-add-disk-fix.patch
Patch24: 531db6a7-new-volume-tooltip-logic.patch
Patch25: 531dbfa7-handle-errors-when-deregistering-events-on-close.patch
Patch50: virtman-desktop.patch
Patch51: virtman-cdrom.patch
Patch52: virtman-kvm.patch
@ -69,6 +76,7 @@ Patch68: virtman-default-to-xen-pv.patch
Patch69: virtman-allow-pv-iso-install.patch
Patch70: virtman-autoyast-support.patch
Patch71: virtman-vminstall.patch
Patch72: virtman-show-suse-install-repos.patch
Patch150: virtinst-cdrom.patch
Patch151: virtinst-storage-ocfs2.patch
Patch152: virtinst-qed.patch
@ -80,11 +88,11 @@ BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define verrel %{version}-%{release}
Requires: virt-manager-common = %{verrel}
Requires: dbus-1-x11
Requires: dconf
Requires: gtk3
Requires: python-gconf
Requires: dconf
Requires: dbus-1-x11
Requires: virt-manager-common = %{verrel}
Requires: vm-install >= 0.5.6
# Libvirt-glib
@ -99,12 +107,12 @@ Requires: typelib-1_0-Vte-2_90
Requires: gtk-vnc2
Requires: libspice-client-glib-2_0-8
Requires: libspice-client-gtk-3_0-4
Requires: python-gobject-cairo
Requires: typelib-1_0-GVnc-1_0
Requires: typelib-1_0-Gtk-3_0
Requires: typelib-1_0-GtkVnc-2_0
Requires: typelib-1_0-SpiceClientGlib-2_0
Requires: typelib-1_0-SpiceClientGtk-3_0
Requires: typelib-1_0-Gtk-3_0
Requires: typelib-1_0-GVnc-1_0
Requires: typelib-1_0-GtkVnc-2_0
Requires: python-gobject-cairo
Recommends: python-SpiceClientGtk
Requires: virt-install
@ -133,9 +141,9 @@ Group: System/Monitoring
# This version not strictly required: virt-manager should work with older,
# however varying amounts of functionality will not be enabled.
Requires: libvirt-python >= 0.7.0
Requires: python-urlgrabber
Requires: python-ipaddr
Requires: python-libxml2
Requires: python-urlgrabber
%description common
Common files used by the different virt-manager interfaces, as well as
@ -148,10 +156,10 @@ Group: System/Monitoring
Requires: virt-manager-common = %{verrel}
Provides: virt-clone
Provides: virt-image
Provides: virt-convert
Provides: python-virtinst
Provides: virt-clone
Provides: virt-convert
Provides: virt-image
Obsoletes: python-virtinst <= 0.600.4
Supplements: virt-manager
@ -181,6 +189,13 @@ machine).
%patch16 -p1
%patch17 -p1
%patch18 -p1
%patch19 -p1
%patch20 -p1
%patch21 -p1
%patch22 -p1
%patch23 -p1
%patch24 -p1
%patch25 -p1
%patch50 -p1
%patch51 -p1
%patch52 -p1
@ -198,6 +213,7 @@ machine).
#%patch69 -p1 pv iso install
%patch70 -p1
%patch71 -p1
%patch72 -p1
#%patch150 -p1 use 'c' for cdrom
%patch151 -p1
%patch152 -p1

View File

@ -2,7 +2,7 @@ Index: virt-manager-1.0.0/virtinst/urlfetcher.py
===================================================================
--- virt-manager-1.0.0.orig/virtinst/urlfetcher.py
+++ virt-manager-1.0.0/virtinst/urlfetcher.py
@@ -287,6 +287,60 @@ def _distroFromTreeinfo(fetcher, arch, v
@@ -296,6 +296,60 @@ def _distroFromTreeinfo(fetcher, arch, v
return ob
@ -63,7 +63,7 @@ Index: virt-manager-1.0.0/virtinst/urlfetcher.py
def getDistroStore(guest, fetcher):
stores = []
@@ -303,6 +357,10 @@ def getDistroStore(guest, fetcher):
@@ -312,6 +366,10 @@ def getDistroStore(guest, fetcher):
if dist:
return dist
@ -74,7 +74,7 @@ Index: virt-manager-1.0.0/virtinst/urlfetcher.py
# FIXME: This 'distro ==' doesn't cut it. 'distro' is from our os
# dictionary, so would look like 'fedora9' or 'rhel5', so this needs
# to be a bit more intelligent
@@ -799,12 +857,11 @@ class SLDistro(RHELDistro):
@@ -808,12 +866,11 @@ class SLDistro(RHELDistro):
class SuseDistro(Distro):
name = "SUSE"
@ -88,7 +88,7 @@ Index: virt-manager-1.0.0/virtinst/urlfetcher.py
Distro.__init__(self, *args, **kwargs)
if re.match(r'i[4-9]86', self.arch):
self.arch = 'i386'
@@ -815,18 +872,32 @@ class SuseDistro(Distro):
@@ -824,18 +881,32 @@ class SuseDistro(Distro):
oldkern += "64"
oldinit += "64"
@ -131,7 +131,7 @@ Index: virt-manager-1.0.0/virtinst/urlfetcher.py
if not self.fetcher.hasFile("directory.yast"):
return False
@@ -851,6 +922,27 @@ class SuseDistro(Distro):
@@ -860,6 +931,27 @@ class SuseDistro(Distro):
return name
return self.os_variant

View File

@ -2,7 +2,7 @@ Index: virt-manager-1.0.0/virtManager/details.py
===================================================================
--- virt-manager-1.0.0.orig/virtManager/details.py
+++ virt-manager-1.0.0/virtManager/details.py
@@ -2017,12 +2017,10 @@ class vmmDetails(vmmGObjectUI):
@@ -2018,12 +2018,10 @@ class vmmDetails(vmmGObjectUI):
return self._change_config_helper(df, da, hf, ha)
@ -19,7 +19,7 @@ Index: virt-manager-1.0.0/virtManager/details.py
auto = self.widget("config-autostart")
try:
self.vm.set_autostart(auto.get_active())
@@ -2031,6 +2029,11 @@ class vmmDetails(vmmGObjectUI):
@@ -2032,6 +2030,11 @@ class vmmDetails(vmmGObjectUI):
(_("Error changing autostart value: %s") % str(e)))
return False
@ -31,7 +31,7 @@ Index: virt-manager-1.0.0/virtManager/details.py
if self.edited(EDIT_BOOTORDER):
bootdevs = self.get_config_boot_order()
add_define(self.vm.set_boot_order, bootdevs)
@@ -2385,6 +2388,8 @@ class vmmDetails(vmmGObjectUI):
@@ -2386,6 +2389,8 @@ class vmmDetails(vmmGObjectUI):
buttons=Gtk.ButtonsType.OK,
dialog_type=dtype)

View File

@ -2,7 +2,7 @@ Index: virt-manager-1.0.0/virtManager/create.py
===================================================================
--- virt-manager-1.0.0.orig/virtManager/create.py
+++ virt-manager-1.0.0/virtManager/create.py
@@ -1228,11 +1228,34 @@ class vmmCreate(vmmGObjectUI):
@@ -1232,11 +1232,34 @@ class vmmCreate(vmmGObjectUI):
variant = self.widget("install-os-version")
variant.set_active(0)
@ -37,7 +37,7 @@ Index: virt-manager-1.0.0/virtManager/create.py
# Get previous
type_row = self._selected_os_row()
if not type_row:
@@ -1587,7 +1610,10 @@ class vmmCreate(vmmGObjectUI):
@@ -1591,7 +1614,10 @@ class vmmCreate(vmmGObjectUI):
if extra:
extraargs += extra
if ks:
@ -49,7 +49,7 @@ Index: virt-manager-1.0.0/virtManager/create.py
if extraargs:
self.guest.installer.extraargs = extraargs
@@ -1980,6 +2006,7 @@ class vmmCreate(vmmGObjectUI):
@@ -1984,6 +2010,7 @@ class vmmCreate(vmmGObjectUI):
dl = self.set_os_val(self.widget("install-os-type"), distro_type)
vl = self.set_os_val(self.widget("install-os-version"), distro_var)
self.set_distro_labels(dl, vl)

View File

@ -1,7 +1,7 @@
Index: virt-manager-0.10.1/virtManager/create.py
Index: virt-manager-1.0.0/virtManager/create.py
===================================================================
--- virt-manager-0.10.1.orig/virtManager/create.py
+++ virt-manager-0.10.1/virtManager/create.py
--- virt-manager-1.0.0.orig/virtManager/create.py
+++ virt-manager-1.0.0/virtManager/create.py
@@ -21,6 +21,8 @@
import logging
import threading
@ -11,7 +11,7 @@ Index: virt-manager-0.10.1/virtManager/create.py
# pylint: disable=E0611
from gi.repository import GObject
@@ -1130,6 +1132,51 @@ class vmmCreate(vmmGObjectUI):
@@ -1130,6 +1132,55 @@ class vmmCreate(vmmGObjectUI):
return
self.start_detection(forward=forward)
@ -26,6 +26,10 @@ Index: virt-manager-0.10.1/virtManager/create.py
+ return 'linux', 'opensuse13'
+ if "openSUSE 12" in line:
+ return 'linux', 'opensuse12'
+ if "SUSE Linux Enterprise Server 12" in line:
+ return 'linux', 'sles12'
+ if "SUSE Linux Enterprise Desktop 12" in line:
+ return 'linux', 'sled12'
+ if "SUSE Linux Enterprise Server 11" in line:
+ return 'linux', 'sles11'
+ if "SUSE Linux Enterprise Desktop 11" in line:
@ -63,7 +67,7 @@ Index: virt-manager-0.10.1/virtManager/create.py
def toggle_detect_os(self, src):
dodetect = src.get_active()
@@ -1141,6 +1188,8 @@ class vmmCreate(vmmGObjectUI):
@@ -1141,6 +1192,8 @@ class vmmCreate(vmmGObjectUI):
if dodetect:
self.mediaDetected = False
self.detect_media_os()

View File

@ -25,7 +25,7 @@ Index: virt-manager-1.0.0/virtManager/details.py
===================================================================
--- virt-manager-1.0.0.orig/virtManager/details.py
+++ virt-manager-1.0.0/virtManager/details.py
@@ -2278,6 +2278,17 @@ class vmmDetails(vmmGObjectUI):
@@ -2279,6 +2279,17 @@ class vmmDetails(vmmGObjectUI):
text1=(_("Are you sure you want to remove this device?"))):
return

View File

@ -0,0 +1,139 @@
Index: virt-manager-1.0.0/virtManager/create.py
===================================================================
--- virt-manager-1.0.0.orig/virtManager/create.py
+++ virt-manager-1.0.0/virtManager/create.py
@@ -18,6 +18,7 @@
# MA 02110-1301 USA.
#
+import traceback
import logging
import threading
import time
@@ -366,7 +367,13 @@ class vmmCreate(vmmGObjectUI):
self.widget("install-url-options").set_expanded(False)
urlmodel = self.widget("install-url-box").get_model()
ksmodel = self.widget("install-ks-box").get_model()
- self.populate_media_model(urlmodel, self.config.get_media_urls())
+ urllist = self.config.get_media_urls()
+ (index, inst_repos) = util.getInstallRepos()
+ for u in urllist:
+ if u in inst_repos:
+ inst_repos.remove(u)
+ media_urllist = urllist + inst_repos
+ self.populate_media_model(urlmodel, media_urllist)
self.populate_media_model(ksmodel, self.config.get_kickstart_urls())
self.set_distro_labels("-", "-", force=True)
Index: virt-manager-1.0.0/virtinst/util.py
===================================================================
--- virt-manager-1.0.0.orig/virtinst/util.py
+++ virt-manager-1.0.0/virtinst/util.py
@@ -23,12 +23,14 @@ import os
import random
import re
import stat
+import commands
import libvirt
import libxml2
_host_blktap_capable = None
+_host_repo_url = None
def listify(l):
@@ -531,3 +533,92 @@ def convert_units(value, old_unit, new_u
power = get_power(new_unit)
return in_bytes / pow(factor, power)
+
+def getHostInstallSource():
+ global _host_repo_url
+ if _host_repo_url is not None:
+ return _host_repo_url
+
+ if os.path.exists('/var/lib/YaST2/install.inf'):
+ server_ip = server_name = server_dir = inst_mode = None
+ f = open('/var/lib/YaST2/install.inf')
+ lines = f.readlines()
+ f.close()
+ # Newer install.inf files use RepoURL. Older versions require parsing more fields
+ for line in lines:
+ if line.startswith('RepoURL:'):
+ repo_url = line[:-1].split('?', 1)[0]
+ repo_url = repo_url.split(' ')
+ if repo_url[1]:
+ if repo_url[1].startswith('ftp:') or repo_url[1].startswith('http:') or repo_url[1].startswith('smb:') or repo_url[1].startswith('nfs:'):
+ _host_repo_url = repo_url[1]
+ return repo_url[1]
+ return None
+ elif line.startswith('InstMode:'):
+ inst_mode = line[:-1].split('?', 1)[0]
+ inst_mode = inst_mode.split(' ')
+ inst_mode = inst_mode[1]
+ if inst_mode != 'ftp' and inst_mode != 'http' and inst_mode != 'smb' and inst_mode != 'nfs':
+ return None
+ elif line.startswith('ServerIP:'):
+ server_ip = line[:-1].split('?', 1)[0]
+ server_ip = server_ip.split(' ')
+ server_ip = server_ip[1]
+ elif line.startswith('ServerName:'):
+ server_name = line[:-1].split('?', 1)[0]
+ server_name = server_name.split(' ')
+ server_name = server_name[1]
+ elif line.startswith('Serverdir:'):
+ server_dir = line[:-1].split('?', 1)[0]
+ server_dir = server_dir.split(' ')
+ server_dir = server_dir[1]
+ if inst_mode:
+ repo_url = inst_mode + "://"
+ if server_name:
+ repo_url = repo_url + server_name + "/"
+ if server_dir:
+ repo_url = repo_url + server_dir
+ elif server_ip:
+ repo_url = repo_url + server_ip + "/"
+ if server_dir:
+ repo_url = repo_url + server_dir
+ _host_repo_url = repo_url
+ return repo_url
+ return None
+
+def getInstallRepos(enabled_sources_only = True):
+ dom0_inst_source = getHostInstallSource()
+ locations = commands.getoutput("/usr/bin/zypper lr -u | awk -F'|' '{ print $6 }'")
+ locations = locations[(locations.rfind('URI')):].split()
+ index = 0
+ index_dom0 = -1
+ number_of_sources = 0
+ zypper_output = []
+ # If we only want to list enabled sources
+ if enabled_sources_only == True:
+ enabled = commands.getoutput("/usr/bin/zypper lr -u | awk -F'|' '{ print $4 }'")
+ enabled = enabled[(enabled.rfind('Enabled')):].split()
+ for e in enabled:
+ if e == "Yes":
+ str = locations[index]
+ if str.startswith('ftp://') or str.startswith('http://') or str.startswith('nfs://') or str.startswith('smb://'):
+ zypper_output.append(str)
+ if dom0_inst_source is not None and str == dom0_inst_source:
+ index_dom0 = number_of_sources
+ number_of_sources += 1
+ index += 1
+ else:
+ locations.sort()
+ for l in locations:
+ str = locations[index]
+ if str.startswith('ftp://') or str.startswith('http://') or str.startswith('nfs://') or str.startswith('smb://'):
+ zypper_output.append(str)
+ if dom0_inst_source is not None and str == dom0_inst_source:
+ index_dom0 = number_of_sources
+ number_of_sources += 1
+ index += 1
+ if index_dom0 == -1 and dom0_inst_source:
+ index_dom0 = 0
+ zypper_output.insert(0, dom0_inst_source)
+ return (index_dom0, zypper_output)
+