Hello community, here is the log from the commit of package yast2-vm for openSUSE:Factory checked in at 2018-04-26 13:29:03 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-vm (Old) and /work/SRC/openSUSE:Factory/.yast2-vm.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-vm" Thu Apr 26 13:29:03 2018 rev:79 rq:597119 version:4.0.1 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-vm/yast2-vm.changes 2018-02-13 10:24:09.180444061 +0100 +++ /work/SRC/openSUSE:Factory/.yast2-vm.new/yast2-vm.changes 2018-04-26 13:29:04.195780563 +0200 @@ -1,0 +2,27 @@ +Fri Apr 13 08:34:25 UTC 2018 - [email protected] + +- Use the new firewalld API (bsc#1083455) +- 4.0.1 + +------------------------------------------------------------------- +Thu Apr 12 15:22:44 MDT 2018 - [email protected] + +- bsc#1086487 - YaST2 segfault when virt-manager is installed but + not yast2-vm +- bsc#1083455 - Internal error in yast configuration part + "Relocation Server Configuration" - "Service with name + 'libvirtd-relocation-server' does not exist" +- bsc#1089255 - yast install hypervisor and tools not working + correctly +- bsc#1088338 - yast2 vm tries to install + patterns-openSUSE-kvm_server +- Remove all xend code from Relocation Server. It is no longer + supported. + +------------------------------------------------------------------- +Fri Apr 6 18:54:53 UTC 2018 - [email protected] + +- bnc#1087957 - version bump +- 4.0.0 + +------------------------------------------------------------------- Old: ---- yast2-vm-3.2.5.tar.bz2 New: ---- yast2-vm-4.0.1.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-vm.spec ++++++ --- /var/tmp/diff_new_pack.lTN53D/_old 2018-04-26 13:29:04.655763715 +0200 +++ /var/tmp/diff_new_pack.lTN53D/_new 2018-04-26 13:29:04.659763569 +0200 @@ -17,13 +17,12 @@ Name: yast2-vm -Version: 3.2.5 +Version: 4.0.1 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build Source0: %{name}-%{version}.tar.bz2 -ExclusiveArch: aarch64 %ix86 x86_64 s390x BuildRequires: perl-XML-Writer BuildRequires: update-desktop-files BuildRequires: yast2 ++++++ yast2-vm-3.2.5.tar.bz2 -> yast2-vm-4.0.1.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-vm-3.2.5/package/yast2-vm.changes new/yast2-vm-4.0.1/package/yast2-vm.changes --- old/yast2-vm-3.2.5/package/yast2-vm.changes 2018-02-12 18:44:06.000000000 +0100 +++ new/yast2-vm-4.0.1/package/yast2-vm.changes 2018-04-13 15:02:28.000000000 +0200 @@ -1,4 +1,31 @@ ------------------------------------------------------------------- +Fri Apr 13 08:34:25 UTC 2018 - [email protected] + +- Use the new firewalld API (bsc#1083455) +- 4.0.1 + +------------------------------------------------------------------- +Thu Apr 12 15:22:44 MDT 2018 - [email protected] + +- bsc#1086487 - YaST2 segfault when virt-manager is installed but + not yast2-vm +- bsc#1083455 - Internal error in yast configuration part + "Relocation Server Configuration" - "Service with name + 'libvirtd-relocation-server' does not exist" +- bsc#1089255 - yast install hypervisor and tools not working + correctly +- bsc#1088338 - yast2 vm tries to install + patterns-openSUSE-kvm_server +- Remove all xend code from Relocation Server. It is no longer + supported. + +------------------------------------------------------------------- +Fri Apr 6 18:54:53 UTC 2018 - [email protected] + +- bnc#1087957 - version bump +- 4.0.0 + +------------------------------------------------------------------- Fri Feb 9 12:19:42 MST 2018 - [email protected] - The check for TextMode was in the wrong place and diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-vm-3.2.5/package/yast2-vm.spec new/yast2-vm-4.0.1/package/yast2-vm.spec --- old/yast2-vm-3.2.5/package/yast2-vm.spec 2018-02-12 18:44:06.000000000 +0100 +++ new/yast2-vm-4.0.1/package/yast2-vm.spec 2018-04-13 15:02:28.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package yast2-vm # -# Copyright (c) 2017 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,14 +17,13 @@ Name: yast2-vm -Version: 3.2.5 +Version: 4.0.1 Release: 0 Group: System/YaST BuildRoot: %{_tmppath}/%{name}-%{version}-build Source0: %{name}-%{version}.tar.bz2 -ExclusiveArch: aarch64 %ix86 x86_64 s390x BuildRequires: perl-XML-Writer update-desktop-files yast2 yast2-testsuite BuildRequires: yast2-bootloader >= 3.1.35 Requires: yast2-bootloader >= 3.1.35 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-vm-3.2.5/src/include/relocation-server/complex.rb new/yast2-vm-4.0.1/src/include/relocation-server/complex.rb --- old/yast2-vm-3.2.5/src/include/relocation-server/complex.rb 2018-02-12 18:44:06.000000000 +0100 +++ new/yast2-vm-4.0.1/src/include/relocation-server/complex.rb 2018-04-13 15:02:28.000000000 +0200 @@ -69,164 +69,6 @@ ret ? :next : :abort end - def InitGlobalState - server_stat = Convert.to_boolean( - UI.QueryWidget(Id("xend-relocation-server"), :Value) - ) - ssl_server_stat = Convert.to_boolean( - UI.QueryWidget(Id("xend-relocation-ssl-server"), :Value) - ) - stat = server_stat || ssl_server_stat - UI.ChangeWidget(Id("xend-relocation-address"), :Enabled, stat) - UI.ChangeWidget(Id("xend-relocation-hosts-allow"), :Enabled, stat) - if stat - CWMFirewallInterfaces.EnableOpenFirewallWidget - else - CWMFirewallInterfaces.DisableOpenFirewallWidget - end - stat = server_stat && ssl_server_stat - UI.ChangeWidget(Id("xend-relocation-ssl"), :Enabled, stat) - - nil - end - - def InitServerState - stat = Convert.to_boolean( - UI.QueryWidget(Id("xend-relocation-server"), :Value) - ) - UI.ChangeWidget(Id("xend-relocation-port"), :Enabled, stat) - InitGlobalState() - - nil - end - - def InitSSLServerState - stat = Convert.to_boolean( - UI.QueryWidget(Id("xend-relocation-ssl-server"), :Value) - ) - UI.ChangeWidget(Id("xend-relocation-ssl-port"), :Enabled, stat) - UI.ChangeWidget(Id("xend-relocation-server-ssl-key-file"), :Enabled, stat) - UI.ChangeWidget( - Id("xend-relocation-server-ssl-cert-file"), - :Enabled, - stat - ) - UI.ChangeWidget(Id("browse_ssl_key_file"), :Enabled, stat) - UI.ChangeWidget(Id("browse_ssl_cert_file"), :Enabled, stat) - InitGlobalState() - - nil - end - - def InitXendConfigurationDialog(id) - Builtins.foreach( - [ - "xend-relocation-server", - "xend-relocation-ssl-server", - "xend-relocation-ssl" - ] - ) do |key| - UI.ChangeWidget( - Id(key), - :Value, - RelocationServer.GetXendOption(key) == "yes" - ) - end - - Builtins.foreach( - [ - "xend-relocation-server-ssl-key-file", - "xend-relocation-server-ssl-cert-file", - "xend-relocation-address", - "xend-relocation-hosts-allow" - ] - ) do |key| - UI.ChangeWidget(Id(key), :Value, RelocationServer.GetXendOption(key)) - end - - Builtins.foreach(["xend-relocation-port", "xend-relocation-ssl-port"]) do |key| - UI.ChangeWidget( - Id(key), - :Value, - Builtins.tointeger(RelocationServer.GetXendOption(key)) - ) - end - - InitServerState() - InitSSLServerState() - - nil - end - - def HandleXendConfigurationDialog(id, event) - event = deep_copy(event) - action = Ops.get(event, "ID") - - if action == "browse_ssl_key_file" - new_filename = UI.AskForExistingFile("", "", _("Select SSL Key File")) - if new_filename != nil && new_filename != "" - UI.ChangeWidget( - Id("xend-relocation-server-ssl-key-file"), - :Value, - new_filename - ) - end - elsif action == "browse_ssl_cert_file" - new_filename = UI.AskForExistingFile("", "", _("Select SSL Cert File")) - if new_filename != nil && new_filename != "" - UI.ChangeWidget( - Id("xend-relocation-server-ssl-cert-file"), - :Value, - new_filename - ) - end - elsif action == "xend-relocation-server" - InitServerState() - elsif action == "xend-relocation-ssl-server" - InitSSLServerState() - end - nil - end - - def StoreXendConfigurationDialog(id, event) - event = deep_copy(event) - RelocationServer.SetModified - - Builtins.foreach( - [ - "xend-relocation-server", - "xend-relocation-ssl-server", - "xend-relocation-ssl" - ] - ) do |key| - value = Convert.to_boolean(UI.QueryWidget(Id(key), :Value)) == true ? "yes" : "no" - if value != RelocationServer.GetXendOption(key) - RelocationServer.SetXendOption(key, value) - end - end - - Builtins.foreach( - [ - "xend-relocation-server-ssl-key-file", - "xend-relocation-server-ssl-cert-file", - "xend-relocation-address", - "xend-relocation-hosts-allow", - "xend-relocation-port", - "xend-relocation-ssl-port" - ] - ) do |key| - value = Builtins.tostring(UI.QueryWidget(Id(key), :Value)) - if value != RelocationServer.GetXendOption(key) - RelocationServer.SetXendOption( - key, - Builtins.tostring(UI.QueryWidget(Id(key), :Value)) - ) - end - end - - nil - end - def InitLibvirtFireWall tunneled_migration = Convert.to_boolean( UI.QueryWidget(Id("tunneled_migration"), :Value) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-vm-3.2.5/src/include/relocation-server/dialogs.rb new/yast2-vm-4.0.1/src/include/relocation-server/dialogs.rb --- old/yast2-vm-3.2.5/src/include/relocation-server/dialogs.rb 2018-02-12 18:44:06.000000000 +0100 +++ new/yast2-vm-4.0.1/src/include/relocation-server/dialogs.rb 2018-04-13 15:02:28.000000000 +0200 @@ -37,100 +37,6 @@ Yast.include include_target, "relocation-server/helps.rb" end - def XendConfigurationDialogContent - VBox( - Frame( - _("Global Settings"), - VBox( - Left( - InputField( - Id("xend-relocation-address"), - Opt(:hstretch), - _("Relocation Address:") - ) - ), - Left( - InputField( - Id("xend-relocation-hosts-allow"), - Opt(:hstretch), - _("Allowed Hosts:") - ) - ), - Left(CheckBox(Id("xend-relocation-ssl"), _("Use SSL as Default"))), - HStretch(), - VStretch() - ) - ), - Frame( - _("non-SSL Server"), - VBox( - Left( - HSquash( - IntField(Id("xend-relocation-port"), _("Port:"), 1, 65535, 1) - ) - ), - Left( - CheckBox(Id("xend-relocation-server"), Opt(:notify), _("Enable")) - ), - VStretch() - ) - ), - Frame( - _("SSL Server"), - VBox( - Left( - HSquash( - IntField( - Id("xend-relocation-ssl-port"), - _("Port:"), - 1, - 65535, - 1 - ) - ) - ), - Left( - HBox( - InputField( - Id("xend-relocation-server-ssl-key-file"), - Opt(:hstretch), - _("SSL Key File:") - ), - HSpacing(1), - VBox( - Label(""), - PushButton(Id("browse_ssl_key_file"), Label.BrowseButton) - ) - ) - ), - Left( - HBox( - InputField( - Id("xend-relocation-server-ssl-cert-file"), - Opt(:hstretch), - _("SSL Cert File:") - ), - HSpacing(1), - VBox( - Label(""), - PushButton(Id("browse_ssl_cert_file"), Label.BrowseButton) - ) - ) - ), - Left( - CheckBox( - Id("xend-relocation-ssl-server"), - Opt(:notify), - _("Enable") - ) - ), - VStretch() - ) - ), - Frame(_("Firewall"), VBox("fw-xend", VStretch())) - ) - end - def LibvirtConfigurationDialogContent VBox( Frame( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-vm-3.2.5/src/include/relocation-server/helps.rb new/yast2-vm-4.0.1/src/include/relocation-server/helps.rb --- old/yast2-vm-3.2.5/src/include/relocation-server/helps.rb 2018-02-12 18:44:06.000000000 +0100 +++ new/yast2-vm-4.0.1/src/include/relocation-server/helps.rb 2018-04-13 15:02:28.000000000 +0200 @@ -51,14 +51,6 @@ "An additional dialog informs whether it is safe to do so.\n" + "</p>\n" ), - "xend_configuration" => _( - "<p><b>Relocation Address</b><br>\n" + - "Address xend should listen on for relocation-socket connections</p>\n" + - "<p><b>Allowed Hosts</b><br>\n" + - "The hosts allowed to talk to the relocation port. If this is empty, then all connections are allowed. Otherwise, this should be a space-separated sequence of regular expressions. Any host with a fully-qualified domain name or an IP address that matches one of these regular expressions will be accepted.</p>\n" + - "<p><b>SSL Key File/SSL Cert File</b><br>\n" + - "SSL key and certificate to use for the ssl relocation interface</p>" - ), "libvirt_configuration" => _( "<p><b><big>Tunneled migration</big></b><br>\n" + "The source host libvirtd opens a direct connection to the destination host libvirtd for sending migration data. This allows the option of encrypting the data stream.</p>\n" + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-vm-3.2.5/src/include/relocation-server/wizards.rb new/yast2-vm-4.0.1/src/include/relocation-server/wizards.rb --- old/yast2-vm-3.2.5/src/include/relocation-server/wizards.rb 2018-02-12 18:44:06.000000000 +0100 +++ new/yast2-vm-4.0.1/src/include/relocation-server/wizards.rb 2018-04-13 15:02:28.000000000 +0200 @@ -48,29 +48,6 @@ # @return sequence result def MainSequence widgets = { - "fw-xend" => CWMFirewallInterfaces.CreateOpenFirewallWidget( - { - "services" => ["service:xend-relocation-server"], - "display_details" => true - } - ), - "xend" => { - "widget" => :custom, - "help" => Ops.get_string(@HELPS, "xend_configuration", ""), - "custom_widget" => XendConfigurationDialogContent(), - "handle" => fun_ref( - method(:HandleXendConfigurationDialog), - "symbol (string, map)" - ), - "init" => fun_ref( - method(:InitXendConfigurationDialog), - "void (string)" - ), - "store" => fun_ref( - method(:StoreXendConfigurationDialog), - "void (string, map)" - ) - }, "libvirt" => { "widget" => :custom, "help" => Ops.get_string(@HELPS, "libvirt_configuration", ""), @@ -91,8 +68,8 @@ "fw-libvirt" => CWMFirewallInterfaces.CreateOpenFirewallWidget( { "services" => [ - "service:libvirtd-relocation-server", - "service:sshd" + "libvirtd-relocation-server", + "ssh" ], "display_details" => true } @@ -100,11 +77,6 @@ } tabs = { - "xend_configuration" => { - "header" => _("&Xend"), - "widget_names" => ["xend", "fw-xend"], - "contents" => XendConfigurationDialogContent() - }, "kvm_configuration" => { "header" => _("&KVM"), "widget_names" => ["libvirt", "fw-libvirt"], @@ -117,32 +89,22 @@ } } - if !RelocationServer.is_xend() - Builtins.remove(tabs, "xend_configuration") - if !Arch.is_kvm - Builtins.remove(tabs, "kvm_configuration") - else - Builtins.remove(tabs, "libxl_configuration") - end - else + if !Arch.is_kvm Builtins.remove(tabs, "kvm_configuration") + else + Builtins.remove(tabs, "libxl_configuration") end wd_arg = { - "tab_order" => ["xend_configuration"], + "tab_order" => ["libxl_configuration"], "tabs" => tabs, "widget_descr" => widgets, - "initial_tab" => "xend_configuration" + "initial_tab" => "libxl_configuration" } - if !RelocationServer.is_xend() - if Arch.is_kvm - Ops.set(wd_arg, "tab_order", ["kvm_configuration"]) - Ops.set(wd_arg, "initial_tab", "kvm_configuration") - else - Ops.set(wd_arg, "tab_order", ["libxl_configuration"]) - Ops.set(wd_arg, "initial_tab", "libxl_configuration") - end + if Arch.is_kvm + Ops.set(wd_arg, "tab_order", ["kvm_configuration"]) + Ops.set(wd_arg, "initial_tab", "kvm_configuration") end wd = { "tab" => CWMTab.CreateWidget(wd_arg) } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-vm-3.2.5/src/modules/RelocationServer.rb new/yast2-vm-4.0.1/src/modules/RelocationServer.rb --- old/yast2-vm-3.2.5/src/modules/RelocationServer.rb 2018-02-12 18:44:06.000000000 +0100 +++ new/yast2-vm-4.0.1/src/modules/RelocationServer.rb 2018-04-13 15:02:28.000000000 +0200 @@ -29,9 +29,11 @@ # Representation of the configuration of relocation-server. # Input and output routines. require "yast" +require "y2firewall/firewalld" module Yast class RelocationServerClass < Module + include Yast::Logger def main Yast.import "UI" textdomain "relocation-server" @@ -44,30 +46,10 @@ Yast.import "Message" Yast.import "Service" Yast.import "FileUtils" - Yast.import "SuSEFirewall" - Yast.import "SuSEFirewallServices" # Data was modified? @modified = false - # map of xend settings - @SETTINGS = {} - - @DEFAULT_CONFIG = { - "xend-relocation-server" => "no", - "xend-relocation-ssl-server" => "no", - "xend-relocation-port" => "8002", - "xend-relocation-ssl-port" => "8003", - "xend-relocation-server-ssl-key-file" => "xmlrpc.key", - "xend-relocation-server-ssl-cert-file" => "xmlrpc.cert", - "xend-relocation-ssl" => "no", - "xend-relocation-address" => "", - "xend-relocation-hosts-allow" => "^localhost$ ^localhost\\.localdomain$" - } - - # Describes whether the daemon is running - @xend_is_running = false - @libvirtd_default_ports = "49152:49215" @libvirtd_ports = [] @@ -83,6 +65,13 @@ } end + # Convenience method for obtaining a firewalld singleton instance + # + # @return [Y2Firewall::Firewalld] singleton instance + def firewalld + Y2Firewall::Firewalld.instance + end + # Returns whether the configuration has been modified. def GetModified @modified @@ -95,15 +84,6 @@ nil end - # Determine if we are using the libxl toolstack - def is_xend - if !Arch.is_xen0 || !FileUtils.Exists("/etc/vm/xend-config.sxp") || !FileUtils.Exists("/usr/sbin/xend") - return false - end - - true - end - # Returns a confirmation popup dialog whether user wants to really abort. def Abort Popup.ReallyAbort(GetModified()) @@ -119,103 +99,6 @@ false end - # Returns the Xend Option as a list of strings. - # - # @param [String] option_key of the xend configuration - # @return [String] with option_values - def GetXendOption(option_key) - Ops.get(@SETTINGS, option_key, Ops.get(@DEFAULT_CONFIG, option_key, "")) - end - - # Returns default Xend Option as a list of strings. - # - # @param [String] option_key of the Xend configuration - # @return [String] with option_values - - def GetDefaultXendOption(option_key) - Ops.get(@DEFAULT_CONFIG, option_key, "") - end - - # Sets values for an option. - # - # @param [String] option_key with the Xend configuration key - # @param string option_values with the Xend configuration values - def SetXendOption(option_key, option_vals) - Ops.set(@SETTINGS, option_key, option_vals) - - nil - end - - # Reads current xend configuration - def ReadXendSettings - Builtins.foreach(SCR.Dir(path(".etc.xen.xend-config"))) do |key| - val = Convert.to_string( - SCR.Read(Builtins.add(path(".etc.xen.xend-config"), key)) - ) - Ops.set(@SETTINGS, key, val) if val != nil - end - - Builtins.y2milestone("Xend configuration has been read: %1", @SETTINGS) - true - end - - # Writes current xend configuration - def WriteXendSettings - Builtins.y2milestone("Writing Xend configuration: %1", @SETTINGS) - - Builtins.foreach(@SETTINGS) do |option_key, option_val| - SCR.Write( - Builtins.add(path(".etc.xen.xend-config"), option_key), - option_val - ) - end - # This is very important - # it flushes the cache, and stores the configuration on the disk - SCR.Write(path(".etc.xen.xend-config"), nil) - - port = GetXendOption("xend-relocation-port") - ssl_port = GetXendOption("xend-relocation-ssl-port") - ports_list = [port, ssl_port] - SuSEFirewallServices.SetNeededPortsAndProtocols( - "service:xend-relocation-server", - { "tcp_ports" => ports_list } - ) - - true - end - - # Reads current xend status - def ReadXendService - xend = "/usr/sbin/xend" - retval = 1 - if FileUtils.Exists(xend) - retval = Convert.to_integer(SCR.Execute(path(".target.bash_output"), Builtins.sformat("%1 status", xend))) - end - if retval == 0 - @xend_is_running = true - Builtins.y2milestone("Xend is running") - else - @xend_is_running = false - Builtins.y2milestone("Xend is not running") - end - - true - end - - # Restarts the xend when the daemon was running when starting the configuration - def WriteXendService - all_ok = true - - if @xend_is_running - Builtins.y2milestone("Restarting xend daemon") - all_ok = Service.Restart("xend") - else - Builtins.y2milestone("Xend is not running - leaving...") - end - - all_ok - end - def GetLibVirtdPorts deep_copy(@libvirtd_ports) end @@ -237,6 +120,8 @@ nil end + FWD_LIBVIRTD_SERVICE = "libvirtd-relocation-server".freeze + def ReadLibvirtServices if !Package.Installed("libvirt-daemon") Builtins.y2milestone("libvirt is not installed") @@ -245,14 +130,14 @@ @libvirtd_enabled = Service.Enabled("libvirtd") @sshd_enabled = Service.Enabled("sshd") - if Service.Status("libvirtd") == 0 + if Service.active?("libvirtd") @libvirtd_is_running = true Builtins.y2milestone("libvirtd is running") else @libvirtd_is_running = false Builtins.y2milestone("libvirtd is not running") end - if Service.Status("sshd") == 0 + if Service.active?("sshd") @sshd_is_running = true Builtins.y2milestone("sshd is running") else @@ -260,9 +145,13 @@ Builtins.y2milestone("sshd is not running") end - ports = SuSEFirewallServices.GetNeededTCPPorts( - "service:libvirtd-relocation-server" - ) + begin + fwd_libvirt = firewalld.find_service(FWD_LIBVIRTD_SERVICE) + ports = fwd_libvirt.tcp_ports + rescue Y2Firewall::Firewalld::Service::NotFound + ports = [] + end + @libvirtd_ports = Builtins.filter(ports) do |s| s != @libvirtd_default_ports end @@ -291,10 +180,11 @@ ) end end - SuSEFirewallServices.SetNeededPortsAndProtocols( - "service:libvirtd-relocation-server", - { "tcp_ports" => @libvirtd_ports } - ) + begin + Y2Firewall::Firewalld::Service.modify_ports(name: FWD_LIBVIRTD_SERVICE, tcp_ports: @libvirtd_ports) + rescue Y2Firewall::Firewalld::Service::NotFound + y2error("Firewalld '#{FWD_LIBVIRTD_SERVICE}' service is not available.") + end end all_ok @@ -306,32 +196,11 @@ # RelocationServer read dialog caption caption = _("Initializing relocation-server Configuration") - xen_steps = 3 libvirt_steps = 2 sl = 500 Builtins.sleep(sl) - xen_stg = [ - # Progress stage 1/3 - _("Read the current xend configuration"), - # Progress stage 2/3 - _("Read the current xend state"), - # Progress stage 3/3 - _("Read firewall settings") - ] - - xen_tits = [ - # Progress step 1/3 - _("Reading the current xend configuration..."), - # Progress step 2/3 - _("Reading the current xend state..."), - # Progress step 3/3 - _("Reading firewall settings..."), - # Progress finished - Message.Finished - ] - libvirt_stg = [ # Progress stage 1/2 _("Read firewall settings"), @@ -348,47 +217,25 @@ Message.Finished ] - if is_xend() - Progress.New(caption, " ", xen_steps, xen_stg, xen_tits, "") - else - Progress.New(caption, " ", libvirt_steps, libvirt_stg, libvirt_tits, "") - end - - if is_xend() - return false if PollAbort() - Progress.NextStage - # Error message - Report.Error(Message.CannotReadCurrentSettings) if !ReadXendSettings() - Builtins.sleep(sl) - - return false if PollAbort() - Progress.NextStage - # Error message - if !ReadXendService() - Report.Error(_("Cannot read the current Xend state.")) - end - Builtins.sleep(sl) - end + Progress.New(caption, " ", libvirt_steps, libvirt_stg, libvirt_tits, "") return false if PollAbort() Progress.NextStage progress_state = Progress.set(false) # Error message - Report.Warning(_("Cannot read firewall settings.")) if !SuSEFirewall.Read + Report.Warning(_("Cannot read firewall settings.")) if !firewalld.read Progress.set(progress_state) Builtins.sleep(sl) - if Arch.is_kvm || !is_xend() - return false if PollAbort() - Progress.NextStage - # Error message - if !ReadLibvirtServices() - Report.Error(_("Cannot read the current libvirtd/sshd state.")) - Report.Error(Message.CannotContinueWithoutPackagesInstalled) - return false - end - Builtins.sleep(sl) + return false if PollAbort() + Progress.NextStage + # Error message + if !ReadLibvirtServices() + Report.Error(_("Cannot read the current libvirtd/sshd state.")) + Report.Error(Message.CannotContinueWithoutPackagesInstalled) + return false end + Builtins.sleep(sl) return false if PollAbort() # Progress finished @@ -406,31 +253,11 @@ # RelocationServer read dialog caption caption = _("Saving relocation-server Configuration") - xen_steps = 3 libvirt_steps = 2 sl = 500 Builtins.sleep(sl) - xen_stg = [ - # Progress stage 1 - _("Write the Xend settings"), - # Progress stage 2 - _("Adjust the Xend service"), - # Progress stage 3 - _("Write firewall settings") - ] - - xen_tits = [ - # Progress step 1 - _("Writing the Xend settings..."), - # Progress step 2 - _("Adjusting the Xend service..."), - # Progress step 3 - _("Writing firewall settings..."), - Message.Finished - ] - libvirt_stg = [ # Progress stage 1 _("Adjust the libvirtd/sshd service"), @@ -446,39 +273,19 @@ Message.Finished ] - if is_xend() - Progress.New(caption, " ", xen_steps, xen_stg, xen_tits, "") - else - Progress.New(caption, " ", libvirt_steps, libvirt_stg, libvirt_tits, "") - end - - if is_xend() - return false if PollAbort() - Progress.NextStage - # Error message - if !WriteXendSettings() - Report.Error(_("Cannot write the xend settings.")) - end - Builtins.sleep(sl) + Progress.New(caption, " ", libvirt_steps, libvirt_stg, libvirt_tits, "") - return false if PollAbort() - Progress.NextStage - # Error message - Report.Error(Message.CannotAdjustService("xend")) if !WriteXendService() - Builtins.sleep(sl) - else - return false if PollAbort() - Progress.NextStage - # Error message - Report.Error(Message.CannotAdjustService("xend")) if !WriteLibvirtServices() - Builtins.sleep(sl) - end + return false if PollAbort() + Progress.NextStage + # Error message + Report.Error(Message.CannotAdjustService("libvirt")) if !WriteLibvirtServices() + Builtins.sleep(sl) return false if PollAbort() Progress.NextStage progress_state = Progress.set(false) # Error message - Report.Error(_("Cannot write firewall settings.")) if !SuSEFirewall.Write + Report.Error(_("Cannot write firewall settings.")) if !firewalld.write Progress.set(progress_state) Builtins.sleep(sl) @@ -495,9 +302,6 @@ publish :function => :SetModified, :type => "void ()" publish :function => :Abort, :type => "boolean ()" publish :function => :PollAbort, :type => "boolean ()" - publish :function => :GetXendOption, :type => "string (string)" - publish :function => :GetDefaultXendOption, :type => "string (string)" - publish :function => :SetXendOption, :type => "void (string, string)" publish :function => :GetLibVirtdPorts, :type => "list <string> ()" publish :function => :SetLibvirtdPorts, :type => "void (list <string>)" publish :function => :GetLibvirtdOption, :type => "boolean (string)" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-vm-3.2.5/src/modules/VirtConfig.rb new/yast2-vm-4.0.1/src/modules/VirtConfig.rb --- old/yast2-vm-3.2.5/src/modules/VirtConfig.rb 2018-02-12 18:44:06.000000000 +0100 +++ new/yast2-vm-4.0.1/src/modules/VirtConfig.rb 2018-04-13 15:02:28.000000000 +0200 @@ -29,22 +29,17 @@ module Yast class VirtConfigClass < Module - include Yast::Logger def main Yast.import "UI" - textdomain "vm" - - Yast.import "Arch" Yast.import "OSRelease" Yast.import "Package" Yast.import "Progress" Yast.import "Popup" Yast.import "Report" - Yast.import "SuSEFirewall" Yast.import "Wizard" Yast.import "Label" Yast.import "Bootloader" @@ -54,42 +49,6 @@ @net_path = "/sys/class/net/" end - def ConfigureFirewall - Builtins.y2milestone("VirtConfig::ConfigureFirewall() started") - ret = true - - # check whether the firewall option exists - firewall_configured = false - if Builtins.contains( - SCR.Dir(path(".sysconfig.SuSEfirewall2")), - "FW_FORWARD_ALWAYS_INOUT_DEV" - ) - xen_bridge = "xenbr+" - # read the current value - forward = Convert.to_string( - SCR.Read(path(".sysconfig.SuSEfirewall2.FW_FORWARD_ALWAYS_INOUT_DEV")) - ) - Builtins.y2milestone("FW_FORWARD_ALWAYS_INOUT_DEV=%1", forward) - if Builtins.contains(Builtins.splitstring(forward, " "), xen_bridge) - Builtins.y2milestone("Firewall already configured!") - firewall_configured = true # xenbr+ already exists - end - end - - if firewall_configured == false - # add xenbr+ to the firewall configuration - Builtins.y2milestone("Configuring firewall to allow Xen bridge...") - progress_orig = Progress.set(false) - SuSEFirewall.Read - SuSEFirewall.AddXenSupport - ret = ret && SuSEFirewall.Write - Progress.set(progress_orig) - end - - Builtins.y2milestone("VirtConfig::ConfigureFirewall returned: %1", ret) - ret - end - def isOpenSuse Builtins.y2milestone("Checking to see if this is openSUSE ...") distro = OSRelease.ReleaseName @@ -360,25 +319,27 @@ log.info "VirtConfig::ConfigureDom0: Checking for Installed Patterns and Packages" if isOpenSuse - if isTumbleweed - UI.ChangeWidget(Id(:xen_server), :Enabled, !Package.Installed("patterns-server-xen_server")) - else - UI.ChangeWidget(Id(:xen_server), :Enabled, !Package.Installed("patterns-openSUSE-xen_server")) - end - # On openSUSE there are no 'tools' patterns for Xen and KVM - if Package.Installed("xen-tools") && Package.Installed("xen-libs") && - Package.Installed("libvirt-daemon-xen") && Package.Installed("tigervnc") && - Package.Installed("virt-manager") - UI.ChangeWidget(Id(:xen_tools), :Enabled, false) - end - if isTumbleweed - UI.ChangeWidget(Id(:kvm_server), :Enabled, !Package.Installed("patterns-server-kvm_server")) - else - UI.ChangeWidget(Id(:kvm_server), :Enabled, !Package.Installed("patterns-openSUSE-kvm_server")) - end - if Package.Installed("libvirt-daemon-qemu") || Package.Installed("tigervnc") || - Package.Installed("virt-manager") - UI.ChangeWidget(Id(:kvm_tools), :Enabled, false) + UI.ChangeWidget(Id(:xen_server), :Enabled, !Package.Installed("patterns-server-xen_server")) + if isTumbleweed + # On Tumbleweed there is not a 'tools' pattern for Xen. Check for a few minimal RPMs + if Package.Installed("xen-tools") && Package.Installed("xen-libs") && + Package.Installed("libvirt-daemon-xen") && Package.Installed("tigervnc") && + Package.Installed("virt-manager") + UI.ChangeWidget(Id(:xen_tools), :Enabled, false) + end + else + UI.ChangeWidget(Id(:kvm_server), :Enabled, !Package.Installed("patterns-server-xen_tools")) + end + + UI.ChangeWidget(Id(:kvm_server), :Enabled, !Package.Installed("patterns-server-kvm_server")) + if isTumbleweed + # On Tumbleweed there is not a 'tools' pattern for KVM. Check for a few minimal RPMs + if Package.Installed("libvirt-daemon-qemu") && Package.Installed("virt-manager") && + Package.Installed("tigervnc") + UI.ChangeWidget(Id(:kvm_tools), :Enabled, false) + end + else + UI.ChangeWidget(Id(:kvm_tools), :Enabled, !Package.Installed("patterns-server-kvm_tools")) end elsif isSLES UI.ChangeWidget(Id(:xen_server), :Enabled, !Package.Installed("patterns-server-xen_server")) @@ -446,18 +407,19 @@ common_vm_packages = ["libvirt-client", "vm-install", "virt-install"] end - if isTumbleweed == true - packages = ["patterns-server-xen_server"] if install_xen_server - else - packages = ["patterns-openSUSE-xen_server"] if install_xen_server - end - packages = packages + ["xen-tools", "xen-libs", "libvirt-daemon-xen", "libvirt-daemon-config-network", "tigervnc", "virt-manager"] if install_xen_tools - if isTumbleweed == true - packages = packages + ["patterns-server-kvm_server"] if install_kvm_server - else - packages = packages + ["patterns-openSUSE-kvm_server"] if install_kvm_server - end - packages = packages + ["libvirt-daemon-qemu", "libvirt-daemon-config-network", "tigervnc", "virt-manager"] if install_kvm_tools + packages = ["patterns-server-xen_server"] if install_xen_server + if isTumbleweed + packages = packages + ["xen-tools", "xen-libs", "libvirt-daemon-xen", "libvirt-daemon-config-network", "tigervnc", "virt-manager"] if install_xen_tools + else + packages = ["patterns-server-xen_tools"] if install_xen_tools + end + + packages = packages + ["patterns-server-kvm_server"] if install_kvm_server + if isTumbleweed + packages = packages + ["libvirt-daemon-qemu", "libvirt-daemon-config-network", "tigervnc", "virt-manager"] if install_kvm_tools + else + packages = ["patterns-server-kvm_tools"] if install_kvm_tools + end packages = packages + ["libvirt-daemon-lxc", "libvirt-daemon-config-network"] if install_lxc result = Package.DoInstall(common_vm_packages + packages) if result == false @@ -610,17 +572,6 @@ Builtins.y2milestone("Start virtlogd.socket: %1", cmd) SCR.Execute(path(".target.bash"), cmd) - # Firewall stage - modify the firewall setting, add the xen bridge to FW_FORWARD_ALWAYS_INOUT_DEV - # Progress::NextStage(); - - # Configure firewall to allow xenbr+ - # success = success && ConfigureFirewall(); - # if ( success == false ) { - # // error popup - # Report::Error(_("Failed to configure the firewall to allow the Xen bridge") + "\n" + abortmsg); - # return false; - # } - Progress.Finish message_kvm_ready = _( @@ -671,7 +622,6 @@ success end - publish :function => :ConfigureFirewall, :type => "boolean ()" publish :function => :isOpenSuse, :type => "boolean ()" publish :function => :isPAEKernel, :type => "boolean ()" publish :function => :isX86_64, :type => "boolean ()"
