From dc18be98a8ca8127e3a6ee3ba1e2da62cb224a2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Fabian=20Silva=20Delgado?= Date: Sat, 26 Nov 2016 14:22:15 -0300 Subject: virt-install-1.4.0-2.parabola4: minor fix - Bug #1140 -> https://labs.parabola.nu/issues/1140#note-7 --- libre/virt-manager/PKGBUILD | 4 +- libre/virt-manager/libre.patch | 369 +++++++++++++++++++++++++++++++++++++++-- 2 files changed, 357 insertions(+), 16 deletions(-) (limited to 'libre') diff --git a/libre/virt-manager/PKGBUILD b/libre/virt-manager/PKGBUILD index 32ed45cab..5235ab8b9 100644 --- a/libre/virt-manager/PKGBUILD +++ b/libre/virt-manager/PKGBUILD @@ -7,7 +7,7 @@ pkgbase=virt-manager pkgname=virt-install pkgver=1.4.0 -pkgrel=2.parabola3 +pkgrel=2.parabola4 pkgdesc="Console user interface for managing virtual machines, without non-FSDG compliant distros and operating systems support" arch=('any') url="http://virt-manager.org/" @@ -23,7 +23,7 @@ makedepends=('intltool>=0.35.0' source=("https://virt-manager.org/download/sources/virt-manager/virt-manager-$pkgver.tar.gz" 'libre.patch') sha256sums=('bf31a40cc48500cbf87a0e93a5838fc3f6ce4e2fa03f8bce6aa2615625e6caca' - 'ef5bb53e02254e31f084aef1a66f249aa3fdf48161e643682c25342ddd235433') + '6bdaadd14db5e61d1ec1598b2af45c1ea156af3f5ed2faadd2d4ad1924008e7f') prepare() { cd "$srcdir/$pkgbase-$pkgver" diff --git a/libre/virt-manager/libre.patch b/libre/virt-manager/libre.patch index bc2b49b84..52e731e28 100644 --- a/libre/virt-manager/libre.patch +++ b/libre/virt-manager/libre.patch @@ -152,6 +152,194 @@ index a1229c8..4c7b0e3 100644 Create a guest from an existing disk image 'mydisk.img' using defaults for the rest of the options. +diff --git a/man/virt-xml.pod b/man/virt-xml.pod +index 3a684f4..aef814f 100644 +--- a/man/virt-xml.pod ++++ b/man/virt-xml.pod +@@ -286,53 +286,10 @@ Clear the previous definition of domain 'winxp', change it to 'host-model' + + # virt-xml winxp --edit --cpu host-model,clearxml=yes --confirm + +-Change the second sound card to model=ich6 on 'fedora19', but only output the diff: +- +- # virt-xml fedora19 --edit 2 --sound model=ich6 --print-diff +- +-Update the every graphics device password to 'foo' of the running VM 'rhel6': +- +- # virt-xml rhel6 --edit all --graphics password=foo --update +- +-Remove the disk path from disk device hdc: +- +- # virt-xml rhel6 --edit target=hdc --disk path= +- + Change all disk devices of type 'disk' to use cache=none, using XML from stdin, printing the new XML to stdout. + + # cat | virt-xml --edit device=disk --disk cache=none + +-Change disk 'hda' IO to native and use startup policy as 'optional'. +- +- # virt-xml fedora20 --edit target=hda \ +- --disk io=native,startup_policy=optional +- +-Change all host devices to use driver_name=vfio for VM 'fedora20' on the remote connection +- +- # virt-xml --connect qemu+ssh://remotehost/system \ +- fedora20 --edit all --hostdev driver_name=vfio +- +-Hotplug host USB device 001.003 to running domain 'fedora19': +- +- # virt-xml fedora19 --update --add-device --hostdev 001.003 +- +-Add a spicevmc channel to the domain 'winxp', that will be available after the next VM shutdown. +- +- # virt-xml winxp --add-device --channel spicevmc +- +-Create a 10G qcow2 disk image and attach it to 'fedora18' for the next VM startup: +- +- # virt-xml fedora18 --add-device \ +- --disk /var/lib/libvirt/images/newimage.qcow2,format=qcow2,size=10 +- +-Hotunplug the disk vdb from the running domain 'rhel7': +- +- # virt-xml rhel7 --update --remove-device --disk target=vdb +- +-Remove all graphics devices from the VM 'rhel7' after the next shutdown: +- +- # virt-xml rhel7 --remove-device --graphics all +- + Generate XML for a virtio console device and print it to stdout: + + # virt-xml --build-xml --console pty,target_type=virtio +diff --git a/setup.py b/setup.py +index 89916b5..cff1031 100755 +--- a/setup.py ++++ b/setup.py +@@ -338,7 +338,6 @@ class configure(distutils.core.Command): + self.libvirt_package_names = None + self.kvm_package_names = None + self.askpass_package_names = None +- self.preferred_distros = None + self.stable_defaults = None + self.default_graphics = None + self.default_hvs = None +@@ -356,8 +355,6 @@ class configure(distutils.core.Command): + template += "hv_packages = %s\n" % self.kvm_package_names + if self.askpass_package_names is not None: + template += "askpass_packages = %s\n" % self.askpass_package_names +- if self.preferred_distros is not None: +- template += "preferred_distros = %s\n" % self.preferred_distros + if self.stable_defaults is not None: + template += ("stable_defaults = %s\n" % + self.stable_defaults) +diff --git a/virt-manager.spec b/virt-manager.spec +index 2dfe413..2bb07e4 100644 +--- a/virt-manager.spec ++++ b/virt-manager.spec +@@ -7,14 +7,8 @@ + %global qemu_user "qemu" + %global libvirt_packages "libvirt-daemon-kvm,libvirt-daemon-config-network" + %global kvm_packages "" +-%global preferred_distros "fedora,rhel" + %global default_hvs "qemu,xen,lxc" + +-%if 0%{?rhel} +-%global preferred_distros "rhel,fedora" +-%global stable_defaults 1 +-%endif +- + + # End local config + +@@ -49,9 +43,6 @@ Requires: vte291 + Requires: gtk-vnc2 + Requires: spice-gtk3 + +-%if 0%{?rhel} == 7 +-Requires: gnome-icon-theme +-%endif + + + BuildRequires: python +@@ -116,10 +107,6 @@ machine). + %global _kvm_packages --kvm-package-names=%{kvm_packages} + %endif + +-%if %{preferred_distros} +-%global _preferred_distros --preferred-distros=%{preferred_distros} +-%endif +- + %if %{libvirt_packages} + %global _libvirt_packages --libvirt-package-names=%{libvirt_packages} + %endif +@@ -141,7 +128,6 @@ python setup.py configure \ + %{?_kvm_packages} \ + %{?_libvirt_packages} \ + %{?_askpass_package} \ +- %{?_preferred_distros} \ + %{?_stable_defaults} \ + %{?_default_hvs} + +diff --git a/virt-manager.spec.in b/virt-manager.spec.in +index 8c4a811..6497f52 100644 +--- a/virt-manager.spec.in ++++ b/virt-manager.spec.in +@@ -7,14 +7,8 @@ + %global qemu_user "qemu" + %global libvirt_packages "libvirt-daemon-kvm,libvirt-daemon-config-network" + %global kvm_packages "" +-%global preferred_distros "fedora,rhel" + %global default_hvs "qemu,xen,lxc" + +-%if 0%{?rhel} +-%global preferred_distros "rhel,fedora" +-%global stable_defaults 1 +-%endif +- + + # End local config + +@@ -49,10 +43,6 @@ Requires: vte291 + Requires: gtk-vnc2 + Requires: spice-gtk3 + +-%if 0%{?rhel} == 7 +-Requires: gnome-icon-theme +-%endif +- + + BuildRequires: python + BuildRequires: intltool +@@ -116,10 +106,6 @@ machine). + %global _kvm_packages --kvm-package-names=%{kvm_packages} + %endif + +-%if %{preferred_distros} +-%global _preferred_distros --preferred-distros=%{preferred_distros} +-%endif +- + %if %{libvirt_packages} + %global _libvirt_packages --libvirt-package-names=%{libvirt_packages} + %endif +@@ -141,7 +127,6 @@ python setup.py configure \ + %{?_kvm_packages} \ + %{?_libvirt_packages} \ + %{?_askpass_package} \ +- %{?_preferred_distros} \ + %{?_stable_defaults} \ + %{?_default_hvs} + +diff --git a/virtManager/config.py b/virtManager/config.py +index 5b04013..b52f121 100644 +--- a/virtManager/config.py ++++ b/virtManager/config.py +@@ -170,7 +170,6 @@ class vmmConfig(object): + self.keyring = None + + self.default_qemu_user = CLIConfig.default_qemu_user +- self.preferred_distros = CLIConfig.preferred_distros + self.hv_packages = CLIConfig.hv_packages + self.libvirt_packages = CLIConfig.libvirt_packages + self.askpass_package = CLIConfig.askpass_package diff --git a/virtManager/connection.py b/virtManager/connection.py index 6cb9cc0..21de8cf 100644 --- a/virtManager/connection.py @@ -168,7 +356,7 @@ index 6cb9cc0..21de8cf 100644 ("root hub" in str(xmlobj.product_name) or ("host controller" in str(xmlobj.product_name).lower() and diff --git a/virtManager/create.py b/virtManager/create.py -index 737c1fa..2b99de8 100644 +index 737c1fa..4c34585 100644 --- a/virtManager/create.py +++ b/virtManager/create.py @@ -931,9 +931,7 @@ class vmmCreate(vmmGObjectUI): @@ -182,7 +370,27 @@ index 737c1fa..2b99de8 100644 # Move 'generic' to the front of the list types = virtinst.OSDB.list_types() -@@ -1075,17 +1073,7 @@ class vmmCreate(vmmGObjectUI): +@@ -959,17 +957,12 @@ class vmmCreate(vmmGObjectUI): + model = widget.get_model() + model.clear() + +- preferred = self.config.preferred_distros +- variants = virtinst.OSDB.list_os(typename=_type, sortpref=preferred) +- supportl = virtinst.OSDB.list_os(typename=_type, sortpref=preferred, +- only_supported=True) +- + for v in variants: + supported = v in supportl or v.name == "generic" + self._add_os_row(model, v.name, v.label, supported) + +- self._add_os_row(model, sep=True) +- self._add_os_row(model, label=_("Show all OS options"), action=True) ++ self._add_os_row(model, sep=False) ++ self._add_os_row(model, label=_("Show all OS options"), action=False) + + widget.set_active(0) + +@@ -1075,17 +1068,7 @@ class vmmCreate(vmmGObjectUI): install = _("Operating system container") osstr = "" @@ -201,8 +409,21 @@ index 737c1fa..2b99de8 100644 self.widget("finish-warn-os").set_visible(not have_os) self.widget("summary-os").set_text(osstr) +diff --git a/virtcli/cliconfig.py b/virtcli/cliconfig.py +index ef66ba4..da077df 100644 +--- a/virtcli/cliconfig.py ++++ b/virtcli/cliconfig.py +@@ -79,8 +79,6 @@ class _CLIConfig(object): + self.default_qemu_user = _get_param("default_qemu_user", "root") + self.stable_defaults = bool(int(_get_param("stable_defaults", "0"))) + +- self.preferred_distros = _split_list( +- _get_param("preferred_distros", "")) + self.hv_packages = _split_list(_get_param("hv_packages", "")) + self.askpass_package = _split_list(_get_param("askpass_packages", "")) + self.libvirt_packages = _split_list(_get_param("libvirt_packages", "")) diff --git a/virtinst/guest.py b/virtinst/guest.py -index 6a42536..e774d47 100644 +index 6a42536..b375bdc 100644 --- a/virtinst/guest.py +++ b/virtinst/guest.py @@ -608,7 +608,6 @@ class Guest(XMLBuilder): @@ -213,11 +434,130 @@ index 6a42536..e774d47 100644 self.conn.check_support(self.conn.SUPPORT_CONN_AUTOSOCKET)): dev = VirtualChannelDevice(self.conn) dev.type = "unix" +@@ -653,8 +652,7 @@ class Guest(XMLBuilder): + # But only if we are installing windows which has a multi stage + # install. + if (dev.is_cdrom() and +- getattr(dev, "installer_media", False) and +- not self._os_object.is_windows()): ++ getattr(dev, "installer_media", False)): + dev.path = None + + def _set_defaults(self): +@@ -741,10 +739,8 @@ class Guest(XMLBuilder): + hpet.present = False + + hv_clock = self.conn.check_support(self.conn.SUPPORT_CONN_HYPERV_CLOCK) +- hv_clock_rhel = self.conn.check_support(self.conn.SUPPORT_CONN_HYPERV_CLOCK_RHEL) + +- if (self._os_object.is_windows() and self._hv_supported() and +- (hv_clock or (self.stable_defaults() and hv_clock_rhel))): ++ if (self._hv_supported() and (hv_clock or self.stable_defaults())): + hyperv = self.clock.add_timer() + hyperv.name = "hypervclock" + hyperv.present = True +@@ -847,8 +843,7 @@ class Guest(XMLBuilder): + self.conn.check_support(self.conn.SUPPORT_CONN_VMPORT)): + self.features.vmport = False + +- if (self._os_object.is_windows() and +- self._hv_supported() and ++ if (self._hv_supported() and + self.conn.check_support(self.conn.SUPPORT_CONN_HYPERV_VAPIC)): + if self.features.hyperv_relaxed is None: + self.features.hyperv_relaxed = True +diff --git a/virtinst/initrdinject.py b/virtinst/initrdinject.py +index eb5f419..726264a 100644 +--- a/virtinst/initrdinject.py ++++ b/virtinst/initrdinject.py +@@ -24,61 +24,6 @@ import subprocess + import tempfile + + +-def _rhel4_initrd_inject(initrd, injections): +- try: +- file_proc = subprocess.Popen(["file", "-z", initrd], +- stdout=subprocess.PIPE, +- stderr=subprocess.PIPE) +- if "ext2 filesystem" not in file_proc.communicate()[0]: +- return False +- except: +- logging.exception("Failed to file command for rhel4 initrd detection") +- return False +- +- logging.debug("Is RHEL4 initrd") +- +- # Uncompress the initrd +- newinitrd = file(initrd + ".new", "wb") +- gzip_proc = subprocess.Popen(["gzip", "-d", "-f", "-c", initrd], +- stdout=newinitrd, +- stderr=subprocess.PIPE) +- gzip_proc.wait() +- newinitrd.close() +- +- debugfserr = "" +- for filename in injections: +- # We have an ext2 filesystem, use debugfs to inject files +- cmd = ["debugfs", "-w", "-R", +- "write %s %s" % (filename, os.path.basename(filename)), +- newinitrd.name] +- logging.debug("Copying %s to the initrd with cmd=%s", filename, cmd) +- +- debugfs_proc = subprocess.Popen(cmd, +- stdout=subprocess.PIPE, +- stderr=subprocess.PIPE) +- debugfs_proc.wait() +- debugfserr += debugfs_proc.stderr.read() or "" +- +- gziperr = gzip_proc.stderr.read() +- if gziperr: +- logging.debug("gzip stderr=%s", gziperr) +- if debugfserr: +- logging.debug("debugfs stderr=%s", debugfserr) +- +- # Recompress the initrd +- gzip_proc = subprocess.Popen(["gzip"], +- stdin=file(newinitrd.name, "rb"), +- stdout=file(initrd, "wb"), +- stderr=subprocess.PIPE) +- gzip_proc.wait() +- gziperr = gzip_proc.stderr.read() +- if gziperr: +- logging.debug("gzip stderr=%s", gziperr) +- os.unlink(newinitrd.name) +- +- return True +- +- + def perform_initrd_injections(initrd, injections, scratchdir): + """ + Insert files into the root directory of the initial ram disk +@@ -86,9 +31,6 @@ def perform_initrd_injections(initrd, injections, scratchdir): + if not injections: + return + +- if _rhel4_initrd_inject(initrd, injections): +- return +- + tempdir = tempfile.mkdtemp(dir=scratchdir) + os.chmod(tempdir, 0775) + diff --git a/virtinst/osdict.py b/virtinst/osdict.py -index e8c1487..a9e47cf 100644 +index e8c1487..2b2ba31 100644 --- a/virtinst/osdict.py +++ b/virtinst/osdict.py -@@ -61,12 +61,6 @@ def _remove_older_point_releases(distro_list): +@@ -39,10 +39,6 @@ def _remove_older_point_releases(distro_list): + return int(osobj.name.rsplit(".", 1)[-1]) + + def _find_latest(prefix): +- """ +- Given a prefix like 'rhel4', find the latest 'rhel4.X', +- and remove the rest from the os list +- """ + latest_os = None + first_id = None + for osobj in ret[:]: +@@ -61,12 +57,6 @@ def _remove_older_point_releases(distro_list): if latest_os: ret.insert(first_id, latest_os) @@ -230,7 +570,7 @@ index e8c1487..a9e47cf 100644 return ret -@@ -134,49 +128,7 @@ class _OSDB(object): +@@ -134,49 +124,7 @@ class _OSDB(object): # This is only for back compatibility with pre-libosinfo support. # This should never change. _aliases = { @@ -280,7 +620,7 @@ index e8c1487..a9e47cf 100644 "other": "generic", } -@@ -232,17 +184,11 @@ class _OSDB(object): +@@ -232,17 +180,11 @@ class _OSDB(object): return None osname = ret[0].get_short_id() @@ -299,7 +639,7 @@ index e8c1487..a9e47cf 100644 return approved_types def list_os(self, typename=None, only_supported=False, sortpref=None): -@@ -265,13 +211,6 @@ class _OSDB(object): +@@ -265,13 +207,6 @@ class _OSDB(object): return _sort(sortmap, sortpref=sortpref, limit_point_releases=only_supported) @@ -313,7 +653,7 @@ index e8c1487..a9e47cf 100644 ##################### # OsVariant classes # -@@ -287,7 +226,6 @@ class _OsVariant(object): +@@ -287,7 +222,6 @@ class _OsVariant(object): self.codename = self._os and self._os.get_codename() or "" self.sortby = self._get_sortby() @@ -321,7 +661,7 @@ index e8c1487..a9e47cf 100644 self._supported = None -@@ -363,34 +301,6 @@ class _OsVariant(object): +@@ -363,34 +297,6 @@ class _OsVariant(object): return (datetime.datetime.strptime(eol_date, "%Y-%m-%d") > datetime.datetime.now()) @@ -356,7 +696,7 @@ index e8c1487..a9e47cf 100644 ############### # Public APIs # -@@ -408,39 +318,13 @@ class _OsVariant(object): +@@ -408,39 +314,12 @@ class _OsVariant(object): if not self._os: return "generic" @@ -387,8 +727,9 @@ index e8c1487..a9e47cf 100644 + return None def get_clock(self): - if self.is_windows() or self._family in ['solaris']: - return "localtime" +- if self.is_windows() or self._family in ['solaris']: +- return "localtime" ++ return "localtime" return "utc" - def supports_virtiommio(self): @@ -397,7 +738,7 @@ index e8c1487..a9e47cf 100644 def default_netmodel(self): """ Default non-virtio net-model, since we check for that separately -@@ -499,37 +383,16 @@ class _OsVariant(object): +@@ -499,37 +378,16 @@ class _OsVariant(object): return False -- cgit v1.2.2