summaryrefslogtreecommitdiffstats
path: root/iw
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2009-07-02 11:31:19 +0200
committerHans de Goede <hdegoede@redhat.com>2009-07-02 22:05:40 +0200
commit81334650378fe67bf9adc22daf67ccf41688be04 (patch)
treefaab618c7164ebd6de2776ca8a58f0b12139636c /iw
parent4031b12d3e59a6904ad3ab8c092c5a101216f2f6 (diff)
downloadanaconda-81334650378fe67bf9adc22daf67ccf41688be04.tar.gz
anaconda-81334650378fe67bf9adc22daf67ccf41688be04.tar.xz
anaconda-81334650378fe67bf9adc22daf67ccf41688be04.zip
Initial FCoE support
This patch adds support for using FCoE during the installation. This patch merely lays the initial ground work, there is more work todo: - The system will not boot without manual help after the install, as dracut / mkinitrd do not support FCoE yet - If FCoE is not used for / but for example for /srv, then information about the nic used for FCoE needs to be written in a to be defined config file in the system, and rc.sysinit needs to be thought to read this file and bring up FCoE SAN's / Fabrics not used for / - kickstart support for FCoE still needs to be done
Diffstat (limited to 'iw')
-rw-r--r--iw/autopart_type.py84
1 files changed, 83 insertions, 1 deletions
diff --git a/iw/autopart_type.py b/iw/autopart_type.py
index 8a1268904..9c04e52b2 100644
--- a/iw/autopart_type.py
+++ b/iw/autopart_type.py
@@ -32,6 +32,7 @@ from iw_gui import *
from flags import flags
import network
from storage import iscsi
+from storage import fcoe
from storage.deviceaction import *
import gettext
@@ -325,6 +326,81 @@ class PartitionTypeWindow(InstallWindow):
return rc
+ def addFcoeDrive(self):
+ (dxml, dialog) = gui.getGladeWidget("fcoe-config.glade",
+ "fcoeDialog")
+
+ # Populate the combo
+ combo = dxml.get_widget("fcoeNicCombo")
+ cell = gtk.CellRendererText()
+ combo.pack_start(cell, True)
+ combo.set_attributes(cell, text = 0)
+ cell.set_property("wrap-width", 525)
+ combo.set_size_request(480, -1)
+ store = gtk.TreeStore(gobject.TYPE_STRING, gobject.TYPE_STRING)
+ combo.set_model(store)
+
+ netdevs = self.anaconda.id.network.available()
+ keys = netdevs.keys()
+ keys.sort()
+ selected_interface = None
+ for dev in keys:
+ # Skip NIC's which are connected (iow in use for a net install)
+ if dev in network.getActiveNetDevs():
+ continue
+
+ i = store.append(None)
+
+ desc = netdevs[dev].get("DESC")
+ if desc:
+ desc = "%s - %s" %(dev, desc)
+ else:
+ desc = "%s" %(dev,)
+
+ mac = netdevs[dev].get("HWADDR")
+ if mac:
+ desc = "%s - %s" %(desc, mac)
+
+ if selected_interface is None:
+ selected_interface = i
+
+ store[i] = (desc, dev)
+
+ if selected_interface:
+ combo.set_active_iter(selected_interface)
+ else:
+ combo.set_active(0)
+
+ # Show the dialog
+ gui.addFrame(dialog)
+ dialog.show_all()
+ sg = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL)
+ sg.add_widget(dxml.get_widget("fcoeNicCombo"))
+
+ while 1:
+ rc = dialog.run()
+
+ if rc == gtk.RESPONSE_CANCEL:
+ break;
+
+ iter = combo.get_active_iter()
+ if iter is None:
+ self.intf.messageWindow(_("Error"),
+ "Must select a NIC to use.",
+ type="warning", custom_icon="error")
+ continue;
+
+ try:
+ self.storage.fcoe.addSan(store.get_value(iter, 1), self.intf)
+ except IOError, e:
+ self.intf.messageWindow(_("Error"), str(e))
+ rc = gtk.RESPONSE_CANCEL
+
+ break
+
+ dialog.destroy()
+ return rc
+
def addZfcpDrive(self):
(dxml, dialog) = gui.getGladeWidget("zfcp-config.glade",
"zfcpDialog")
@@ -366,6 +442,10 @@ class PartitionTypeWindow(InstallWindow):
dxml.get_widget("iscsiRadio").set_sensitive(False)
dxml.get_widget("iscsiRadio").set_active(False)
+ if not fcoe.has_fcoe():
+ dxml.get_widget("fcoeRadio").set_sensitive(False)
+ dxml.get_widget("fcoeRadio").set_active(False)
+
#figure out what advanced devices we have available and set sensible default
group = dxml.get_widget("iscsiRadio").get_group()
for button in group:
@@ -379,6 +459,8 @@ class PartitionTypeWindow(InstallWindow):
return
if dxml.get_widget("iscsiRadio").get_active() and iscsi.has_iscsi():
rc = self.addIscsiDrive()
+ elif dxml.get_widget("fcoeRadio").get_active() and fcoe.has_fcoe():
+ rc = self.addFcoeDrive()
elif dxml.get_widget("zfcpRadio") is not None and dxml.get_widget("zfcpRadio").get_active():
rc = self.addZfcpDrive()
dialog.destroy()
@@ -498,7 +580,7 @@ class PartitionTypeWindow(InstallWindow):
self.xml.get_widget("bootDriveCombo").set_sensitive(False)
self.xml.get_widget("encryptButton").set_sensitive(False)
- if not iutil.isS390() and not iscsi.has_iscsi():
+ if not iutil.isS390() and not iscsi.has_iscsi() and not fcoe.has_fcoe():
self.xml.get_widget("addButton").set_sensitive(False)
sigs = { "on_partitionTypeCombo_changed": self.comboChanged,