WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] xl: correct xl cpupool-create with extra

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] xl: correct xl cpupool-create with extra parameters
From: Xen patchbot-unstable <patchbot@xxxxxxx>
Date: Tue, 15 Feb 2011 00:35:27 -0800
Delivery-date: Tue, 15 Feb 2011 00:37:17 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Juergen Gross <juergen.gross@xxxxxxxxxxxxxx>
# Date 1297702500 0
# Node ID 0e7a10dc76170b0ffabd7e0df7ce26ec4c5612f4
# Parent  51bd89ca047d29a4fc1ff0518dc60319914ccc49
xl: correct xl cpupool-create with extra parameters

xl cpupool-create won't take always extra parameters specified on the command
line, as a 0-byte is missing at the end of the configuration file contents.

Signed-off-by: Juergen Gross <juergen.gross@xxxxxxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 tools/libxl/xl_cmdimpl.c |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff -r 51bd89ca047d -r 0e7a10dc7617 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Mon Feb 14 16:49:03 2011 +0000
+++ b/tools/libxl/xl_cmdimpl.c  Mon Feb 14 16:55:00 2011 +0000
@@ -5204,7 +5204,7 @@ int main_cpupoolcreate(int argc, char **
         {0, 0, 0, 0}
     };
     int ret;
-    void *config_data = 0;
+    char *config_data = 0;
     int config_len = 0;
     XLU_Config *config;
     const char *buf;
@@ -5244,9 +5244,8 @@ int main_cpupoolcreate(int argc, char **
     memset(extra_config, 0, sizeof(extra_config));
     while (optind < argc) {
         if ((p = strchr(argv[optind], '='))) {
-            if (strlen(extra_config) + 1 < sizeof(extra_config)) {
-                if (strlen(extra_config))
-                    strcat(extra_config, "\n");
+            if (strlen(extra_config) + 1 + strlen(argv[optind]) < 
sizeof(extra_config)) {
+                strcat(extra_config, "\n");
                 strcat(extra_config, argv[optind]);
             }
         } else if (!filename) {
@@ -5263,7 +5262,7 @@ int main_cpupoolcreate(int argc, char **
         return -ERROR_FAIL;
     }
 
-    if (libxl_read_file_contents(&ctx, filename, &config_data, &config_len)) {
+    if (libxl_read_file_contents(&ctx, filename, (void **)&config_data, 
&config_len)) {
         fprintf(stderr, "Failed to read config file: %s: %s\n",
                 filename, strerror(errno));
         return -ERROR_FAIL;
@@ -5279,10 +5278,10 @@ int main_cpupoolcreate(int argc, char **
             fprintf(stderr, "Failed to realloc config_data\n");
             return -ERROR_FAIL;
         }
-        strcat(config_data, "\n");
+        config_data[config_len] = 0;
         strcat(config_data, extra_config);
         strcat(config_data, "\n");
-        config_len += (strlen(extra_config) + 2);
+        config_len += strlen(extra_config) + 1;
     }
 
     config = xlu_cfg_init(stderr, filename);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] xl: correct xl cpupool-create with extra parameters, Xen patchbot-unstable <=