[Libguestfs] [PATCH febootstrap 3/8] Change initrd -> appliance.

Richard W.M. Jones rjones at redhat.com
Fri Aug 20 10:39:53 UTC 2010


-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
New in Fedora 11: Fedora Windows cross-compiler. Compile Windows
programs, test, and build Windows installers. Over 70 libraries supprt'd
http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw
-------------- next part --------------
>From 861c38be3e8c135d93a072911b65ce88ac58fd9f Mon Sep 17 00:00:00 2001
From: Richard Jones <rjones at redhat.com>
Date: Thu, 19 Aug 2010 13:55:36 +0100
Subject: [PATCH 3/8] Change initrd -> appliance.

We are going to be writing a general appliance, not necessarily
an initrd.  In the ext2 appliance case we will _also_ write an
initrd, so we shouldn't confuse the two things.
---
 helper/appliance.c |    8 ++++----
 helper/helper.h    |    2 +-
 helper/main.c      |   10 +++++-----
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/helper/appliance.c b/helper/appliance.c
index c7200bd..c6defc0 100644
--- a/helper/appliance.c
+++ b/helper/appliance.c
@@ -86,11 +86,11 @@ void
 create_appliance (char **inputs, int nr_inputs,
                   const char *whitelist,
                   const char *modpath,
-                  const char *initrd)
+                  const char *appliance)
 {
-  out_fd = open (initrd, O_WRONLY | O_CREAT | O_TRUNC | O_NOCTTY, 0644);
+  out_fd = open (appliance, O_WRONLY | O_CREAT | O_TRUNC | O_NOCTTY, 0644);
   if (out_fd == -1)
-    error (EXIT_FAILURE, errno, "open: %s", initrd);
+    error (EXIT_FAILURE, errno, "open: %s", appliance);
   out_offset = 0;
 
   iterate_inputs (inputs, nr_inputs);
@@ -102,7 +102,7 @@ create_appliance (char **inputs, int nr_inputs,
 
   /* Finish off and close output file. */
   if (close (out_fd) == -1)
-    error (EXIT_FAILURE, errno, "close: %s", initrd);
+    error (EXIT_FAILURE, errno, "close: %s", appliance);
 }
 
 /* Iterate over the inputs to find out what they are, visiting
diff --git a/helper/helper.h b/helper/helper.h
index fdf446e..e9618ba 100644
--- a/helper/helper.h
+++ b/helper/helper.h
@@ -24,7 +24,7 @@ extern struct timeval start_t;
 extern int verbose;
 
 /* appliance.c */
-extern void create_appliance (char **inputs, int nr_inputs, const char *whitelist, const char *modpath, const char *initrd);
+extern void create_appliance (char **inputs, int nr_inputs, const char *whitelist, const char *modpath, const char *appliance);
 
 /* kernel.c */
 extern const char *create_kernel (const char *hostcpu, const char *kernel);
diff --git a/helper/main.c b/helper/main.c
index a30e02c..d350b4e 100644
--- a/helper/main.c
+++ b/helper/main.c
@@ -126,15 +126,15 @@ main (int argc, char *argv[])
 
   /* Output files. */
   const char *kernel = argv[argc-2];
-  const char *initrd = argv[argc-1];
+  const char *appliance = argv[argc-1];
 
   if (verbose) {
     print_timestamped_message ("whitelist = %s, "
                                "host_cpu = %s, "
                                "kernel = %s, "
-                               "initrd = %s",
+                               "appliance = %s",
                                whitelist ? : "(not specified)",
-                               hostcpu, kernel, initrd);
+                               hostcpu, kernel, appliance);
     int i;
     for (i = 0; i < nr_inputs; ++i)
       print_timestamped_message ("inputs[%d] = %s", i, inputs[i]);
@@ -142,7 +142,7 @@ main (int argc, char *argv[])
 
   /* Remove the output files if they exist. */
   unlink (kernel);
-  unlink (initrd);
+  unlink (appliance);
 
   /* Create kernel output file. */
   const char *modpath;
@@ -152,7 +152,7 @@ main (int argc, char *argv[])
     print_timestamped_message ("finished creating kernel");
 
   /* Create the appliance. */
-  create_appliance (inputs, nr_inputs, whitelist, modpath, initrd);
+  create_appliance (inputs, nr_inputs, whitelist, modpath, appliance);
 
   if (verbose)
     print_timestamped_message ("finished creating appliance");
-- 
1.7.1



More information about the Libguestfs mailing list