Mailinglist Archive: yast-commit (396 mails)

< Previous Next >
[yast-commit] r65228 - in /branches/SuSE-Code-11-SP2-Branch/vm: ./ agents/ control/ package/ src/
Author: charlesa
Date: Fri Aug 5 00:40:45 2011
New Revision: 65228

URL: http://svn.opensuse.org/viewcvs/yast?rev=65228&view=rev
Log:
Cleanups for building and installing on sles11sp2.
bnc#702106 - Remove 32-bit "Install Hypervisor and Tools" from YaST Control
Center - FATE#308532
fate#311371 - Enhance yast to configure live migration for Xen and KVM

Added:
branches/SuSE-Code-11-SP2-Branch/vm/agents/
branches/SuSE-Code-11-SP2-Branch/vm/agents/Makefile.am
branches/SuSE-Code-11-SP2-Branch/vm/agents/xend.scr
branches/SuSE-Code-11-SP2-Branch/vm/control/
branches/SuSE-Code-11-SP2-Branch/vm/src/RelocationServer.ycp
branches/SuSE-Code-11-SP2-Branch/vm/src/complex.ycp
branches/SuSE-Code-11-SP2-Branch/vm/src/dialogs.ycp
branches/SuSE-Code-11-SP2-Branch/vm/src/helps.ycp
branches/SuSE-Code-11-SP2-Branch/vm/src/relocation-server.desktop
branches/SuSE-Code-11-SP2-Branch/vm/src/relocation-server.ycp
branches/SuSE-Code-11-SP2-Branch/vm/src/wizards.ycp
Modified:
branches/SuSE-Code-11-SP2-Branch/vm/VERSION
branches/SuSE-Code-11-SP2-Branch/vm/package/yast2-vm.changes
branches/SuSE-Code-11-SP2-Branch/vm/src/Makefile.am
branches/SuSE-Code-11-SP2-Branch/vm/src/VM_XEN.ycp
branches/SuSE-Code-11-SP2-Branch/vm/src/virtualization.desktop
branches/SuSE-Code-11-SP2-Branch/vm/src/xen.desktop
branches/SuSE-Code-11-SP2-Branch/vm/yast2-vm.spec.in

Modified: branches/SuSE-Code-11-SP2-Branch/vm/VERSION
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/vm/VERSION?rev=65228&r1=65227&r2=65228&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/vm/VERSION (original)
+++ branches/SuSE-Code-11-SP2-Branch/vm/VERSION Fri Aug 5 00:40:45 2011
@@ -1 +1 @@
-2.17.2
+2.21.1

Added: branches/SuSE-Code-11-SP2-Branch/vm/agents/Makefile.am
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/vm/agents/Makefile.am?rev=65228&view=auto
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/vm/agents/Makefile.am (added)
+++ branches/SuSE-Code-11-SP2-Branch/vm/agents/Makefile.am Fri Aug 5 00:40:45
2011
@@ -0,0 +1,7 @@
+# Makefile.am for vm/agents
+
+agent_SCRIPTS =
+
+scrconf_DATA = xend.scr
+
+EXTRA_DIST = $(agent_SCRIPTS) $(scrconf_DATA)

Added: branches/SuSE-Code-11-SP2-Branch/vm/agents/xend.scr
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/vm/agents/xend.scr?rev=65228&view=auto
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/vm/agents/xend.scr (added)
+++ branches/SuSE-Code-11-SP2-Branch/vm/agents/xend.scr Fri Aug 5 00:40:45 2011
@@ -0,0 +1,27 @@
+/**
+ * File:
+ * xend.scr
+ * Summary:
+ * SCR Agent for reading/writing /etc/xen/xend-config.sxp
+ * using the ini-agent
+ * Access:
+ * read/write
+ * Authors:
+ * Li Dongyang <lidongyang@xxxxxxxxxx>
+ */
+
+.etc.xen.xend-config
+
+`ag_ini (
+ `IniAgent ( "/etc/xen/xend-config.sxp",
+ $[
+ "options" : [ "global_values", "flat" ],
+ "comments" : [ "^[ \t]*#.*$", "^[ \t]*$" ],
+ "params" : [
+ $[ "match" : [ "\\(([^ ]+) +([^']*)\\)", "(%s %s)" ]],
+ $[ "match" : [ "\\(([^ ]+) +'?([^']*)'?\\)", "(%s '%s')" ]],
+ ],
+ ]
+ )
+)
+

Modified: branches/SuSE-Code-11-SP2-Branch/vm/package/yast2-vm.changes
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/vm/package/yast2-vm.changes?rev=65228&r1=65227&r2=65228&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/vm/package/yast2-vm.changes (original)
+++ branches/SuSE-Code-11-SP2-Branch/vm/package/yast2-vm.changes Fri Aug 5
00:40:45 2011
@@ -1,4 +1,24 @@
-------------------------------------------------------------------
+Thu Aug 4 16:26:54 MDT 2011 - carnold@xxxxxxxxxx
+
+- Cleanups for building and installing on sles11sp2.
+
+-------------------------------------------------------------------
+Wed Jun 29 13:55:52 CST 2011 - lidongyang@xxxxxxxxxx
+
+- bnc#702106 - Remove 32-bit "Install Hypervisor and Tools" from
+ YaST Control Center - FATE#308532
+ remove %ix86 from exclusive arch so that yast2-vm is available
+ only for the 64-bit x86 architecture.
+
+-------------------------------------------------------------------
+Mon Jun 13 14:14:40 CST 2011 - lidongyang@xxxxxxxxxx
+
+- fate#311371 - Enhance yast to configure live migration for Xen
+ and KVM
+ replace xen.ycp with relocation-server.ycp
+
+-------------------------------------------------------------------
Tue Mar 8 16:17:23 MST 2011 - carnold@xxxxxxxxxx

- bnc#508347 - Yast2 virtualization installation error but success

Modified: branches/SuSE-Code-11-SP2-Branch/vm/src/Makefile.am
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/vm/src/Makefile.am?rev=65228&r1=65227&r2=65228&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/vm/src/Makefile.am (original)
+++ branches/SuSE-Code-11-SP2-Branch/vm/src/Makefile.am Fri Aug 5 00:40:45 2011
@@ -2,21 +2,38 @@
# Makefile.am for vm/src
#

+yncludedir = @yncludedir@/relocation-server
+
groupdir = @desktopdir@/groups

client_DATA = \
xen.ycp \
- vm_finish.ycp
+ vm_finish.ycp \
+ relocation-server.ycp

group_DATA = \
virtualization.desktop

desktop_DATA = \
- xen.desktop
+ xen.desktop \
+ relocation-server.desktop

module_DATA = \
- VM_XEN.ycp
+ VM_XEN.ycp \
+ RelocationServer.ycp
+
+ynclude_DATA = \
+ helps.ycp \
+ wizards.ycp \
+ dialogs.ycp \
+ complex.ycp
+
+
+EXTRA_DIST = $(client_DATA) $(module_DATA) $(group_DATA) $(desktop_DATA)
$(ynclude_DATA)
+
+relocation-server:
+ test -l relocation-server || ln -s . relocation-server

-EXTRA_DIST = $(client_DATA) $(module_DATA) $(group_DATA) $(desktop_DATA)
+ycpchook = relocation-server

include $(top_srcdir)/Makefile.am.common

Added: branches/SuSE-Code-11-SP2-Branch/vm/src/RelocationServer.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/vm/src/RelocationServer.ycp?rev=65228&view=auto
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/vm/src/RelocationServer.ycp (added)
+++ branches/SuSE-Code-11-SP2-Branch/vm/src/RelocationServer.ycp Fri Aug 5
00:40:45 2011
@@ -0,0 +1,480 @@
+/*
------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it
under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may
find
+ * current contact information at www.novell.com.
+ *
------------------------------------------------------------------------------
+ */
+
+/**
+ * File: modules/RelocationServer.ycp
+ * Package: Configuration of relocation-server
+ * Summary: RelocationServer settings, input and output functions
+ * Authors: Li Dongyang <lidongyang@xxxxxxxxxx>
+ *
+ * $Id: RelocationServer.ycp 41350 2007-10-10 16:59:00Z dfiser $
+ *
+ * Representation of the configuration of relocation-server.
+ * Input and output routines.
+ */
+
+{
+
+module "RelocationServer";
+textdomain "relocation-server";
+
+import "Arch";
+import "SCR";
+import "Progress";
+import "Report";
+import "Popup";
+import "Summary";
+import "Message";
+import "Service";
+import "SuSEFirewall";
+import "SuSEFirewallServices";
+
+/**
+ * Data was modified?
+ */
+boolean modified = false;
+
+/**
+ * Returns whether the configuration has been modified.
+ */
+global boolean GetModified() {
+ return modified;
+}
+
+/**
+ * Sets that the configuration has been modified.
+ */
+global void SetModified() {
+ modified = true;
+}
+
+/**
+ Returns a confirmation popup dialog whether user wants to really abort.
+ */
+global boolean Abort() {
+ return Popup::ReallyAbort(GetModified());
+}
+
+/**
+ * Checks whether an Abort button has been pressed.
+ * If so, calls function to confirm the abort call.
+ *
+ * @return boolean true if abort confirmed
+ */
+global boolean PollAbort() {
+ if (UI::PollInput() == `abort)
+ return Abort();
+
+ return false;
+}
+
+/**
+* map of xend settings
+*/
+ map <string, string > SETTINGS = $[];
+
+ map <string, string > 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$",
+ ];
+
+/**
+ * Returns the Xend Option as a list of strings.
+ *
+ * @param string option_key of the xend configuration
+ * @return string with option_values
+ */
+global string GetXendOption (string option_key) {
+ return SETTINGS[option_key]:DEFAULT_CONFIG[option_key]:"";
+}
+
+/**
+ * Returns default Xend Option as a list of strings.
+ *
+ * @param string option_key of the Xend configuration
+ * @return string with option_values
+ */
+
+global string GetDefaultXendOption (string option_key) {
+ return DEFAULT_CONFIG[option_key]:"";
+}
+
+/**
+ * Sets values for an option.
+ *
+ * @param string option_key with the Xend configuration key
+ * @param string option_values with the Xend configuration values
+ */
+global void SetXendOption (string option_key, string option_vals) {
+ SETTINGS[option_key] = option_vals;
+}
+
+/**
+ * Reads current xend configuration
+ */
+boolean ReadXendSettings () {
+ foreach (string key, (list <string>) SCR::Dir(.etc.xen.xend-config), {
+ string val = (string) SCR::Read(add(.etc.xen.xend-config, key));
+ if (val != nil) SETTINGS[key] = val;
+ });
+
+ y2milestone("Xend configuration has been read: %1", SETTINGS);
+ return true;
+}
+
+/**
+ * Writes current xend configuration
+ */
+boolean WriteXendSettings () {
+ y2milestone("Writing Xend configuration: %1", SETTINGS);
+
+ foreach (string option_key, string option_val, SETTINGS, {
+ SCR::Write(add(.etc.xen.xend-config, option_key), option_val);
+ });
+ // This is very important
+ // it flushes the cache, and stores the configuration on the disk
+ SCR::Write(.etc.xen.xend-config, nil);
+
+ string port = GetXendOption("xend-relocation-port");
+ string ssl_port = GetXendOption("xend-relocation-ssl-port");
+ list <string> ports_list = [port, ssl_port];
+ SuSEFirewallServices::SetNeededPortsAndProtocols(
+ "service:xend-relocation-server",
+ $[ "tcp_ports" : ports_list,]
+ );
+
+ return true;
+}
+
+/**
+ * Describes whether the daemon is running
+ */
+boolean xend_is_running = false;
+
+/**
+ * Reads current xend status
+ */
+boolean ReadXendService () {
+ if (Service::Status("xend") == 0) {
+ xend_is_running = true;
+ y2milestone("Xend is running");
+ } else {
+ xend_is_running = false;
+ y2milestone("Xend is not running");
+ }
+
+ return true;
+}
+
+/**
+ * Restarts the xend when the daemon was running when starting the
configuration
+ */
+boolean WriteXendService () {
+ boolean all_ok = true;
+
+ if (xend_is_running) {
+ y2milestone("Restarting xend daemon");
+ all_ok = Service::Restart("xend");
+ } else {
+ y2milestone("Xend is not running - leaving...");
+ }
+
+ return all_ok;
+}
+
+string libvirtd_default_ports = "49152:49215";
+list <string> libvirtd_ports = [];
+
+global list <string> GetLibVirtdPorts() {
+ return libvirtd_ports;
+}
+
+global void SetLibvirtdPorts(list <string> ports) {
+ libvirtd_ports = ports;
+}
+
+boolean libvirtd_enabled = false;
+boolean sshd_enabled = false;
+boolean libvirtd_is_running = false;
+boolean sshd_is_running = false;
+
+map <string, boolean> LibvirtdOptions = $[
+ "tunneled_migration" : false,
+ "plain_migration" : false,
+ "default_port_range" : false,
+];
+
+global boolean GetLibvirtdOption(string key) {
+ return LibvirtdOptions[key]:false;
+}
+
+global void SetLibvirtdOption(string key, boolean val) {
+ LibvirtdOptions[key] = val;
+}
+
+boolean ReadKVMServices () {
+ libvirtd_enabled = Service::Enabled("libvirtd");
+ sshd_enabled = Service::Enabled("sshd");
+
+ if (Service::Status("libvirtd") == 0) {
+ libvirtd_is_running = true;
+ y2milestone("libvirtd is running");
+ } else {
+ libvirtd_is_running = false;
+ y2milestone("libvirtd is not running");
+ }
+ if (Service::Status("sshd") == 0) {
+ sshd_is_running = true;
+ y2milestone("sshd is running");
+ } else {
+ sshd_is_running = false;
+ y2milestone("sshd is not running");
+ }
+
+ list <string> ports =
SuSEFirewallServices::GetNeededTCPPorts("service:libvirtd-relocation-server");
+ libvirtd_ports = filter(string s, ports, {return (s !=
libvirtd_default_ports);});
+
+ return true;
+}
+
+boolean WriteKVMServices () {
+ boolean all_ok = true;
+
+ if (GetLibvirtdOption("tunneled_migration") ||
GetLibvirtdOption("plain_migration")) {
+ if (!libvirtd_is_running)
+ all_ok = Service::Start("libvirtd") && all_ok;
+ if (!libvirtd_enabled)
+ all_ok = Service::Enable("libvirtd") && all_ok;
+ }
+ if (GetLibvirtdOption("tunneled_migration")) {
+ if (!sshd_is_running)
+ all_ok = Service::Start("sshd") && all_ok;
+ if (!sshd_enabled)
+ all_ok = Service::Enable("sshd") && all_ok;
+ }
+ if (GetLibvirtdOption("plain_migration")) {
+ if (GetLibvirtdOption("default_port_range"))
+ if (!contains(libvirtd_ports, libvirtd_default_ports))
+ libvirtd_ports = add(libvirtd_ports, libvirtd_default_ports);
+ SuSEFirewallServices::SetNeededPortsAndProtocols(
+ "service:libvirtd-relocation-server",
+ $[ "tcp_ports" : libvirtd_ports,]
+ );
+ }
+
+ return all_ok;
+}
+
+/**
+ * Read all relocation-server settings
+ * @return true on success
+ */
+global boolean Read() {
+
+ /* RelocationServer read dialog caption */
+ string caption = _("Initializing relocation-server Configuration");
+
+ integer xen_steps = 3;
+ integer kvm_steps = 2;
+
+ integer sl = 500;
+ sleep(sl);
+
+ list<string> 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")
+ ];
+
+ list<string> 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()
+ ];
+
+ list<string> kvm_stg = [
+ /* Progress stage 1/2 */
+ _("Read firewall settings"),
+ /* Progress stage 2/2 */
+ _("Read the current libvirtd/sshd state")
+ ];
+
+ list<string> kvm_tits = [
+ /* Progress step 1/2 */
+ _("Reading firewall settings..."),
+ /* Progress stage 2/2 */
+ _("Reading the current libvirtd/sshd state..."),
+ /* Progress finished */
+ Message::Finished()
+ ];
+
+ if (Arch::is_xen0())
+ Progress::New( caption, " ", xen_steps, xen_stg, xen_tits,"");
+ else
+ Progress::New( caption, " ", kvm_steps, kvm_stg, kvm_tits,"");
+
+ if (Arch::is_xen0()) {
+ if(PollAbort()) return false;
+ Progress::NextStage();
+ /* Error message */
+ if(!ReadXendSettings())
Report::Error(Message::CannotReadCurrentSettings());
+ sleep(sl);
+
+ if(PollAbort()) return false;
+ Progress::NextStage();
+ /* Error message */
+ if(!ReadXendService()) Report::Error(_("Cannot read the current Xend
state."));
+ sleep(sl);
+ }
+
+ if(PollAbort()) return false;
+ Progress::NextStage();
+ boolean progress_state = Progress::set (false);
+ /* Error message */
+ if(!SuSEFirewall::Read()) Report::Warning(_("Cannot read firewall
settings."));
+ Progress::set (progress_state);
+ sleep(sl);
+
+ if (Arch::is_kvm()) {
+ if(PollAbort()) return false;
+ Progress::NextStage();
+ /* Error message */
+ if(!ReadKVMServices()) Report::Error(_("Cannot read the current
libvirtd/sshd state."));
+ sleep(sl);
+ }
+
+ if(PollAbort()) return false;
+ /* Progress finished */
+ Progress::NextStage();
+ sleep(sl);
+
+ if(PollAbort()) return false;
+ modified = false;
+ return true;
+}
+
+/**
+ * Write all relocation-server settings
+ * @return true on success
+ */
+global boolean Write() {
+
+ /* RelocationServer read dialog caption */
+ string caption = _("Saving relocation-server Configuration");
+
+ integer xen_steps = 3;
+ integer kvm_steps = 2;
+
+ integer sl = 500;
+ sleep(sl);
+
+ list<string> xen_stg = [
+ /* Progress stage 1 */
+ _("Write the Xend settings"),
+ /* Progress stage 2 */
+ _("Adjust the Xend service"),
+ /* Progress stage 3 */
+ _("Write firewall settings")
+ ];
+
+ list<string> xen_tits = [
+ /* Progress step 1 */
+ _("Writing the Xend settings..."),
+ /* Progress step 2 */
+ _("Adjusting the Xend service..."),
+ /* Progress step 3 */
+ _("Writing firewall settings..."),
+ Message::Finished()
+ ];
+
+ list<string> kvm_stg = [
+ /* Progress stage 1 */
+ _("Adjust the libvirtd/sshd service"),
+ /* Progress stage 2 */
+ _("Write firewall settings")
+ ];
+
+ list<string> kvm_tits = [
+ /* Progress step 1 */
+ _("Adjusting the libvirtd/sshd service"),
+ /* Progress stage 2 */
+ _("Writing firewall settings..."),
+ Message::Finished()
+ ];
+
+ if (Arch::is_xen0())
+ Progress::New(caption, " ", xen_steps, xen_stg, xen_tits ,"");
+ else
+ Progress::New(caption, " ", kvm_steps, kvm_stg, kvm_tits ,"");
+
+ if (Arch::is_xen0()) {
+ if(PollAbort()) return false;
+ Progress::NextStage();
+ /* Error message */
+ if(!WriteXendSettings()) Report::Error (_("Cannot write the xend
settings."));
+ sleep(sl);
+
+ if(PollAbort()) return false;
+ Progress::NextStage();
+ /* Error message */
+ if(!WriteXendService()) Report::Error
(Message::CannotAdjustService("xend"));
+ sleep(sl);
+ } else {
+ if(PollAbort()) return false;
+ Progress::NextStage();
+ /* Error message */
+ if(!WriteKVMServices()) Report::Error
(Message::CannotAdjustService("xend"));
+ sleep(sl);
+ }
+
+ if(PollAbort()) return false;
+ Progress::NextStage ();
+ boolean progress_state = Progress::set (false);
+ /* Error message */
+ if(!SuSEFirewall::Write()) Report::Error (_("Cannot write firewall
settings."));
+ Progress::set (progress_state);
+ sleep(sl);
+
+ if(PollAbort()) return false;
+ /* Progress finished */
+ Progress::NextStage();
+ sleep(sl);
+
+ if(PollAbort()) return false;
+ return true;
+}
+
+/* EOF */
+}

Modified: branches/SuSE-Code-11-SP2-Branch/vm/src/VM_XEN.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/vm/src/VM_XEN.ycp?rev=65228&r1=65227&r2=65228&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/vm/src/VM_XEN.ycp (original)
+++ branches/SuSE-Code-11-SP2-Branch/vm/src/VM_XEN.ycp Fri Aug 5 00:40:45 2011
@@ -253,7 +253,6 @@

// Check for the existance of /sys/class/net/*/bridge
list<string> interfaces = (list<string>)SCR::Read(.target.dir,
net_path);
- // foreach (map<string,any> i, interfaces, ``{
foreach (string i, interfaces, ``{
y2milestone("Checking for bridges...");
bridge_path = net_path + "/" + i + "/bridge";

Added: branches/SuSE-Code-11-SP2-Branch/vm/src/complex.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/vm/src/complex.ycp?rev=65228&view=auto
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/vm/src/complex.ycp (added)
+++ branches/SuSE-Code-11-SP2-Branch/vm/src/complex.ycp Fri Aug 5 00:40:45 2011
@@ -0,0 +1,318 @@
+/*
------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it
under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may
find
+ * current contact information at www.novell.com.
+ *
------------------------------------------------------------------------------
+ */
+
+/**
+ * File: include/relocation-server/complex.ycp
+ * Package: Configuration of relocation-server
+ * Summary: Dialogs definitions
+ * Authors: Li Dongyang <lidongyang@xxxxxxxxxx>
+ *
+ * $Id: complex.ycp 41350 2007-10-10 16:59:00Z dfiser $
+ */
+
+{
+
+textdomain "relocation-server";
+
+import "Label";
+import "Popup";
+import "Wizard";
+import "Wizard_hw";
+import "Confirm";
+import "CWMFirewallInterfaces";
+import "RelocationServer";
+
+
+include "relocation-server/helps.ycp";
+
+boolean ReallyExit () {
+ // yes-no popup
+ return Popup::YesNo (_("Really exit?
+All changes will be lost."));
+}
+
+/**
+ * Read settings dialog
+ * @return `abort if aborted and `next otherwise
+ */
+symbol ReadDialog() {
+ Wizard::RestoreHelp(HELPS["read"]:"");
+ Wizard::SetTitleIcon("yast-vm-install");
+ // RelocationServer::SetAbortFunction(PollAbort);
+ if (!Confirm::MustBeRoot()) return `abort;
+ boolean ret = RelocationServer::Read();
+ return ret ? `next : `abort;
+}
+
+/**
+ * Write settings dialog
+ * @return `abort if aborted and `next otherwise
+ */
+symbol WriteDialog() {
+ Wizard::RestoreHelp(HELPS["write"]:"");
+ Wizard::SetTitleIcon("yast-vm-install");
+ // RelocationServer::SetAbortFunction(PollAbort);
+ boolean ret = RelocationServer::Write();
+ return ret ? `next : `abort;
+}
+
+void InitGlobalState() {
+ boolean server_stat = (boolean)
UI::QueryWidget(`id("xend-relocation-server"), `Value);
+ boolean ssl_server_stat = (boolean)
UI::QueryWidget(`id("xend-relocation-ssl-server"), `Value);
+ boolean 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 ();
+ stat = server_stat && ssl_server_stat;
+ UI::ChangeWidget (`id("xend-relocation-ssl"), `Enabled, stat);
+}
+
+void InitServerState() {
+ boolean stat = (boolean) UI::QueryWidget(`id("xend-relocation-server"),
`Value);
+ UI::ChangeWidget (`id("xend-relocation-port"), `Enabled, stat);
+ InitGlobalState();
+}
+
+void InitSSLServerState() {
+ boolean stat = (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();
+}
+
+void InitXendConfigurationDialog (string id) {
+ foreach (string key, ["xend-relocation-server",
+ "xend-relocation-ssl-server",
+ "xend-relocation-ssl"], {
+ UI::ChangeWidget(`id(key), `Value, (RelocationServer::GetXendOption(key)
== "yes"));
+ });
+
+ foreach (string key, ["xend-relocation-server-ssl-key-file",
+ "xend-relocation-server-ssl-cert-file",
+ "xend-relocation-address",
+ "xend-relocation-hosts-allow"], {
+ UI::ChangeWidget(`id(key), `Value, RelocationServer::GetXendOption(key));
+ });
+
+ foreach (string key, ["xend-relocation-port", "xend-relocation-ssl-port"],
{
+ UI::ChangeWidget(`id(key), `Value,
tointeger(RelocationServer::GetXendOption(key)));
+ });
+
+ InitServerState();
+ InitSSLServerState();
+}
+
+symbol HandleXendConfigurationDialog (string id, map event) {
+ any action = event["ID"]:nil;
+
+ if (action == "browse_ssl_key_file") {
+ string 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);
+ }
+ } else if (action == "browse_ssl_cert_file") {
+ string 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);
+ }
+ } else if (action == "xend-relocation-server") {
+ InitServerState();
+ } else if (action == "xend-relocation-ssl-server") {
+ InitSSLServerState();
+ }
+ return nil;
+}
+
+void StoreXendConfigurationDialog (string id, map event) {
+ RelocationServer::SetModified();
+
+ foreach (string key, ["xend-relocation-server",
+ "xend-relocation-ssl-server",
+ "xend-relocation-ssl"], {
+ string value = ((boolean)UI::QueryWidget(`id(key), `Value) == true) ?
"yes":"no";
+ if (value != RelocationServer::GetXendOption(key))
+ RelocationServer::SetXendOption(key, value);
+ });
+
+ foreach (string key, ["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"], {
+ string value = tostring(UI::QueryWidget(`id(key), `Value));
+ if (value != RelocationServer::GetXendOption(key))
+ RelocationServer::SetXendOption(key,
tostring(UI::QueryWidget(`id(key), `Value)));
+ });
+}
+
+void InitKVMFireWall() {
+ boolean tunneled_migration = (boolean)
UI::QueryWidget(`id("tunneled_migration"), `Value);
+ boolean plain_migration = (boolean)
UI::QueryWidget(`id("plain_migration"), `Value);
+ if (tunneled_migration || plain_migration)
+ CWMFirewallInterfaces::EnableOpenFirewallWidget ();
+ else
+ CWMFirewallInterfaces::DisableOpenFirewallWidget ();
+}
+
+void InitLibvirtdPortsTable () {
+ list <string> ports = RelocationServer::GetLibVirtdPorts();
+ boolean stat = (boolean) UI::QueryWidget(`id("plain_migration"), `Value);
+
+ if (ports != nil && ports != []) {
+ list <term> items = [];
+ foreach (string port, ports, {
+ items = add (items, `item(`id(port), port));
+ });
+
+ // Redraw table of ports and enable modification buttons
+ UI::ChangeWidget(`id("Port"), `Items, items);
+ UI::ChangeWidget(`id("edit_port"), `Enabled, true && stat);
+ UI::ChangeWidget(`id("delete_port"), `Enabled, true && stat);
+ } else {
+ // Redraw table of ports and disable modification buttons
+ UI::ChangeWidget(`id("Port"), `Items, []);
+ UI::ChangeWidget(`id("edit_port"), `Enabled, false);
+ UI::ChangeWidget(`id("delete_port"), `Enabled, false);
+ }
+
+ UI::ChangeWidget (`id("Port"), `Enabled, stat);
+ UI::ChangeWidget (`id("add_port"), `Enabled, stat);
+ UI::ChangeWidget (`id("default_port_range"), `Enabled, stat);
+}
+
+void InitKVMConfigurationDialog (string id) {
+ UI::ChangeWidget (`id("tunneled_migration"), `Value, false);
+ UI::ChangeWidget (`id("plain_migration"), `Value, false);
+ UI::ChangeWidget (`id("default_port_range"), `Value, true);
+ InitLibvirtdPortsTable();
+ InitKVMFireWall();
+}
+
+void DeletePort (string port) {
+ list <string> ports = RelocationServer::GetLibVirtdPorts();
+ ports = filter(string s, ports, {return (s != port);});
+ RelocationServer::SetLibvirtdPorts(ports);
+}
+
+void AddEditPortDialog (string current_port) {
+ UI::OpenDialog(`opt(`decorated), `VBox(
+ `MinWidth (30,
+ `HBox(
+ `HSpacing(1),
+ `Frame(
+ (current_port == nil ?
+ /* A popup dialog caption */
+ _("Add New Port")
+ :
+ /* A popup dialog caption */
+ _("Edit Current Port")),
+ /* A text entry */
+ `TextEntry(`id("port_number"), _("&Port"), (current_port == nil ?
"":current_port))
+ ),
+ `HSpacing(1)
+ )
+ ),
+ `VSpacing(1),
+ `HBox(
+ `PushButton(`id(`ok), Label::OKButton()),
+ `HSpacing(1),
+ `PushButton(`id(`cancel), Label::CancelButton())
+ )
+ ));
+
+ UI::ChangeWidget( `id("port_number"), `ValidChars, "0123456789");
+
+ any ret = nil;
+ while (true) {
+ ret = UI::UserInput();
+ if (ret == `ok) {
+ string new_port = (string) UI::QueryWidget(`id("port_number"), `Value);
+
+ if (new_port == "") {
+ UI::SetFocus(`id("port_number"));
+ Report::Error(_("Port number must not be empty."));
+ continue;
+ }
+
+ if (tointeger(new_port) > 65535 || tointeger(new_port) < 1) {
+ UI::SetFocus(`id("port_number"));
+ Report::Error(_("Port number out of range."));
+ continue;
+ }
+
+ list <string> ports = RelocationServer::GetLibVirtdPorts();
+ if (contains(ports, new_port)) {
+ UI::SetFocus(`id("port_number"));
+ Report::Error(_("Port number already exists."));
+ continue;
+ }
+ ports = add(ports, new_port);
+ RelocationServer::SetLibvirtdPorts(ports);
+
+ if (current_port != nil) DeletePort(current_port);
+ }
+
+ break;
+ }
+
+ UI::CloseDialog();
+}
+
+symbol HandleKVMConfigurationDialog (string id, map event) {
+ any action = event["ID"]:nil;
+ string selected_port = (string) UI::QueryWidget (`id("Port"),
`CurrentItem);
+
+ // Adding a new port
+ if (action == "add_port") {
+ AddEditPortDialog(nil);
+ // Editing current port
+ } else if (action == "edit_port") {
+ AddEditPortDialog(selected_port);
+ // Deleting current port
+ } else if (action == "delete_port") {
+ if (Confirm::DeleteSelected()) DeletePort (selected_port);
+ } else if (action == "tunneled_migration" || action == "plain_migration")
+ InitKVMFireWall();
+
+
+ InitLibvirtdPortsTable();
+ return nil;
+}
+
+void StoreKVMConfigurationDialog (string id, map event) {
+ RelocationServer::SetModified();
+
+ foreach (string key, ["tunneled_migration",
+ "plain_migration",
+ "default_port_range"], {
+ boolean value = (boolean)UI::QueryWidget(`id(key), `Value);
+ RelocationServer::SetLibvirtdOption(key, value);
+ });
+}
+
+/* EOF */
+}

Added: branches/SuSE-Code-11-SP2-Branch/vm/src/dialogs.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/vm/src/dialogs.ycp?rev=65228&view=auto
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/vm/src/dialogs.ycp (added)
+++ branches/SuSE-Code-11-SP2-Branch/vm/src/dialogs.ycp Fri Aug 5 00:40:45 2011
@@ -0,0 +1,130 @@
+/*
------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it
under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may
find
+ * current contact information at www.novell.com.
+ *
------------------------------------------------------------------------------
+ */
+
+/**
+ * File: include/relocation-server/dialogs.ycp
+ * Package: Configuration of relocation-server
+ * Summary: Dialogs definitions
+ * Authors: Li Dongyang <lidongyang@xxxxxxxxxx>
+ *
+ * $Id: dialogs.ycp 27914 2006-02-13 14:32:08Z locilka $
+ */
+
+{
+
+textdomain "relocation-server";
+
+import "Label";
+import "Wizard";
+import "RelocationServer";
+
+include "relocation-server/helps.ycp";
+
+term XendConfigurationDialogContent () {
+ return `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()
+ )
+ )
+ );
+}
+
+term KVMConfigurationDialogContent () {
+ return `VBox(
+ `Frame(_("Tunneled migration"),
+ `VBox(
+ `Left(`CheckBox(`id("tunneled_migration"),`opt(`notify),
_("Make sure tunneled migration works")))
+ )
+ ),
+ `Frame(_("Plain migration"),
+ `VBox(
+ `Left(`CheckBox(`id("plain_migration"), `opt(`notify), _("Make
sure plain migration works"))),
+ `VSpacing(),
+ `Left(`Label(_("TCP Ports"))),
+ `Left(
+ `MinSize( 40, 5,
+ /* A table header */
+ `Table(`id("Port"), `header(_("Port")), [])
+ )),
+ `Left (`HBox (
+ /* a push button */
+ `PushButton(`id("add_port"), _("&Add...")),
+ /* a push button */
+ `PushButton(`id("edit_port"), _("&Edit...")),
+ /* a push button */
+ `PushButton(`id("delete_port"), _("&Delete"))
+ )),
+ `Left(`CheckBox(`id("default_port_range"), `opt(`notify),
_("Include default port range")))
+ )
+ ),
+ `Frame(_("Firewall"),
+ `VBox(
+ "fw-kvm"
+ )
+ )
+ );
+}
+/* EOF */
+}

Added: branches/SuSE-Code-11-SP2-Branch/vm/src/helps.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/vm/src/helps.ycp?rev=65228&view=auto
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/vm/src/helps.ycp (added)
+++ branches/SuSE-Code-11-SP2-Branch/vm/src/helps.ycp Fri Aug 5 00:40:45 2011
@@ -0,0 +1,75 @@
+/*
------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it
under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may
find
+ * current contact information at www.novell.com.
+ *
------------------------------------------------------------------------------
+ */
+
+/**
+ * File: include/relocation-server/helps.ycp
+ * Package: Configuration of relocation-server
+ * Summary: Help texts of all the dialogs
+ * Authors: Li Dongyang <lidongyang@xxxxxxxxxx>
+ *
+ * $Id: helps.ycp 27914 2006-02-13 14:32:08Z locilka $
+ */
+
+{
+
+textdomain "relocation-server";
+
+/**
+ * All helps are here
+ */
+map HELPS = $[
+
+ /* Read dialog help 1/2 */
+ "read" : _("<p><b><big>Initializing relocation-server
Configuration</big></b><br>
+Please wait...<br></p>
+") +
+
+ /* Read dialog help 2/2 */
+ _("<p><b><big>Aborting Initialization:</big></b><br>
+Safely abort the configuration utility by pressing <b>Abort</b> now.</p>
+"),
+
+ /* Write dialog help 1/2 */
+ "write" : _("<p><b><big>Saving relocation-server
Configuration</big></b><br>
+Please wait...<br></p>
+") +
+
+ /* Write dialog help 2/2 */
+_("<p><b><big>Aborting Saving:</big></b><br>
+Abort the save procedure by pressing <b>Abort</b>.
+An additional dialog informs whether it is safe to do so.
+</p>
+"),
+
+ "xend_configuration" : _("<p><b>Relocation Address</b><br>
+Address xend should listen on for relocation-socket connections</p>
+<p><b>Allowed Hosts</b><br>
+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>
+<p><b>SSL Key File/SSL Cert File</b><br>
+SSL key and certificate to use for the ssl relocation interface</p>"),
+
+ "kvm_configuration" : _("<p><b><big>Tunneled migration</big></b><br>
+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>
+<p><b><big>Plain migration</big></b><br>
+The source host VM opens a direct unencryptyed TCP connection to the
destination host for sending the migration data. Unless a port is manually
specified, libvirt will choose a migration port in the default range.</p>"),
+];
+
+/* EOF */
+}

Added: branches/SuSE-Code-11-SP2-Branch/vm/src/relocation-server.desktop
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/vm/src/relocation-server.desktop?rev=65228&view=auto
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/vm/src/relocation-server.desktop (added)
+++ branches/SuSE-Code-11-SP2-Branch/vm/src/relocation-server.desktop Fri Aug
5 00:40:45 2011
@@ -0,0 +1,24 @@
+[Desktop Entry]
+Type=Application
+Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-Virtualization;
+
+X-KDE-ModuleType=Library
+X-KDE-RootOnly=true
+X-KDE-HasReadOnlyMode=true
+X-KDE-Library=yast2
+X-SuSE-YaST-Call=relocation-server
+
+X-SuSE-YaST-Group=Virtualization
+X-SuSE-YaST-Argument=
+X-SuSE-YaST-RootOnly=true
+X-SuSE-YaST-AutoInst=
+X-SuSE-YaST-Geometry=
+X-SuSE-YaST-SortKey=
+X-SuSE-YaST-AutoInstResource=
+
+Icon=yast-vm-install
+Exec=/usr/bin/xdg-su -c "/sbin/yast2 relocation-server"
+
+Name=Relocation Server Configuration
+GenericName=relocation-server
+StartupNotify=true

Added: branches/SuSE-Code-11-SP2-Branch/vm/src/relocation-server.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/vm/src/relocation-server.ycp?rev=65228&view=auto
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/vm/src/relocation-server.ycp (added)
+++ branches/SuSE-Code-11-SP2-Branch/vm/src/relocation-server.ycp Fri Aug 5
00:40:45 2011
@@ -0,0 +1,101 @@
+/*
------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it
under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may
find
+ * current contact information at www.novell.com.
+ *
------------------------------------------------------------------------------
+ */
+
+/**
+ * File: clients/relocation-server.ycp
+ * Package: Configuration of relocation-server
+ * Summary: Main file
+ * Authors: Li Dongyang <lidongyang@xxxxxxxxxx>
+ *
+ * $Id: relocation-server.ycp 27914 2006-02-13 14:32:08Z locilka $
+ *
+ * Main file for relocation-server configuration. Uses all other files.
+ */
+
+{
+
+/***
+ * <h3>Configuration of relocation-server</h3>
+ */
+
+textdomain "relocation-server";
+
+/* The main () */
+y2milestone ("----------------------------------------");
+y2milestone ("RelocationServer module started");
+
+import "Progress";
+import "Report";
+import "Summary";
+import "VM_XEN";
+import "Arch";
+
+import "CommandLine";
+include "relocation-server/wizards.ycp";
+
+// check whether VM can be started
+boolean CheckConfiguration() {
+
+ boolean ret = true;
+
+ // check whether VM can be started (cannot start a vm using UML)
+ if ( VM_XEN::isUML() ) return false;
+
+ y2milestone("Checking for Xen installation");
+
+ // check the dom0 configuration...
+ ret = ret && VM_XEN::ConfigureDom0();
+ if (ret == false) return false;
+
+ y2milestone("CheckConfiguration returned: %1", ret);
+ return ret;
+}
+
+
+map cmdline_description = $[
+ "id" : "relocation-server",
+ /* Command line help text for the relocation-server module */
+ "help" : _("Configuration of relocation-server"),
+ "guihandler" : RelocationServerSequence,
+ "initialize" : RelocationServer::Read,
+ "finish" : RelocationServer::Write,
+];
+
+if ( !Arch::is_kvm() && !Arch::is_xen0() ) {
+ y2milestone("No hypervisor found, offer to install one");
+ cmdline_description["guihandler"] = CheckConfiguration;
+ remove(cmdline_description, "initialize");
+ remove(cmdline_description, "finish");
+}
+
+/* main ui function */
+any ret = nil;
+
+ret = CommandLine::Run(cmdline_description);
+y2debug("ret=%1", ret);
+
+/* Finish */
+y2milestone("RelocationServer module finished");
+y2milestone("----------------------------------------");
+
+return ret;
+
+/* EOF */
+}

Modified: branches/SuSE-Code-11-SP2-Branch/vm/src/virtualization.desktop
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/vm/src/virtualization.desktop?rev=65228&r1=65227&r2=65228&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/vm/src/virtualization.desktop (original)
+++ branches/SuSE-Code-11-SP2-Branch/vm/src/virtualization.desktop Fri Aug 5
00:40:45 2011
@@ -1,5 +1,4 @@
[Desktop Entry]
-X-SuSE-DocTeamID=ycc_virtualization
Type=Application
Categories=Settings;System;Qt;X-SuSE-YaST-Virtualization;


Added: branches/SuSE-Code-11-SP2-Branch/vm/src/wizards.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/vm/src/wizards.ycp?rev=65228&view=auto
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/vm/src/wizards.ycp (added)
+++ branches/SuSE-Code-11-SP2-Branch/vm/src/wizards.ycp Fri Aug 5 00:40:45 2011
@@ -0,0 +1,171 @@
+/*
------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it
under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may
find
+ * current contact information at www.novell.com.
+ *
------------------------------------------------------------------------------
+ */
+
+/**
+ * File: include/relocation-server/wizards.ycp
+ * Package: Configuration of relocation-server
+ * Summary: Wizards definitions
+ * Authors: Li Dongyang <lidongyang@xxxxxxxxxx>
+ *
+ * $Id: wizards.ycp 27914 2006-02-13 14:32:08Z locilka $
+ */
+
+{
+
+textdomain "relocation-server";
+
+import "Arch";
+import "Sequencer";
+import "Wizard";
+import "CWM";
+import "CWMTab";
+import "CWMServiceStart";
+import "CWMFirewallInterfaces";
+
+include "relocation-server/complex.ycp";
+include "relocation-server/dialogs.ycp";
+
+/**
+ * Main workflow of the relocation-server configuration
+ * @return sequence result
+ */
+any MainSequence() {
+
+ map <string, map <string, any> > widgets = $[
+ "fw-xend" : CWMFirewallInterfaces::CreateOpenFirewallWidget ($[
+ "services" : [ "service:xend-relocation-server" ],
+ "display_details" : true,
+ ]),
+ "xend" : $[
+ "widget" : `custom,
+ "help" : HELPS["xend_configuration"]:"",
+ "custom_widget" : XendConfigurationDialogContent(),
+ "handle" : HandleXendConfigurationDialog,
+ "init" : InitXendConfigurationDialog,
+ "store" : StoreXendConfigurationDialog,
+ ],
+ "kvm" : $[
+ "widget" : `custom,
+ "help" : HELPS["kvm_configuration"]:"",
+ "custom_widget" : KVMConfigurationDialogContent(),
+ "handle" : HandleKVMConfigurationDialog,
+ "init" : InitKVMConfigurationDialog,
+ "store" : StoreKVMConfigurationDialog,
+ ],
+ "fw-kvm" : CWMFirewallInterfaces::CreateOpenFirewallWidget ($[
+ "services" : [ "service:libvirtd-relocation-server",
"service:sshd" ],
+ "display_details" : true,
+ ]),
+ ];
+
+ map <string, any> tabs = $[
+ "xend_configuration" : $[
+ "header" : _("&Xend"),
+ "widget_names" : ["xend", "fw-xend"],
+ "contents" : XendConfigurationDialogContent(),
+ ],
+ "kvm_configuration" : $[
+ "header" : _("&KVM"),
+ "widget_names" : ["kvm", "fw-kvm",],
+ "contents" : KVMConfigurationDialogContent(),
+ ],
+ ];
+
+ if ( !Arch::is_xen0() )
+ remove(tabs, "xend_configuration");
+ else
+ remove(tabs, "kvm_configuration");
+
+ map <string, any> wd_arg = $[
+ "tab_order" : ["xend_configuration"],
+ "tabs" : tabs,
+ "widget_descr" : widgets,
+ "initial_tab" : "xend_configuration",
+ ];
+
+ if ( !Arch::is_xen0() ) {
+ wd_arg["tab_order"] = ["kvm_configuration"];
+ wd_arg["initial_tab"] = "kvm_configuration";
+ }
+
+ map <string, any> wd = $[
+ "tab" : CWMTab::CreateWidget (wd_arg),
+ ];
+
+ term contents = `VBox("tab");
+
+ list <map <string, any> > w = CWM::CreateWidgets (["tab"], (map <string,
map <string, any> >) wd);
+
+ string caption = _("Relocation Server Configuration");
+ contents = CWM::PrepareDialog (contents, w);
+
+ Wizard::SetContentsButtons (
+ caption,
+ contents,
+ "",
+ Label::BackButton (),
+ Label::OKButton()
+ );
+ Wizard::HideBackButton ();
+ Wizard::SetAbortButton(`abort, Label::CancelButton());
+ Wizard::SetTitleIcon("yast-vm-install");
+
+ return CWM::Run (w, $[`abort : ReallyExit]);
+}
+
+/**
+ * Whole configuration of relocation-server
+ * @return sequence result
+ */
+any RelocationServerSequence() {
+
+ map aliases = $[
+ "read" : [ ``( ReadDialog() ), true ],
+ "main" : ``( MainSequence() ),
+ "write" : [ ``( WriteDialog() ), true ]
+ ];
+
+ map sequence = $[
+ "ws_start" : "read",
+ "read" : $[
+ `abort : `abort,
+ `next : "main"
+ ],
+ "main" : $[
+ `abort : `abort,
+ `next : "write"
+ ],
+ "write" : $[
+ `abort : `abort,
+ `next : `next
+ ]
+ ];
+
+ Wizard::CreateDialog();
+ Wizard::SetTitleIcon("yast-vm-install");
+
+ any ret = Sequencer::Run(aliases, sequence);
+
+ UI::CloseDialog();
+ return ret;
+}
+
+/* EOF */
+}

Modified: branches/SuSE-Code-11-SP2-Branch/vm/src/xen.desktop
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/vm/src/xen.desktop?rev=65228&r1=65227&r2=65228&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/vm/src/xen.desktop (original)
+++ branches/SuSE-Code-11-SP2-Branch/vm/src/xen.desktop Fri Aug 5 00:40:45 2011
@@ -1,5 +1,4 @@
[Desktop Entry]
-X-SuSE-DocTeamID=ycc_xen
Type=Application
Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-Virtualization;


Modified: branches/SuSE-Code-11-SP2-Branch/vm/yast2-vm.spec.in
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/vm/yast2-vm.spec.in?rev=65228&r1=65227&r2=65228&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/vm/yast2-vm.spec.in (original)
+++ branches/SuSE-Code-11-SP2-Branch/vm/yast2-vm.spec.in Fri Aug 5 00:40:45
2011
@@ -9,21 +9,34 @@
Summary: Configure Hypervisor and Tools for Xen and KVM

%description
--
+This YaST module configures and installs a virtual machine.

@PREP@

@BUILD@

@INSTALL@
+%ifarch %ix86
+rm -f $RPM_BUILD_ROOT/usr/share/applications/YaST2/xen.desktop
+rm -f $RPM_BUILD_ROOT/usr/share/applications/YaST2/relocation-server.desktop
+%endif

@CLEAN@

%files
%defattr(-,root,root)
-@clientdir@/vm_finish.ycp
+%dir @scrconfdir@
+%dir @yncludedir@
+@clientdir@/relocation-server.ycp
@clientdir@/xen.ycp
+@clientdir@/vm_finish.ycp
@moduledir@/VM_XEN.y*
+@moduledir@/RelocationServer.*
+@yncludedir@/*
+@scrconfdir@/*
@desktopdir@/groups/virtualization.desktop
+%ifarch x86_64
+@desktopdir@/relocation-server.desktop
@desktopdir@/xen.desktop
+%endif
%doc @docdir@

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages