2018-02-06 21:28:37 +01:00
|
|
|
Enhancement that gets installation repos from zypper.
|
2015-05-04 22:15:01 +02:00
|
|
|
These locations are then presented as potential installation
|
2018-02-06 21:28:37 +01:00
|
|
|
sources when creating a VM.
|
2022-03-03 05:17:21 +01:00
|
|
|
Index: virt-manager-3.3.0/virtManager/createvm.py
|
2014-03-10 14:54:17 +01:00
|
|
|
===================================================================
|
2022-03-03 05:17:21 +01:00
|
|
|
--- virt-manager-3.3.0.orig/virtManager/createvm.py
|
|
|
|
+++ virt-manager-3.3.0/virtManager/createvm.py
|
|
|
|
@@ -164,6 +164,70 @@ class _GuestData:
|
2020-09-16 19:23:41 +02:00
|
|
|
return guest
|
2014-03-10 14:54:17 +01:00
|
|
|
|
- bsc#1140211 - VUL-1: CVE-2019-10183: virt-manager: unattended
option leaks password via command line argument
58c68764-unattended-Read-the-passwords-from-a-file.patch
51d28f04-unattended-Dont-log-user-admin-passwords.patch
- Upstream bug fix (bsc#1027942)
5312a961-virt-install-Revive-wait-0-as-alias-for-noautoconsole.patch
- Update to virt-manager 2.2.0 (fate#326786)
virt-manager-2.2.0.tar.bz2
* libvirt XML viewing and editing UI for new and existing domain, pools, volumes, networks
* virt-install: libosinfo –unattended support (Fabiano Fidêncio, Cole Robinson)
* Improve CPU model security defaults (Pavel Hrdina)
* virt-install: new –install option. Ex: virt-install –install fedora29
* virt-install: new –install kernel=,initrd=
* virt-install: –disk, –memory, –name defaults from libosinfo (Fabiano Fidêncio, Cole Robinson)
* virt-install: add device suboption aliases which consistently match libvirt XML naming
* virt-xml: new –start, –no-define options (Marc Hartmayer)
* virt-install: Add driver_queues argument to –controller (Vasudeva Kamath)
* RISC-V support (Andrea Bolognani)
* Device default improvements for non-x86 KVM (Andrea Bolognani)
* Redesigned ‘New Network’ wizard
* libguestfs inspection improvements (Pino Toscano)
* virt-install: Add support for xenbus controller (Jim Fehlig)
* cli: Add –disk wwn=,rawio= (Athina Plaskasoviti)
* cli: Add –memballoon autodeflate=,stats.period= (Athina Plaskasoviti)
* cli: Add –iothreads (Athina Plaskasoviti)
* cli: Add –numatune memory.placement (Athina Plaskasoviti)
* cli: Add –launchSecurity option (Erik Skultety)
* cli: Fill in –memorybacking options
* cli: –smartcard: support database= and certificate[0-9]*=
OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=476
2019-07-03 20:19:42 +02:00
|
|
|
|
|
|
|
+################################################
|
|
|
|
+# Helpers for using SUSE installation location #
|
|
|
|
+################################################
|
|
|
|
+
|
2015-06-02 22:12:49 +02:00
|
|
|
+import subprocess
|
|
|
|
+from subprocess import Popen, PIPE
|
- bsc#1140211 - VUL-1: CVE-2019-10183: virt-manager: unattended
option leaks password via command line argument
58c68764-unattended-Read-the-passwords-from-a-file.patch
51d28f04-unattended-Dont-log-user-admin-passwords.patch
- Upstream bug fix (bsc#1027942)
5312a961-virt-install-Revive-wait-0-as-alias-for-noautoconsole.patch
- Update to virt-manager 2.2.0 (fate#326786)
virt-manager-2.2.0.tar.bz2
* libvirt XML viewing and editing UI for new and existing domain, pools, volumes, networks
* virt-install: libosinfo –unattended support (Fabiano Fidêncio, Cole Robinson)
* Improve CPU model security defaults (Pavel Hrdina)
* virt-install: new –install option. Ex: virt-install –install fedora29
* virt-install: new –install kernel=,initrd=
* virt-install: –disk, –memory, –name defaults from libosinfo (Fabiano Fidêncio, Cole Robinson)
* virt-install: add device suboption aliases which consistently match libvirt XML naming
* virt-xml: new –start, –no-define options (Marc Hartmayer)
* virt-install: Add driver_queues argument to –controller (Vasudeva Kamath)
* RISC-V support (Andrea Bolognani)
* Device default improvements for non-x86 KVM (Andrea Bolognani)
* Redesigned ‘New Network’ wizard
* libguestfs inspection improvements (Pino Toscano)
* virt-install: Add support for xenbus controller (Jim Fehlig)
* cli: Add –disk wwn=,rawio= (Athina Plaskasoviti)
* cli: Add –memballoon autodeflate=,stats.period= (Athina Plaskasoviti)
* cli: Add –iothreads (Athina Plaskasoviti)
* cli: Add –numatune memory.placement (Athina Plaskasoviti)
* cli: Add –launchSecurity option (Erik Skultety)
* cli: Fill in –memorybacking options
* cli: –smartcard: support database= and certificate[0-9]*=
OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=476
2019-07-03 20:19:42 +02:00
|
|
|
+
|
2014-03-10 14:54:17 +01:00
|
|
|
+_host_repo_url = None
|
|
|
|
+
|
|
|
|
+def getHostInstallSource():
|
|
|
|
+ global _host_repo_url
|
|
|
|
+ if _host_repo_url is not None:
|
|
|
|
+ return _host_repo_url
|
2014-03-19 23:29:53 +01:00
|
|
|
+ if os.geteuid() != 0:
|
|
|
|
+ return None
|
2014-03-10 14:54:17 +01:00
|
|
|
+
|
2018-02-06 21:28:37 +01:00
|
|
|
+ (_,zypper_output) = lookupZypperRepos()
|
|
|
|
+ if len(zypper_output):
|
|
|
|
+ _host_repo_url = zypper_output[0]
|
|
|
|
+ return _host_repo_url
|
2014-03-10 14:54:17 +01:00
|
|
|
+ return None
|
|
|
|
+
|
2017-03-20 21:23:05 +01:00
|
|
|
+def lookupZypperRepos(dom0_inst_source=None):
|
2015-06-02 22:12:49 +02:00
|
|
|
+ try:
|
2015-11-10 17:24:49 +01:00
|
|
|
+ env = os.environ.copy()
|
|
|
|
+ env['LC_ALL'] = 'C'
|
2017-03-20 21:23:05 +01:00
|
|
|
+ cmd = ['/usr/bin/zypper', 'lr', '-u', '-P', '-E']
|
2015-11-10 17:24:49 +01:00
|
|
|
+ p = subprocess.Popen(cmd, stdout=PIPE, stderr=PIPE, env=env)
|
2015-06-02 22:12:49 +02:00
|
|
|
+ stdout, stderr = p.communicate()
|
2018-02-06 21:28:37 +01:00
|
|
|
+ zypper_output = stdout.decode()
|
2015-09-23 21:42:51 +02:00
|
|
|
+ zypper_list = zypper_output.split("\n")
|
|
|
|
+ zypper_header = [x.strip(' ') for x in zypper_list[0].split("|")]
|
|
|
|
+ uri_index = zypper_header.index("URI")
|
2015-06-02 22:12:49 +02:00
|
|
|
+ except:
|
2016-07-20 00:29:48 +02:00
|
|
|
+ inst_source = []
|
|
|
|
+ if dom0_inst_source:
|
|
|
|
+ inst_source = [dom0_inst_source]
|
|
|
|
+ return (0, inst_source)
|
2015-06-02 22:12:49 +02:00
|
|
|
+
|
2014-03-10 14:54:17 +01:00
|
|
|
+ index_dom0 = -1
|
|
|
|
+ number_of_sources = 0
|
|
|
|
+ zypper_output = []
|
2015-06-02 22:12:49 +02:00
|
|
|
+ for repo in zypper_list:
|
|
|
|
+ repo = [x.strip(' ') for x in repo.split("|")]
|
|
|
|
+ if len(repo) >= uri_index:
|
|
|
|
+ str = repo[uri_index]
|
2014-03-10 14:54:17 +01:00
|
|
|
+ if str.startswith('ftp://') or str.startswith('http://') or str.startswith('nfs://') or str.startswith('smb://'):
|
2019-12-02 23:14:53 +01:00
|
|
|
+ if str not in zypper_output:
|
|
|
|
+ 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
|
2015-06-02 22:12:49 +02:00
|
|
|
+
|
2014-03-10 14:54:17 +01:00
|
|
|
+ if index_dom0 == -1 and dom0_inst_source:
|
|
|
|
+ index_dom0 = 0
|
|
|
|
+ zypper_output.insert(0, dom0_inst_source)
|
|
|
|
+ return (index_dom0, zypper_output)
|
|
|
|
+
|
2017-03-20 21:23:05 +01:00
|
|
|
+def getInstallRepos():
|
|
|
|
+ if os.geteuid() != 0:
|
|
|
|
+ return (0, [])
|
|
|
|
+ return lookupZypperRepos(getHostInstallSource())
|
2015-11-26 00:27:12 +01:00
|
|
|
+
|
- bsc#1140211 - VUL-1: CVE-2019-10183: virt-manager: unattended
option leaks password via command line argument
58c68764-unattended-Read-the-passwords-from-a-file.patch
51d28f04-unattended-Dont-log-user-admin-passwords.patch
- Upstream bug fix (bsc#1027942)
5312a961-virt-install-Revive-wait-0-as-alias-for-noautoconsole.patch
- Update to virt-manager 2.2.0 (fate#326786)
virt-manager-2.2.0.tar.bz2
* libvirt XML viewing and editing UI for new and existing domain, pools, volumes, networks
* virt-install: libosinfo –unattended support (Fabiano Fidêncio, Cole Robinson)
* Improve CPU model security defaults (Pavel Hrdina)
* virt-install: new –install option. Ex: virt-install –install fedora29
* virt-install: new –install kernel=,initrd=
* virt-install: –disk, –memory, –name defaults from libosinfo (Fabiano Fidêncio, Cole Robinson)
* virt-install: add device suboption aliases which consistently match libvirt XML naming
* virt-xml: new –start, –no-define options (Marc Hartmayer)
* virt-install: Add driver_queues argument to –controller (Vasudeva Kamath)
* RISC-V support (Andrea Bolognani)
* Device default improvements for non-x86 KVM (Andrea Bolognani)
* Redesigned ‘New Network’ wizard
* libguestfs inspection improvements (Pino Toscano)
* virt-install: Add support for xenbus controller (Jim Fehlig)
* cli: Add –disk wwn=,rawio= (Athina Plaskasoviti)
* cli: Add –memballoon autodeflate=,stats.period= (Athina Plaskasoviti)
* cli: Add –iothreads (Athina Plaskasoviti)
* cli: Add –numatune memory.placement (Athina Plaskasoviti)
* cli: Add –launchSecurity option (Erik Skultety)
* cli: Fill in –memorybacking options
* cli: –smartcard: support database= and certificate[0-9]*=
OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=476
2019-07-03 20:19:42 +02:00
|
|
|
+
|
|
|
|
##############
|
|
|
|
# Main class #
|
|
|
|
##############
|
2022-03-03 05:17:21 +01:00
|
|
|
@@ -422,7 +486,13 @@ class vmmCreateVM(vmmGObjectUI):
|
- bsc#1140211 - VUL-1: CVE-2019-10183: virt-manager: unattended
option leaks password via command line argument
58c68764-unattended-Read-the-passwords-from-a-file.patch
51d28f04-unattended-Dont-log-user-admin-passwords.patch
- Upstream bug fix (bsc#1027942)
5312a961-virt-install-Revive-wait-0-as-alias-for-noautoconsole.patch
- Update to virt-manager 2.2.0 (fate#326786)
virt-manager-2.2.0.tar.bz2
* libvirt XML viewing and editing UI for new and existing domain, pools, volumes, networks
* virt-install: libosinfo –unattended support (Fabiano Fidêncio, Cole Robinson)
* Improve CPU model security defaults (Pavel Hrdina)
* virt-install: new –install option. Ex: virt-install –install fedora29
* virt-install: new –install kernel=,initrd=
* virt-install: –disk, –memory, –name defaults from libosinfo (Fabiano Fidêncio, Cole Robinson)
* virt-install: add device suboption aliases which consistently match libvirt XML naming
* virt-xml: new –start, –no-define options (Marc Hartmayer)
* virt-install: Add driver_queues argument to –controller (Vasudeva Kamath)
* RISC-V support (Andrea Bolognani)
* Device default improvements for non-x86 KVM (Andrea Bolognani)
* Redesigned ‘New Network’ wizard
* libguestfs inspection improvements (Pino Toscano)
* virt-install: Add support for xenbus controller (Jim Fehlig)
* cli: Add –disk wwn=,rawio= (Athina Plaskasoviti)
* cli: Add –memballoon autodeflate=,stats.period= (Athina Plaskasoviti)
* cli: Add –iothreads (Athina Plaskasoviti)
* cli: Add –numatune memory.placement (Athina Plaskasoviti)
* cli: Add –launchSecurity option (Erik Skultety)
* cli: Fill in –memorybacking options
* cli: –smartcard: support database= and certificate[0-9]*=
OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=476
2019-07-03 20:19:42 +02:00
|
|
|
self.widget("install-url-entry").set_text("")
|
|
|
|
self.widget("install-url-options").set_expanded(False)
|
|
|
|
urlmodel = self.widget("install-url-combo").get_model()
|
|
|
|
- _populate_media_model(urlmodel, self.config.get_media_urls())
|
|
|
|
+ urllist = self.config.get_media_urls()
|
|
|
|
+ (index, inst_repos) = getInstallRepos()
|
|
|
|
+ for u in urllist:
|
|
|
|
+ if u in inst_repos:
|
|
|
|
+ inst_repos.remove(u)
|
|
|
|
+ media_urllist = urllist + inst_repos
|
|
|
|
+ _populate_media_model(urlmodel, media_urllist)
|
|
|
|
|
|
|
|
# Install import
|
|
|
|
self.widget("install-import-entry").set_text("")
|