Mailinglist Archive: yast-commit (1212 mails)
| < Previous | Next > |
[yast-commit] r50962 - in /trunk/network: VERSION package/yast2-network.changes src/modules/Lan.ycp
- From: mzugec@xxxxxxxxxxxxxxxx
- Date: Wed, 10 Sep 2008 14:01:43 -0000
- Message-id: <20080910140143.6218139B02@xxxxxxxxxxxxxxxx>
Author: mzugec
Date: Wed Sep 10 16:01:42 2008
New Revision: 50962
URL: http://svn.opensuse.org/viewcvs/yast?rev=50962&view=rev
Log:
special proposal for virtualization network (fate#303386)
Modified:
trunk/network/VERSION
trunk/network/package/yast2-network.changes
trunk/network/src/modules/Lan.ycp
Modified: trunk/network/VERSION
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/network/VERSION?rev=50962&r1=50961&r2=50962&view=diff
==============================================================================
--- trunk/network/VERSION (original)
+++ trunk/network/VERSION Wed Sep 10 16:01:42 2008
@@ -1 +1 @@
-2.17.24
+2.17.25
Modified: trunk/network/package/yast2-network.changes
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/network/package/yast2-network.changes?rev=50962&r1=50961&r2=50962&view=diff
==============================================================================
--- trunk/network/package/yast2-network.changes (original)
+++ trunk/network/package/yast2-network.changes Wed Sep 10 16:01:42 2008
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Wed Sep 10 16:00:40 CEST 2008 - mzugec@xxxxxxx
+
+- special proposal for virtualization network (fate#303386)
+- 2.17.25
+
+-------------------------------------------------------------------
Mon Sep 8 14:12:22 CEST 2008 - mzugec@xxxxxxx
- button labeling in isdn module (fate#120373)
Modified: trunk/network/src/modules/Lan.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/network/src/modules/Lan.ycp?rev=50962&r1=50961&r2=50962&view=diff
==============================================================================
--- trunk/network/src/modules/Lan.ycp (original)
+++ trunk/network/src/modules/Lan.ycp Wed Sep 10 16:01:42 2008
@@ -728,6 +728,54 @@
y2milestone("NetworkConfig::Config=%1", NetworkConfig::Config);
y2milestone("NetworkConfig::DHCP=%1", NetworkConfig::DHCP);
+ // test if we have any virtualization installed
+ boolean has_virtualization =
PackageSystem::Installed("xen")||PackageSystem::Installed("kvm")||
+
PackageSystem::Installed("qemu")||PackageSystem::Installed("virtualbox-ose");
+ if (has_virtualization)
+ {
+ y2milestone("Virtualization [xen|kvm|qemu|virtualbox-ose] detected - will
propose virtualization network");
+ // in case of virtualization use special proposal
+ // first configure all connected unconfigured devices with dhcp (with
default parameters)
+ foreach (integer number, any lanitem, LanItems::Items, {
+ if (hasAnyValue(((map)lanitem)["hwinfo", "dev_name"]:"")) {
+ LanItems::current = number;
+ boolean link = LanItems::getCurrentItem()["hwinfo", "link"]:false;
+ if (!link) y2warning("item number %1 has link:false detected", number);
+ if (!LanItems::IsItemConfigured() && link){
+ y2milestone("Nothing already configured - start proposing");
+ LanItems::ProposeItem();
+ }
+ }
+ });
+
+ // then each configuration (except bridges) move to the bridge
+ // and add old device name into bridge_ports
+ foreach(integer current, any config, LanItems::Items, {
+ string ifcfg = LanItems::Items[current, "ifcfg"]:"";
+ if (! (NetworkInterfaces::GetType(ifcfg)=="br")){
+ NetworkInterfaces::Edit(ifcfg);
+ string new_ifcfg = sformat("br%1",
NetworkInterfaces::GetFreeDevice("br"));
+ y2milestone("old configuration %1, bridge %2", ifcfg, new_ifcfg);
+ NetworkInterfaces::Name = new_ifcfg;
+ NetworkInterfaces::Current["BRIDGE"]="yes";
+ NetworkInterfaces::Current["BRIDGE_PORTS"]=ifcfg;
+ // remove description - will be replaced by new (real) one
+ NetworkInterfaces::Current=remove(NetworkInterfaces::Current, "NAME");
+ if( NetworkInterfaces::Commit() ){
+ NetworkInterfaces::Delete(ifcfg);
+ NetworkInterfaces::Commit();
+
+ LanItems::Items[current, "ifcfg"] = new_ifcfg;
+ LanItems::modified=true;
+ LanItems::force_restart=true;
+ y2internal("List %1", NetworkInterfaces::List(""));
+ // re-read configuration to see new items in UI
+ LanItems::Read();
+ } else y2error("error while proposing bridge device for %1", ifcfg);
+ } else y2internal("skipping bridge ...");
+ });
+ } else {
+
if (! LanItems::nm_proposal_valid)
{
NetworkService::SetManaged (UseNetworkManager ());
@@ -744,6 +792,7 @@
}
+ }
/* Something is already configured -> do nothing */
boolean configured=false;
foreach (integer number, any lanitem, LanItems::Items, {
@@ -753,7 +802,6 @@
configured = true;
break;
}
-// }
});
if (configured) return false;
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx
Date: Wed Sep 10 16:01:42 2008
New Revision: 50962
URL: http://svn.opensuse.org/viewcvs/yast?rev=50962&view=rev
Log:
special proposal for virtualization network (fate#303386)
Modified:
trunk/network/VERSION
trunk/network/package/yast2-network.changes
trunk/network/src/modules/Lan.ycp
Modified: trunk/network/VERSION
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/network/VERSION?rev=50962&r1=50961&r2=50962&view=diff
==============================================================================
--- trunk/network/VERSION (original)
+++ trunk/network/VERSION Wed Sep 10 16:01:42 2008
@@ -1 +1 @@
-2.17.24
+2.17.25
Modified: trunk/network/package/yast2-network.changes
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/network/package/yast2-network.changes?rev=50962&r1=50961&r2=50962&view=diff
==============================================================================
--- trunk/network/package/yast2-network.changes (original)
+++ trunk/network/package/yast2-network.changes Wed Sep 10 16:01:42 2008
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Wed Sep 10 16:00:40 CEST 2008 - mzugec@xxxxxxx
+
+- special proposal for virtualization network (fate#303386)
+- 2.17.25
+
+-------------------------------------------------------------------
Mon Sep 8 14:12:22 CEST 2008 - mzugec@xxxxxxx
- button labeling in isdn module (fate#120373)
Modified: trunk/network/src/modules/Lan.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/network/src/modules/Lan.ycp?rev=50962&r1=50961&r2=50962&view=diff
==============================================================================
--- trunk/network/src/modules/Lan.ycp (original)
+++ trunk/network/src/modules/Lan.ycp Wed Sep 10 16:01:42 2008
@@ -728,6 +728,54 @@
y2milestone("NetworkConfig::Config=%1", NetworkConfig::Config);
y2milestone("NetworkConfig::DHCP=%1", NetworkConfig::DHCP);
+ // test if we have any virtualization installed
+ boolean has_virtualization =
PackageSystem::Installed("xen")||PackageSystem::Installed("kvm")||
+
PackageSystem::Installed("qemu")||PackageSystem::Installed("virtualbox-ose");
+ if (has_virtualization)
+ {
+ y2milestone("Virtualization [xen|kvm|qemu|virtualbox-ose] detected - will
propose virtualization network");
+ // in case of virtualization use special proposal
+ // first configure all connected unconfigured devices with dhcp (with
default parameters)
+ foreach (integer number, any lanitem, LanItems::Items, {
+ if (hasAnyValue(((map)lanitem)["hwinfo", "dev_name"]:"")) {
+ LanItems::current = number;
+ boolean link = LanItems::getCurrentItem()["hwinfo", "link"]:false;
+ if (!link) y2warning("item number %1 has link:false detected", number);
+ if (!LanItems::IsItemConfigured() && link){
+ y2milestone("Nothing already configured - start proposing");
+ LanItems::ProposeItem();
+ }
+ }
+ });
+
+ // then each configuration (except bridges) move to the bridge
+ // and add old device name into bridge_ports
+ foreach(integer current, any config, LanItems::Items, {
+ string ifcfg = LanItems::Items[current, "ifcfg"]:"";
+ if (! (NetworkInterfaces::GetType(ifcfg)=="br")){
+ NetworkInterfaces::Edit(ifcfg);
+ string new_ifcfg = sformat("br%1",
NetworkInterfaces::GetFreeDevice("br"));
+ y2milestone("old configuration %1, bridge %2", ifcfg, new_ifcfg);
+ NetworkInterfaces::Name = new_ifcfg;
+ NetworkInterfaces::Current["BRIDGE"]="yes";
+ NetworkInterfaces::Current["BRIDGE_PORTS"]=ifcfg;
+ // remove description - will be replaced by new (real) one
+ NetworkInterfaces::Current=remove(NetworkInterfaces::Current, "NAME");
+ if( NetworkInterfaces::Commit() ){
+ NetworkInterfaces::Delete(ifcfg);
+ NetworkInterfaces::Commit();
+
+ LanItems::Items[current, "ifcfg"] = new_ifcfg;
+ LanItems::modified=true;
+ LanItems::force_restart=true;
+ y2internal("List %1", NetworkInterfaces::List(""));
+ // re-read configuration to see new items in UI
+ LanItems::Read();
+ } else y2error("error while proposing bridge device for %1", ifcfg);
+ } else y2internal("skipping bridge ...");
+ });
+ } else {
+
if (! LanItems::nm_proposal_valid)
{
NetworkService::SetManaged (UseNetworkManager ());
@@ -744,6 +792,7 @@
}
+ }
/* Something is already configured -> do nothing */
boolean configured=false;
foreach (integer number, any lanitem, LanItems::Items, {
@@ -753,7 +802,6 @@
configured = true;
break;
}
-// }
});
if (configured) return false;
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx
| < Previous | Next > |