[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [PATCH 4/8] Get rid of the kickstart command codes, and alphabetize the command table.



Ack.  Comments...

On Thu, 20 Jan 2011, Chris Lumens wrote:

---
loader/kickstart.c |   49 ++++++++++++++++++++-----------------------------
loader/kickstart.h |   21 ---------------------
2 files changed, 20 insertions(+), 50 deletions(-)

diff --git a/loader/kickstart.c b/loader/kickstart.c
index 69258cf..61fafa8 100644
--- a/loader/kickstart.c
+++ b/loader/kickstart.c
@@ -60,17 +60,11 @@
extern uint64_t flags;

struct ksCommandNames {
-    int code;
    char * name;
    void (*setupData) (struct loaderData_s *loaderData,
                       int argc, char ** argv);
} ;

-struct ksCommand {
-    int code, argc;
-    char ** argv;
-};
-
static void setTextMode(struct loaderData_s * loaderData, int argc,
                        char ** argv);
static void setGraphicalMode(struct loaderData_s * loaderData, int argc,
@@ -93,31 +87,28 @@ static void setVnc(struct loaderData_s * loaderData, int argc,
                       char ** argv);

struct ksCommandNames ksTable[] = {
-    { KS_CMD_NFS, "nfs", setKickstartNfs },
-    { KS_CMD_CDROM, "cdrom", setKickstartCD },
-    { KS_CMD_HD, "harddrive", setKickstartHD },
-    { KS_CMD_TEXT, "text", setTextMode },
-    { KS_CMD_GRAPHICAL, "graphical", setGraphicalMode },
-    { KS_CMD_URL, "url", setKickstartUrl },
-    { KS_CMD_NETWORK, "network", setKickstartNetwork },
-    { KS_CMD_KEYBOARD, "keyboard", setKickstartKeyboard },
-    { KS_CMD_LANG, "lang", setKickstartLanguage },
-    { KS_CMD_DD, "driverdisk", useKickstartDD },
-    { KS_CMD_DEVICE, "device", loadKickstartModule },
-    { KS_CMD_CMDLINE, "cmdline", setCmdlineMode },
-    { KS_CMD_SELINUX, "selinux", setSELinux },
-    { KS_CMD_POWEROFF, "poweroff", setPowerOff },
-    { KS_CMD_HALT, "halt", setHalt },
-    { KS_CMD_SHUTDOWN, "shutdown", setShutdown },
-    { KS_CMD_MEDIACHECK, "mediacheck", setMediaCheck },
-    { KS_CMD_UPDATES, "updates", setUpdates },
-    { KS_CMD_VNC, "vnc", setVnc },
-    { KS_CMD_NONE, NULL, NULL }
+    { "cdrom", setKickstartCD },
+    { "cmdline", setCmdlineMode },
+    { "device", loadKickstartModule },
+    { "driverdisk", useKickstartDD },
+    { "graphical", setGraphicalMode },
+    { "halt", setHalt },
+    { "harddrive", setKickstartHD },
+    { "keyboard", setKickstartKeyboard },
+    { "lang", setKickstartLanguage },
+    { "mediacheck", setMediaCheck },
+    { "network", setKickstartNetwork },
+    { "nfs", setKickstartNfs },
+    { "poweroff", setPowerOff },
+    { "selinux", setSELinux },
+    { "shutdown", setShutdown },
+    { "text", setTextMode },
+    { "updates", setUpdates },
+    { "url", setKickstartUrl },
+    { "vnc", setVnc },
+    { NULL, NULL }
};

Like the first patch, maybe this should live in pykickstart.

-struct ksCommand * commands = NULL;
-int numCommands = 0;
-
/* INTERNAL PYTHON INTERFACE FUNCTIONS */

static PyObject *getCallable(PyObject *module, const char *name) {
diff --git a/loader/kickstart.h b/loader/kickstart.h
index 80f91d1..db9bb83 100644
--- a/loader/kickstart.h
+++ b/loader/kickstart.h
@@ -21,27 +21,6 @@

#include "loader.h"

-#define KS_CMD_NONE	    0
-#define KS_CMD_NFS	    1
-#define KS_CMD_CDROM	    2
-#define KS_CMD_HD	    3
-#define KS_CMD_URL	    4
-#define KS_CMD_NETWORK      5
-#define KS_CMD_TEXT         6
-#define KS_CMD_KEYBOARD     7
-#define KS_CMD_LANG         8
-#define KS_CMD_DD           9
-#define KS_CMD_DEVICE      10
-#define KS_CMD_CMDLINE     11
-#define KS_CMD_GRAPHICAL   12
-#define KS_CMD_SELINUX     13
-#define KS_CMD_POWEROFF    14
-#define KS_CMD_HALT        15
-#define KS_CMD_SHUTDOWN    16
-#define KS_CMD_MEDIACHECK  17
-#define KS_CMD_UPDATES     18
-#define KS_CMD_VNC         19
-
int isKickstartFileRemote(char *ksFile);
void getKickstartFile(struct loaderData_s * loaderData);
int runKickstart(struct loaderData_s * loaderData, const char *file);


--
David Cantrell <dcantrell redhat com>
Supervisor, Installer Engineering Team
Red Hat, Inc. | Honolulu, HI | UTC-10


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]