[patch iwhd] Add RHEV-M template import

Jim Meyering jim at meyering.net
Tue Jun 14 14:52:32 UTC 2011


Pete Zaitcev wrote:
> Most clouds structure the procedure to start a VM into 2 general steps:
> 1. Upload and "register" the bundle, so that it is known to the cloud.
> This typically returns some kind of ID, such as Amazon's ami-xxxxxxxx.
> 2. Instantiate the "registered" image so that a running VM is created.
>
> Unlike other clouds, RHEV-M requires a 3-step process to start a VM:
> 1. Upload the bundle into so-called "export domain". This makes a
> "template" known to the cloud, but it cannot be launched yet.
> 2. Import the template. At its core it means copying the template
> from "export domain" to "master domain".
> 3. Instantiate the imported template to produce VMs.
>
> One way or the other, someone has to do this: either iwhd itself,
> or iwhd's user (Aeolus Conductor). This patch implements the middle
> step in iwhd.
>
> See the update to registration.md for the new parameter "cluster".

Thanks, Pete.
When I applied that locally using, git warned like this:

    $ git am PATCH
    Applying: Add RHEV-M template import
    /w/iwhd/.git/rebase-apply/patch:185: space before tab in indent.
                    fprintf(stderr,
    warning: 1 line adds whitespace errors.

The following patch fixes that and removes a few other
unnecessary spaces-before-TAB.

diff --git a/dc-rhev-image.c b/dc-rhev-image.c
index 4949a0d..313a880 100644
--- a/dc-rhev-image.c
+++ b/dc-rhev-image.c
@@ -375,7 +375,7 @@ static size_t api_rcb(void *ptr, size_t bsz, size_t nmemb, void *arg)
 static void require_api_root(const xmlChar *actual, const char *required)
 {
 	if (strcmp((const char *)actual, required) != 0) {
- 		fprintf(stderr,
+		fprintf(stderr,
 			"ERROR invalid API root: `%s' (expected `%s')\n",
 			actual, required);
 		exit(EXIT_FAILURE);
@@ -406,7 +406,7 @@ static void apipaths(struct api_conn *connection,
 	apib.alloc = 4000;

 	// if (debugging) /* if (verbose) */
-	// 	curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
+	//	curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
 	curl_easy_setopt(curl, CURLOPT_URL, url);
 	curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
 	curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
@@ -581,7 +581,7 @@ static struct stor_dom *apistordom(struct config *cfg,
 	apib.alloc = 4000;

 	// if (debugging) /* if (verbose) */
-	// 	curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
+	//	curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
 	curl_easy_setopt(curl, CURLOPT_URL, url);
 	curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
 	curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
@@ -697,7 +697,7 @@ static int apipoolid(struct config *cfg, struct api_conn *connection,
 	apib.alloc = 4000;

 	// if (debugging) /* if (verbose) */
-	// 	curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
+	//	curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
 	curl_easy_setopt(curl, CURLOPT_URL, url);
 	curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
 	curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
@@ -778,7 +778,7 @@ static char *apipool(struct config *cfg, struct api_conn *connection,
 	apib.alloc = 4000;

 	// if (debugging) /* if (verbose) */
-	// 	curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
+	//	curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
 	curl_easy_setopt(curl, CURLOPT_URL, url);
 	curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
 	curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
@@ -876,7 +876,7 @@ static char *apimasterid(const struct config *cfg, struct api_conn *connection,
 	apib.alloc = 4000;

 	// if (debugging) /* if (verbose) */
-	// 	curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
+	//	curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
 	curl_easy_setopt(curl, CURLOPT_URL, url);
 	curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
 	curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
@@ -981,7 +981,7 @@ static char *apimaster(const struct config *cfg, struct api_conn *connection,
 	apib.alloc = 4000;

 	// if (debugging) /* if (verbose) */
-	// 	curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
+	//	curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
 	curl_easy_setopt(curl, CURLOPT_URL, url);
 	curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
 	curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
@@ -1184,7 +1184,7 @@ static char *apiclust(struct config *cfg, struct api_conn *connection,
 	apib.alloc = 4000;

 	// if (debugging) /* if (verbose) */
-	// 	curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
+	//	curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
 	curl_easy_setopt(curl, CURLOPT_URL, url);
 	curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
 	curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
@@ -1994,7 +1994,7 @@ static xmlChar *import_start(struct config *cfg, struct api_conn *connection,
 	apib.alloc = 4000;

 	// if (debugging) /* if (verbose) */
-	// 	curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
+	//	curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
 	curl_easy_setopt(curl, CURLOPT_URL, url);
 	curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
 	curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);
@@ -2119,7 +2119,7 @@ static char *import_status(struct config *cfg, struct api_conn *connection,
 	curl_easy_setopt(curl, CURLOPT_HTTPGET, 1);

 	// if (debugging) /* if (verbose) */
-	// 	curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
+	//	curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
 	curl_easy_setopt(curl, CURLOPT_URL, url);
 	curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
 	curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1);


More information about the iwhd-devel mailing list