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

[Xen-changelog] [xen-unstable] libxlu: Rename filename to config_source


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-unstable <patchbot@xxxxxxx>
  • Date: Fri, 18 May 2012 17:11:11 +0000
  • Delivery-date: Fri, 18 May 2012 17:11:18 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User George Dunlap <george.dunlap@xxxxxxxxxxxxx>
# Date 1337095692 -3600
# Node ID 50ec1dc19f142286ef0cc599ee717d11cd0a5909
# Parent  2d066d4a2d4fefbda1c874eeea0bddc681576ede
libxlu: Rename filename to config_source

The "filename" is a bit of a misnomer, as it's only used during error
messages, and in most instances cases is actually set to "command
line".

Rename it to "config_source" to make it clear that it's not used to
actually open any files.

No functional changes.

Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
Committed-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---


diff -r 2d066d4a2d4f -r 50ec1dc19f14 tools/libxl/libxlu_cfg.c
--- a/tools/libxl/libxlu_cfg.c  Tue May 15 16:28:11 2012 +0100
+++ b/tools/libxl/libxlu_cfg.c  Tue May 15 16:28:12 2012 +0100
@@ -25,15 +25,15 @@
 #include "libxlu_cfg_l.h"
 #include "libxlu_cfg_i.h"
 
-XLU_Config *xlu_cfg_init(FILE *report, const char *report_filename) {
+XLU_Config *xlu_cfg_init(FILE *report, const char *report_source) {
     XLU_Config *cfg;
 
     cfg= malloc(sizeof(*cfg));
     if (!cfg) return 0;
 
     cfg->report= report;
-    cfg->filename= strdup(report_filename);
-    if (!cfg->filename) { free(cfg); return 0; }
+    cfg->config_source= strdup(report_source);
+    if (!cfg->config_source) { free(cfg); return 0; }
 
     cfg->settings= 0;
     return cfg;
@@ -51,7 +51,7 @@ static int ctx_prep(CfgParseContext *ctx
     e= xlu__cfg_yylex_init_extra(ctx, &ctx->scanner);
     if (e) {
         fprintf(cfg->report,"%s: unable to create scanner: %s\n",
-                cfg->filename, strerror(e));
+                cfg->config_source, strerror(e));
         return e;
     }
     return 0;
@@ -117,7 +117,7 @@ int xlu_cfg_readdata(XLU_Config *cfg, co
     buf = xlu__cfg_yy_scan_bytes(data, length, ctx.scanner);
     if (!buf) {
         fprintf(cfg->report,"%s: unable to allocate scanner buffer\n",
-                cfg->filename);
+                cfg->config_source);
         ctx.err= ENOMEM;
         goto xe;
     }
@@ -151,7 +151,7 @@ void xlu_cfg_destroy(XLU_Config *cfg) {
         set_next= set->next;
         xlu__cfg_set_free(set);
     }
-    free(cfg->filename);
+    free(cfg->config_source);
     free(cfg);
 }
 
@@ -178,7 +178,7 @@ static int find_atom(const XLU_Config *c
             fprintf(cfg->report,
                     "%s:%d: warning: parameter `%s' is"
                     " a list but should be a single value\n",
-                    cfg->filename, set->lineno, n);
+                    cfg->config_source, set->lineno, n);
         return EINVAL;
     }
     *set_r= set;
@@ -223,14 +223,14 @@ int xlu_cfg_get_long(const XLU_Config *c
             fprintf(cfg->report,
                     "%s:%d: warning: parameter `%s' could not be parsed"
                     " as a number: %s\n",
-                    cfg->filename, set->lineno, n, strerror(e));
+                    cfg->config_source, set->lineno, n, strerror(e));
         return e;
     }
     if (*ep || ep==set->values[0]) {
         if (!dont_warn)
             fprintf(cfg->report,
                     "%s:%d: warning: parameter `%s' is not a valid number\n",
-                    cfg->filename, set->lineno, n);
+                    cfg->config_source, set->lineno, n);
         return EINVAL;
     }
     *value_r= l;
@@ -258,7 +258,7 @@ int xlu_cfg_get_list(const XLU_Config *c
             fprintf(cfg->report,
                     "%s:%d: warning: parameter `%s' is a single value"
                     " but should be a list\n",
-                    cfg->filename, set->lineno, n);
+                    cfg->config_source, set->lineno, n);
         }
         return EINVAL;
     }
@@ -467,7 +467,7 @@ void xlu__cfg_yyerror(YYLTYPE *loc, CfgP
 
     fprintf(ctx->cfg->report,
             "%s:%d: config parsing error near %s%.*s%s%s: %s\n",
-            ctx->cfg->filename, lineno,
+            ctx->cfg->config_source, lineno,
             len?"`":"", len, text, len?"'":"", newline,
             msg);
     if (!ctx->err) ctx->err= EINVAL;
diff -r 2d066d4a2d4f -r 50ec1dc19f14 tools/libxl/libxlu_disk.c
--- a/tools/libxl/libxlu_disk.c Tue May 15 16:28:11 2012 +0100
+++ b/tools/libxl/libxlu_disk.c Tue May 15 16:28:12 2012 +0100
@@ -10,7 +10,7 @@ void xlu__disk_err(DiskParseContext *dpc
             "%s: config parsing error in disk specification: %s"
             "%s%s%s"
             " in `%s'\n",
-            dpc->cfg->filename, message,
+            dpc->cfg->config_source, message,
             erroneous?": near `":"", erroneous?erroneous:"", erroneous?"'":"",
             dpc->spec);
     if (!dpc->err) dpc->err= EINVAL;
diff -r 2d066d4a2d4f -r 50ec1dc19f14 tools/libxl/libxlu_internal.h
--- a/tools/libxl/libxlu_internal.h     Tue May 15 16:28:11 2012 +0100
+++ b/tools/libxl/libxlu_internal.h     Tue May 15 16:28:12 2012 +0100
@@ -38,7 +38,7 @@ struct XLU_ConfigSetting { /* transparen
 struct XLU_Config {
     XLU_ConfigSetting *settings;
     FILE *report;
-    char *filename;
+    char *config_source;
 };
 
 typedef struct {
diff -r 2d066d4a2d4f -r 50ec1dc19f14 tools/libxl/libxlu_vif.c
--- a/tools/libxl/libxlu_vif.c  Tue May 15 16:28:11 2012 +0100
+++ b/tools/libxl/libxlu_vif.c  Tue May 15 16:28:12 2012 +0100
@@ -7,7 +7,7 @@ static const char *vif_internal_usec_re 
 static void xlu__vif_err(XLU_Config *cfg, const char *msg, const char *rate) {
     fprintf(cfg->report,
             "%s: config parsing error in vif: %s in `%s'\n",
-            cfg->filename, msg, rate);
+            cfg->config_source, msg, rate);
 }
 
 static int vif_parse_rate_bytes_per_sec(XLU_Config *cfg, const char *bytes,

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.