Attachment '0005-Added-the-archId-parameter-as-last-one-for-the-get_i.patch'

Download

   1 From e507771fd3e21c2d590a3eab64f01082041b9066 Mon Sep 17 00:00:00 2001
   2 From: rudygodoy <rudygodoy@10.20.30.29>
   3 Date: Sat, 6 Aug 2011 00:25:02 -0500
   4 Subject: [PATCH 5/6] Added the archId parameter as last one for the get_instance_xml() function.
   5 
   6 ---
   7  node/handlers.c |   12 ++++++++++--
   8  node/handlers.h |    3 ++-
   9  2 files changed, 12 insertions(+), 3 deletions(-)
  10 
  11 diff --git a/node/handlers.c b/node/handlers.c
  12 index 18d68b9..97791f8 100644
  13 --- a/node/handlers.c
  14 +++ b/node/handlers.c
  15 @@ -377,7 +377,8 @@ get_instance_xml(	const char *gen_libvirt_cmd_path,
  16  			char *brname,
  17  			int use_virtio_net,
  18  			int use_virtio_root,
  19 -			char **xml)
  20 +			char **xml,
  21 +                        char *archId) // archId parameter
  22  {
  23      char buf [MAX_PATH];
  24  
  25 @@ -395,6 +396,12 @@ get_instance_xml(	const char *gen_libvirt_cmd_path,
  26      if (params->disk > 0) { /* TODO: get this info from scMakeImage */
  27          strncat (buf, " --ephemeral", MAX_PATH - strlen(buf) - 1);
  28      }
  29 +    /* New archId parameter
  30 +     * the string should be a less than 6 chars string */ 
  31 +    if (strnlen(archId, 5)) { // 5 chars as maximum length for arch. Could be CHAR_BUFFER_SIZE also.
  32 +        strncat(buf, " --arch=", MAX_PATH - strlen(buf) - 1); // appending the parameter
  33 +        strncat(buf, archId, MAX_PATH - strlen(buf) - 1); // Appending the parameter's value
  34 +    }
  35      * xml = system_output (buf);
  36      if ( ( * xml ) == NULL ) {
  37          logprintfl (EUCAFATAL, "%s: %s\n", gen_libvirt_cmd_path, strerror (errno));
  38 @@ -569,7 +576,8 @@ void *startup_thread (void * arg)
  39                                brname,
  40                                nc_state.config_use_virtio_net,
  41                                nc_state.config_use_virtio_root,
  42 -                              &xml);
  43 +                              &xml,
  44 +                              instance->archId);
  45  
  46      if (brname) free(brname);
  47      if (disk_path) free(disk_path);
  48 diff --git a/node/handlers.h b/node/handlers.h
  49 index bf04426..7d3b725 100644
  50 --- a/node/handlers.h
  51 +++ b/node/handlers.h
  52 @@ -219,7 +219,8 @@ int get_instance_xml(		const char *gen_libvirt_cmd_path,
  53  				char *brname,
  54  				int use_virtio_net,
  55  				int use_virtio_root,
  56 -				char **xml);
  57 +				char **xml,
  58 +                                char *archId); // archId parameter, 5 chars string maximum.
  59  void * monitoring_thread(	void *arg);
  60  void * startup_thread(		void *arg);
  61  
  62 -- 
  63 1.7.3.5

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2011-08-05 05:39:58, 2.0 KB) [[attachment:0003-arch-field-renamed-to-archId-to-maintain-naming-cons.patch]]
  • [get | view] (2011-08-06 05:33:38, 2.3 KB) [[attachment:0005-Added-the-archId-parameter-as-last-one-for-the-get_i.patch]]
  • [get | view] (2011-08-06 05:33:05, 1.3 KB) [[attachment:0006-Added-the-archId-parameter-as-last-one-for-the-alloc.patch]]
  • [get | view] (2011-08-06 05:31:50, 3.4 KB) [[attachment:XML domain generator, definitive]]
  • [get | view] (2011-08-06 05:32:42, 2.3 KB) [[attachment:archId parameter for get_instance_xml]]
  • [get | view] (2011-08-06 04:51:43, 6.1 KB) [[attachment:gen_kvm_libvirt_xml initial verstion -non patch format]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.