Cleanup and splitting of xl.cfg parsing
cover Cleanup and splitting of xl.cfg parsing
Is there a freeze on that I'm unaware of? Is there so much traffic from other developers that smaller output ones are being missed? I'm wondering about the initial revision of this series not getting any feedback:
https://lists.xenproject.org/archives/html/xen-devel/2023-07/msg01264.html
Due to the lack of news on the first thread, I've done some looking to assess the feasibility. The xl.cfg parser looks a bit jumbled. Too many things are visible to too many places. In general some pieces have really needed some TLC for a long time.
Note, some portions of this are semi-WIP. The first 5 patches are simply overdue maintenance. Not particularly urgent, but should probably be done.
Patch #06 is rather more urgent maintenance. While it might not explode soon, that is a landmine.
Patch #07 is the first big issue. The roles of the various headers had never been sorted out. The underlying issue was more the contents of "libxlu_cfg_i.h" needed to be merged into "libxlu_cfg_y.h". Bison 2.3 may not have had the ability to embedded things into its header in 2010, but the functionality appears to have been present in Bison 3.3.
There is an issue of what level of indentation should be used in libxlu_cfg_y.y? Normally the sections being added wouldn't be indented, but normally they would be directly in headers. I'm unsure of which direction to go here.
Patch #08 seemed best to leave after #07 due to overlap and difficulty with reordering. I'm a bit worried about the interfacing with flex.
Then comes the issue of moving things out of libxlu_internal.h which should never have been there. The XLU_Config* values should have been placed in libxlu_cfg_i.h instead. Since I'm doing a thorough job, they're instead moving to libxlu_cfg.c.
I'm unsure splitting libxlu_cfg.c is worthwhile. The resultant reusable libxlu_cfg.c is rather small. Yet avoiding the need to reimplement the small portion is handy.
Is the decision to keep in-tree copies of current Flex/Bison output still valid? I would be awful tempted to remove them from main/master, even if copies are maintained on release branches.
Elliott Mitchell (22):
tools/utils: cleanup formatting of libxlutil.h tools/utils: rename "n" arguments to "key"
tools/utils: remove old declaration of xlu__cfg_yyparse() tools/utils: enable all Bison warnings
tools/utils: update Bison parser directives
tools/utils: remove libxlu_cfg_i.h from libxlu_disk.c tools/utils: merge contents of libxlu_cfg_i.h to libxlu_cfg_y.y tools/utils: Bison: switch from name-prefix to api.prefix tools/utils: move CfgParseContext to top of libxlu_cfg_y.y tools/utils: move XLU_ConfigSetting to libxl_cfg.c tools/utils: move XLU_ConfigValue to libxl_cfg.c tools/utils: remove YYLTYPE definition from libxlu_internal.h tools/utils: move XLU_ConfigList to libxl_cfg.c tools/utils: introduce xlu_cfg_printf() function tools/utils: move XLU_Config to libxlu_cfg.c tools/utils: move XLU_Operation to libxlu_cfg_y.h tools/utils: move setting free loop to xlu__cfg_set_free() tools/utils: spread xlu_cfg_printf() over libxlu_cfg.c tools/utils: add pointer to in-progress settings to CfgParseContext tools/utils: add wrapper for readfile()/readdata() functions tools/utils: add settings get function
tools/utils: break flex/bison parser away from main config file
tools/include/libxlutil.h | 31 +-
tools/libs/util/Makefile | 3 +-
tools/libs/util/libxlu_cfg.c | 679 ++----------------
.../util/{libxlu_cfg.c => libxlu_cfg_i.c} | 196 +++--
tools/libs/util/libxlu_cfg_i.h | 59 --
tools/libs/util/libxlu_cfg_l.l | 2 +-
tools/libs/util/libxlu_cfg_y.y | 58 +-
tools/libs/util/libxlu_disk.c | 15 +-
tools/libs/util/libxlu_internal.h | 59 +-
tools/libs/util/libxlu_pci.c | 11 +-
tools/libs/util/libxlu_vif.c | 4 +-
11 files changed, 223 insertions(+), 894 deletions(-)
copy tools/libs/util/{libxlu_cfg.c => libxlu_cfg_i.c} (78%)
delete mode 100644 tools/libs/util/libxlu_cfg_i.hSignature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
PATCH 1/22 tools/utils: cleanup formatting of libxlutil.h
Some arguments included a name, but not all did. Now use "cfg" for all uses of XLU_Config * and "list" for uses of XLU_ConfigList *.
Also fix some spaces missing from xlu_cfg_get_defbool()'s prototype.
Rename the "b" argument of xlu_cfg_get_defbool() to "value_r". Similar to other functions this is where the returned value is stored.
--- tools/include/libxlutil.h | 22 +++++++++++----------- tools/libs/util/libxlu_cfg.c | 6 +++--- 2 files changed, 14 insertions(+), 14 deletions(-)
tools/include/libxlutil.h +11 -11
@@ -40,12 +40,12 @@ XLU_Config *xlu_cfg_init(FILE *report, const char *report_filename);/* report_filename is copied; report is saved and must remain valid * until the Config is destroyed. */ -int xlu_cfg_readfile (XLU_Config *,const char *real_filename); -int xlu_cfg_readdata (XLU_Config *,const char *data,int length); +int xlu_cfg_readfile (XLU_Config *cfg,const char *real_filename); +int xlu_cfg_readdata (XLU_Config *cfg,const char *data,int length);/* If these fail, then it is undefined behaviour to call xlu_cfg_get_... * functions. You have to just xlu_cfg_destroy. */ -void xlu_cfg_destroy (XLU_Config *); +void xlu_cfg_destroy (XLU_Config *cfg);/* All of the following print warnings to "report" if there is a problem.
@@ -56,26 +56,26 @@ void xlu_cfg_destroy(XLU_Config*);* ERANGE value out of range (from strtol) */ -int xlu_cfg_get_string (const XLU_Config *,const char *n,const char **value_r, -int dont_warn); +int xlu_cfg_get_string (const XLU_Config *cfg,const char *n, +const char **value_r,int dont_warn);/* free/strdup version */ int xlu_cfg_replace_string (const XLU_Config *cfg,const char *n,char **value_r,int dont_warn); -int xlu_cfg_get_long (const XLU_Config *,const char *n,long *value_r, +int xlu_cfg_get_long (const XLU_Config *cfg,const char *n,long *value_r,int dont_warn); -int xlu_cfg_get_bounded_long (const XLU_Config *,const char *n,long min, +int xlu_cfg_get_bounded_long (const XLU_Config *cfg,const char *n,long min,long max,long *value_r,int dont_warn); -int xlu_cfg_get_defbool (const XLU_Config *,const char *n,libxl_defbool *b, -int dont_warn); +int xlu_cfg_get_defbool (const XLU_Config *cfg,const char *n, +libxl_defbool *value_r,int dont_warn); -int xlu_cfg_get_list (const XLU_Config *,const char *n, +int xlu_cfg_get_list (const XLU_Config *cfg,const char *n,XLU_ConfigList **list_r/* may be 0 */ ,int *entries_r/* may be 0 */ ,int dont_warn);/* there is no need to free *list_r; lifetime is that of the XLU_Config */ int xlu_cfg_get_list_as_string_list (const XLU_Config *cfg,const char *n,libxl_string_list *sl,int dont_warn); -const char *xlu_cfg_get_listitem (const XLU_ConfigList *,int entry); +const char *xlu_cfg_get_listitem (const XLU_ConfigList *list,int entry);/* xlu_cfg_get_listitem cannot fail, except that if entry is * out of range it returns 0 (not setting errno) */
tools/libs/util/libxlu_cfg.c +3 -3
@@ -328,15 +328,15 @@ int xlu_cfg_get_long(const XLU_Config *cfg, const char *n, dont_warn); } -int xlu_cfg_get_defbool (const XLU_Config *cfg,const char *n,libxl_defbool *b, -int dont_warn) +int xlu_cfg_get_defbool (const XLU_Config *cfg,const char *n, +libxl_defbool *value_r,int dont_warn) {int ret;long l; ret =xlu_cfg_get_long (cfg, n, &l, dont_warn);if (ret)return ret; -libxl_defbool_set (b, !!l); +libxl_defbool_set (value_r, !!l);return 0 ; }
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
PATCH 2/22 tools/utils: rename "n" arguments to "key"
In reply to Elliott MitchellHopefully make it clearer to others this is the key associated with the storage value to retrieve.
--- tools/include/libxlutil.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
tools/include/libxlutil.h +7 -7
@@ -56,24 +56,24 @@ void xlu_cfg_destroy(XLU_Config *cfg);* ERANGE value out of range (from strtol) */ -int xlu_cfg_get_string (const XLU_Config *cfg,const char *n, +int xlu_cfg_get_string (const XLU_Config *cfg,const char *key,const char **value_r,int dont_warn);/* free/strdup version */ -int xlu_cfg_replace_string (const XLU_Config *cfg,const char *n, +int xlu_cfg_replace_string (const XLU_Config *cfg,const char *key,char **value_r,int dont_warn); -int xlu_cfg_get_long (const XLU_Config *cfg,const char *n,long *value_r, +int xlu_cfg_get_long (const XLU_Config *cfg,const char *key,long *value_r,int dont_warn); -int xlu_cfg_get_bounded_long (const XLU_Config *cfg,const char *n,long min, +int xlu_cfg_get_bounded_long (const XLU_Config *cfg,const char *key,long min,long max,long *value_r,int dont_warn); -int xlu_cfg_get_defbool (const XLU_Config *cfg,const char *n, +int xlu_cfg_get_defbool (const XLU_Config *cfg,const char *key,libxl_defbool *value_r,int dont_warn); -int xlu_cfg_get_list (const XLU_Config *cfg,const char *n, +int xlu_cfg_get_list (const XLU_Config *cfg,const char *key,XLU_ConfigList **list_r/* may be 0 */ ,int *entries_r/* may be 0 */ ,int dont_warn);/* there is no need to free *list_r; lifetime is that of the XLU_Config */ -int xlu_cfg_get_list_as_string_list (const XLU_Config *cfg,const char *n, +int xlu_cfg_get_list_as_string_list (const XLU_Config *cfg,const char *key,libxl_string_list *sl,int dont_warn);const char *xlu_cfg_get_listitem (const XLU_ConfigList *list,int entry);/* xlu_cfg_get_listitem cannot fail, except that if entry is
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
PATCH 3/22 tools/utils: remove old declaration of xlu__cfg_yyparse()
In reply to Elliott MitchellThis was added at b104c3762dc. Appears this was fixed in the intervening decade. Otherwise this could have been an issue from using advanced features of Bison. Now this appears unnecessary.
--- tools/libs/util/libxlu_cfg_i.h | 6 ------ 1 file changed, 6 deletions(-)
tools/libs/util/libxlu_cfg_i.h +0 -6
@@ -42,12 +42,6 @@ void xlu__cfgl_lexicalerror(CfgParseContext*, char const *msg);void xlu__cfgl_likely_python (CfgParseContext *ctx); - - -/* Why oh why does bison not declare this in its autogenerated .h ? */ -int xlu__cfg_yyparse (CfgParseContext *ctx); - -#endif /*LIBXLU_CFG_I_H*/ /*
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
PATCH 4/22 tools/utils: enable all Bison warnings
In reply to Elliott MitchellWarnings from Bison seem less likely to be urgent, but on general principle enable everything.
--- tools/libs/util/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/libs/util/Makefile +1 -1
@@ -50,7 +50,7 @@ $(OBJS-y) $(PIC_OBJS): libxlu_cfg_l.c libxlu_cfg_y.c libxlu_disk_l.c %.c %.h:: %.y @rm -f $*.[ch] - $(BISON) --output=$*.c $< + $(BISON) -Wall --output=$*.c $< %.c %.h:: %.l @rm -f $*.[ch]
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
PATCH 5/22 tools/utils: update Bison parser directives
In reply to Elliott MitchellUpdate per Bison's obsolete warnings. Testing indicates these are simple and safe.
---
Someone check for acceptable Bison versions?
I'm testing with Flex 2.6.4 and Bison 3.7.5.
--- tools/libs/util/libxlu_cfg_y.y | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
tools/libs/util/libxlu_cfg_y.y +5 -6
@@ -28,9 +28,9 @@ } %locations -%pure-parser +%define api.pure %defines -%error-verbose +%define parse.error verbose %name-prefix "xlu__cfg_yy" %parse-param { CfgParseContext *ctx } %lex-param { ctx_scanner }
@@ -48,7 +48,7 @@ file: stmts | stmts assignment -stmts: /* empty */ +stmts: %empty | stmts stmt stmt: assignment endstmt
@@ -67,13 +67,12 @@ value: atom { $$= xlu__cfg_string_mk(ctx,$1,&@1); } atom: STRING { $$= $1; } | NUMBER { $$= $1; } -valuelist: /* empty */ { $$= xlu__cfg_list_mk(ctx,NULL,&yylloc); } +valuelist: %empty { $$= xlu__cfg_list_mk(ctx,NULL,&yylloc); } | values { $$= $1; } | values ',' nlok { $$= $1; } values: value nlok { $$= xlu__cfg_list_mk(ctx,$1,&@1); } | values ',' nlok value nlok { xlu__cfg_list_append(ctx,$1,$4); $$= $1; } -nlok: - /* nothing */ +nlok: %empty | nlok NEWLINE
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
PATCH 6/22 tools/utils: remove libxlu_cfg_i.h from libxlu_disk.c
In reply to Elliott MitchellThe upper layer disk string parser doesn't need the internals of the lower layer file parser. Split the layers apart. This looks to have been a copy&paste issue.
--- tools/libs/util/libxlu_disk.c | 1 - 1 file changed, 1 deletion(-)
tools/libs/util/libxlu_disk.c +0 -1
@@ -1,7 +1,6 @@#include "libxlu_internal.h" #include "libxlu_disk_l.h" #include "libxlu_disk_i.h" -#include "libxlu_cfg_i.h" void xlu__disk_err (DiskParseContext *dpc,const char *erroneous,const char *message) {
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
PATCH 7/22 tools/utils: merge contents of libxlu_cfg_i.h to libxlu_cfg_y.y
In reply to Elliott MitchellBison has added the ability to emit declarations in its header. As such everything can instead be dumped in Bison's header instead of having a private one.
This resolves the mixed up situation with the libxlu headers. Problem is libxlu_cfg_i.h was trying to function as a wrapper for libxlu_cfg_y.h. Issue is libxlu_cfg.c's #include order didn't match and thus everything was fragile.
---
The bug @b104c3762d was the incorrect ordering of #includes in libxlu_cfg.c. It should instead have been:
#include "libxlu_cfg_i.h"
#include "libxlu_cfg_l.h"
Had this bug not been present, later commits might have looked deeper and chosen correct solutions. Instead this resulted in all the ripples which this series fixes.
I'm unsure whether Bison had implemented the %code feature by this point in time.
The one and a half remaining issues are whether to convert the %{ %} section to %code and move it after the %union. The %union construct ends up in libxlu_cfg_y.h, whereas the %{ %}/%code construct ends up in libxlu_cfg_y.c.
--- tools/libs/util/libxlu_cfg.c | 1 - tools/libs/util/libxlu_cfg_i.h | 53 ---------------------------------- tools/libs/util/libxlu_cfg_l.l | 2 +- tools/libs/util/libxlu_cfg_y.y | 29 ++++++++++++++++++- 4 files changed, 29 insertions(+), 56 deletions(-) delete mode 100644 tools/libs/util/libxlu_cfg_i.h
tools/libs/util/libxlu_cfg.c +0 -1
@@ -22,7 +22,6 @@#include "libxlu_internal.h" #include "libxlu_cfg_y.h" #include "libxlu_cfg_l.h" -#include "libxlu_cfg_i.h" XLU_Config *xlu_cfg_init (FILE *report,const char *report_source) {XLU_Config *cfg;
tools/libs/util/libxlu_cfg_i.h deleted +0 -53
53 lines not on this page · raw message
tools/libs/util/libxlu_cfg_l.l +1 -1
@@ -17,7 +17,7 @@ */ %{ -#include "libxlu_cfg_i.h" +#include "libxlu_cfg_y.h" #define ctx ((CfgParseContext*)yyextra) #define YY_NO_INPUT
tools/libs/util/libxlu_cfg_y.y +28 -1
@@ -16,9 +16,36 @@ * GNU Lesser General Public License for more details. */ +%code requires { +#include "libxlu_internal.h" +} + +%code provides { +void xlu__cfg_set_free(XLU_ConfigSetting *set); +void xlu__cfg_set_store(CfgParseContext*, char *name, + enum XLU_Operation op, + XLU_ConfigValue *val, int lineno); +XLU_ConfigValue *xlu__cfg_string_mk(CfgParseContext *ctx, + char *atom, YYLTYPE *loc); +XLU_ConfigValue *xlu__cfg_list_mk(CfgParseContext *ctx, + XLU_ConfigValue *val, + YYLTYPE *loc); +void xlu__cfg_list_append(CfgParseContext *ctx, + XLU_ConfigValue *list, + XLU_ConfigValue *val); +void xlu__cfg_value_free(XLU_ConfigValue *value); +char *xlu__cfgl_strdup(CfgParseContext*, const char *src); +char *xlu__cfgl_dequote(CfgParseContext*, const char *src); + +void xlu__cfg_yyerror(YYLTYPE *locp, CfgParseContext*, char const *msg); +void xlu__cfgl_lexicalerror(CfgParseContext*, char const *msg); + +void xlu__cfgl_likely_python(CfgParseContext *ctx); +} + %{ #define ctx_scanner ctx->scanner -#include "libxlu_cfg_i.h" +#include "libxlu_cfg_y.h" #include "libxlu_cfg_l.h" %}
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
PATCH 8/22 tools/utils: Bison: switch from name-prefix to api.prefix
In reply to Elliott Mitchellbison -Wall declares %name-prefix deprecated. The suggested replacement is "api.prefix". "api.prefix" though effects rather a lot more places than %name-prefix does. As a result, rename YYLTYPE/YYSTYPE to match.
As a quick workaround #define YYLTYPE/YYSTYPE to convince flex to interface correctly.
---
According to the documentation api.prefix was introduced in Bison 2.6, while braces became recommended with Bison 3.0. This seems sufficiently in the past to be worth adopting now.
A better workaround for flex is needed.
--- tools/libs/util/libxlu_cfg.c | 9 +++++---- tools/libs/util/libxlu_cfg_y.y | 13 +++++++++---- tools/libs/util/libxlu_internal.h | 8 ++++---- 3 files changed, 18 insertions(+), 12 deletions(-)
tools/libs/util/libxlu_cfg.c +5 -4
@@ -388,7 +388,7 @@ const char *xlu_cfg_get_listitem(const XLU_ConfigList *list, int entry) {XLU_ConfigValue *xlu__cfg_string_mk (CfgParseContext *ctx,char *atom, -YYLTYPE *loc) +XLU__CFG_YYLTYPE *loc) {XLU_ConfigValue *value =NULL ;
@@ -412,7 +412,7 @@ XLU_ConfigValue *xlu__cfg_string_mk(CfgParseContext *ctx, char *atom,XLU_ConfigValue *xlu__cfg_list_mk (CfgParseContext *ctx,XLU_ConfigValue *val, -YYLTYPE *loc) +XLU__CFG_YYLTYPE *loc) {XLU_ConfigValue *value =NULL ;XLU_ConfigValue **values =NULL ;
@@ -667,13 +667,14 @@ char *xlu__cfgl_dequote(CfgParseContext *ctx, const char *src) { }void xlu__cfgl_lexicalerror (CfgParseContext *ctx,char const *msg) { -YYLTYPE loc; +XLU__CFG_YYLTYPE loc; loc.first_line=xlu__cfg_yyget_lineno (ctx->scanner);xlu__cfg_yyerror (&loc, ctx, msg); ctx->lexerrlineno= loc.first_line; } -void xlu__cfg_yyerror (YYLTYPE *loc,CfgParseContext *ctx,char const *msg) { +void xlu__cfg_yyerror (XLU__CFG_YYLTYPE *loc,CfgParseContext *ctx, +char const *msg) {const char *text, *newline;int len, lineno;
tools/libs/util/libxlu_cfg_y.y +9 -4
@@ -26,10 +26,10 @@ void xlu__cfg_set_store(CfgParseContext*, char *name, enum XLU_Operation op, XLU_ConfigValue *val, int lineno); XLU_ConfigValue *xlu__cfg_string_mk(CfgParseContext *ctx, - char *atom, YYLTYPE *loc); + char *atom, XLU__CFG_YYLTYPE *loc); XLU_ConfigValue *xlu__cfg_list_mk(CfgParseContext *ctx, XLU_ConfigValue *val, - YYLTYPE *loc); + XLU__CFG_YYLTYPE *loc); void xlu__cfg_list_append(CfgParseContext *ctx, XLU_ConfigValue *list, XLU_ConfigValue *val);
@@ -37,10 +37,15 @@ void xlu__cfg_value_free(XLU_ConfigValue *value); char *xlu__cfgl_strdup(CfgParseContext*, const char *src); char *xlu__cfgl_dequote(CfgParseContext*, const char *src); -void xlu__cfg_yyerror(YYLTYPE *locp, CfgParseContext*, char const *msg); +void xlu__cfg_yyerror(XLU__CFG_YYLTYPE *locp, CfgParseContext*, + char const *msg); void xlu__cfgl_lexicalerror(CfgParseContext*, char const *msg); void xlu__cfgl_likely_python(CfgParseContext *ctx); + +/* issue of name-prefix versus api.prefix and Flex Bison-bridge */ +#define YYLTYPE XLU__CFG_YYLTYPE +#define YYSTYPE XLU__CFG_YYSTYPE } %{
@@ -58,7 +63,7 @@ void xlu__cfgl_likely_python(CfgParseContext *ctx); %define api.pure %defines %define parse.error verbose -%name-prefix "xlu__cfg_yy" +%define api.prefix {xlu__cfg_yy} %parse-param { CfgParseContext *ctx } %lex-param { ctx_scanner }
tools/libs/util/libxlu_internal.h +4 -4
@@ -31,14 +31,14 @@ struct XLU_ConfigList {XLU_ConfigValue **values; }; -typedef struct YYLTYPE +typedef struct XLU__CFG_YYLTYPE {int first_line;int first_column;int last_line;int last_column; -}YYLTYPE ; -#define YYLTYPE_IS_DECLARED +}XLU__CFG_YYLTYPE ; +#define XLU__CFG_YYLTYPE_IS_DECLARED struct XLU_ConfigValue {enum XLU_ConfigValueType type;
@@ -46,7 +46,7 @@ struct XLU_ConfigValue {char *string;XLU_ConfigList list; } u; -YYLTYPE loc; +XLU__CFG_YYLTYPE loc; }; typedef struct XLU_ConfigSetting { /* transparent */
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
PATCH 9/22 tools/utils: move CfgParseContext to top of libxlu_cfg_y.y
In reply to Elliott MitchellThe CfgParseContext structure/typedef is used inside the parser. Whereas most #include's of libxlu_internal.h need the common declarations, not the parser internals. Due to this, the structure should be near the top of libxlu_cfg_y.h (libxlu_cfg_i.h @b104c3762d), and not towards the middle of libxlu_internal.h.
---
Ideally at @b104c3762d Bison might already have implemented its %code feature. Less ideal, but workable CfgParseContext should have been placed in libxlu_cfg_i.h, between the two #includes:
#include "libxlu_internal.h"
typedef struct { } CfgParseContext;
#include "libxlu_cfg_y.h"
Using Bison's %code feature is rather superior though. This patch is where indentation in Bison.y files becomes crucial. I'm unsure of the call to make, so I've left this as cut&paste which means this will almost certainly change.
--- tools/libs/util/libxlu_cfg_y.y | 6 ++++++ tools/libs/util/libxlu_internal.h | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-)
tools/libs/util/libxlu_cfg_y.y +6 -0
@@ -18,6 +18,12 @@ %code requires { #include "libxlu_internal.h" + +typedef struct { + XLU_Config *cfg; + int err, lexerrlineno, likely_python; + void *scanner; +} CfgParseContext; } %code provides {
tools/libs/util/libxlu_internal.h +0 -6
@@ -63,12 +63,6 @@ struct XLU_Config {char *config_source; }; -typedef struct { -XLU_Config *cfg; -int err, lexerrlineno, likely_python; -void *scanner; -}CfgParseContext ; -#define STRINGIFY (x) #x#define TOSTRING (x) STRINGIFY(x)
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
PATCH 10/22 tools/utils: move XLU_ConfigSetting to libxl_cfg.c
In reply to Elliott MitchellXLU_ConfigSetting is only used inside libxl_cfg.c, so no need for it in the internal header. Keep the type definition in libxlu_internal.h as the incomplete definition is needed for xlu__cfg_set_free().
There is no longer any need for XLU_ConfigSetting to be transparent.
---
@1a09c5113a deeper probing should have been done and figured out everything needed to move to libxlu_cfg_i.h. Making use of %code would have been better, but moving would have been sufficient.
Note: If the decision is made to keep libxlu_cfg.c intact, then the type definition should be in libxlu_cfg_y.y/libxlu_cfg_y.h.
--- tools/libs/util/libxlu_cfg.c | 8 ++++++++ tools/libs/util/libxlu_internal.h | 8 +------- 2 files changed, 9 insertions(+), 7 deletions(-)
tools/libs/util/libxlu_cfg.c +8 -0
@@ -23,6 +23,14 @@#include "libxlu_cfg_y.h" #include "libxlu_cfg_l.h" +struct XLU_ConfigSetting { +struct XLU_ConfigSetting *next; +char *name; +XLU_ConfigValue *value; +enum XLU_Operation op; +int lineno; +}; +XLU_Config *xlu_cfg_init (FILE *report,const char *report_source) {XLU_Config *cfg;
tools/libs/util/libxlu_internal.h +1 -7
@@ -49,13 +49,7 @@ struct XLU_ConfigValue {XLU__CFG_YYLTYPE loc; }; -typedef struct XLU_ConfigSetting {/* transparent */ -struct XLU_ConfigSetting *next; -char *name; -XLU_ConfigValue *value; -enum XLU_Operation op; -int lineno; -}XLU_ConfigSetting ; +typedef struct XLU_ConfigSetting XLU_ConfigSetting ;struct XLU_Config {XLU_ConfigSetting *settings;
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
PATCH 11/22 tools/utils: move XLU_ConfigValue to libxl_cfg.c
In reply to Elliott MitchellAt no point was the complete type for XLU_ConfigValue used anywhere besides libxlu_cfg.c, overdue for a move.
--- tools/libs/util/libxlu_cfg.c | 9 +++++++++ tools/libs/util/libxlu_internal.h | 9 --------- 2 files changed, 9 insertions(+), 9 deletions(-)
tools/libs/util/libxlu_cfg.c +9 -0
@@ -31,6 +31,15 @@ struct XLU_ConfigSetting {int lineno; }; +struct XLU_ConfigValue { +enum XLU_ConfigValueType type; +union { +char *string; +XLU_ConfigList list; + } u; +XLU__CFG_YYLTYPE loc; +}; +XLU_Config *xlu_cfg_init (FILE *report,const char *report_source) {XLU_Config *cfg;
tools/libs/util/libxlu_internal.h +0 -9
@@ -40,15 +40,6 @@ typedef struct XLU__CFG_YYLTYPE }XLU__CFG_YYLTYPE ;#define XLU__CFG_YYLTYPE_IS_DECLARED -struct XLU_ConfigValue { -enum XLU_ConfigValueType type; -union { -char *string; -XLU_ConfigList list; - } u; -XLU__CFG_YYLTYPE loc; -}; -typedef struct XLU_ConfigSetting XLU_ConfigSetting ;struct XLU_Config {
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
PATCH 12/22 tools/utils: remove YYLTYPE definition from libxlu_internal.h
In reply to Elliott MitchellThe definition was needed due to XLU_ConfigValue being before Bison's declaration of YYLTYPE. Since XLU_ConfigValue has moved to libxlu_cfg.c, the duplication is now unnecessary.
---
Had @1a09c5113a placed the structure definition in libxlu_cfg_i.h, there never would have been a need to override YYLTYPE.
--- tools/libs/util/libxlu_internal.h | 9 --------- 1 file changed, 9 deletions(-)
tools/libs/util/libxlu_internal.h +0 -9
@@ -31,15 +31,6 @@ struct XLU_ConfigList {XLU_ConfigValue **values; }; -typedef struct XLU__CFG_YYLTYPE -{ -int first_line; -int first_column; -int last_line; -int last_column; -}XLU__CFG_YYLTYPE ; -#define XLU__CFG_YYLTYPE_IS_DECLARED -typedef struct XLU_ConfigSetting XLU_ConfigSetting ;struct XLU_Config {
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
PATCH 13/22 tools/utils: move XLU_ConfigList to libxl_cfg.c
In reply to Elliott MitchellWith XLU_ConfigValue now in libxlu_cfg.c, XLU_ConfigList can follow.
---
Placing XLU_ConfigValue/XLU_ConfigList in libxlu_internal.h was certainly *wrong*.
--- tools/libs/util/libxlu_cfg.c | 6 ++++++ tools/libs/util/libxlu_internal.h | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-)
tools/libs/util/libxlu_cfg.c +6 -0
@@ -31,6 +31,12 @@ struct XLU_ConfigSetting {int lineno; }; +struct XLU_ConfigList { +int avalues;/* available slots */ +int nvalues;/* actual occupied slots */ +XLU_ConfigValue **values; +}; +struct XLU_ConfigValue {enum XLU_ConfigValueType type;union {
tools/libs/util/libxlu_internal.h +0 -6
@@ -25,12 +25,6 @@#include "libxlutil.h" -struct XLU_ConfigList { -int avalues;/* available slots */ -int nvalues;/* actual occupied slots */ -XLU_ConfigValue **values; -}; -typedef struct XLU_ConfigSetting XLU_ConfigSetting ;struct XLU_Config {
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
PATCH 14/22 tools/utils: introduce xlu_cfg_printf() function
In reply to Elliott MitchellIsolate the lower layer configuration handling from the upper layer. Now only the lowest layer of configuration handling looks inside XLU_Config.
Also make error messages a bit more consistent. Now PCI device parsing will report filename.
Replace the XLU__PCI_ERR() with xlu_cfg_printf(). The new function encompasses the full functionality of the macro.
---
Someone else can decide where xlu__disk_err() should have its linebreaks and indentation. That string isn't very good.
I'm wondering about the return codes. *printf() can return errors, but so many places are ignoring them. If the output is a console the errors are fairly unlikely, but full storage does happen.
--- tools/libs/util/libxlu_cfg.c | 23 +++++++++++++++++++++++ tools/libs/util/libxlu_disk.c | 14 +++++--------- tools/libs/util/libxlu_internal.h | 4 ++++ tools/libs/util/libxlu_pci.c | 11 ++++------- tools/libs/util/libxlu_vif.c | 4 +--- 5 files changed, 37 insertions(+), 19 deletions(-)
tools/libs/util/libxlu_cfg.c +23 -0
@@ -18,6 +18,7 @@#define _GNU_SOURCE#include <limits.h> +#include <stdarg.h> #include "libxlu_internal.h" #include "libxlu_cfg_y.h"
@@ -191,6 +192,28 @@ void xlu_cfg_destroy(XLU_Config *cfg) {free (cfg); } +int xlu_cfg_printf (const XLU_Config *cfg,const char *format, ...) +{ +va_list args; +int ret; + +if (!cfg || !cfg->report) +return EFAULT ; + + ret =fputs (cfg->config_source, cfg->report); +if (ret <0 ) +return -errno; + ret =fputc (':' , cfg->report); +if (ret <0 ) +return -errno; + +va_start (args, format); + ret =vfprintf (cfg->report, format, args); +va_end (args); + +return -errno; +} +static XLU_ConfigSetting *find (const XLU_Config *cfg,const char *n) {XLU_ConfigSetting *set;
tools/libs/util/libxlu_disk.c +5 -9
@@ -4,13 +4,10 @@void xlu__disk_err (DiskParseContext *dpc,const char *erroneous,const char *message) { -fprintf (dpc->cfg->report, -"%s: config parsing error in disk specification: %s" -"%s%s%s" -" in `%s'\n" , - dpc->cfg->config_source, message, - erroneous?": near `" :"" , erroneous?erroneous:"" , erroneous?"'" :"" , - dpc->spec); +xlu_cfg_printf (dpc->cfg, +" config parsing error in disk specification: %s%s%s%s in `%s'\n" , + message, erroneous?": near `" :"" , erroneous?erroneous:"" , + erroneous?"'" :"" , dpc->spec);if (!dpc->err) dpc->err=EINVAL ; }
@@ -28,8 +25,7 @@ static int dpc_prep(DiskParseContext *dpc, const char *spec) {return 0 ; fail: -fprintf (dpc->cfg->report,"cannot init disk scanner: %s\n" , -strerror (errno)); +xlu_cfg_printf (dpc->cfg," cannot init disk scanner: %s\n" ,strerror (errno));return e; }
tools/libs/util/libxlu_internal.h +4 -0
@@ -37,6 +37,10 @@ struct XLU_Config {#define STRINGIFY (x) #x#define TOSTRING (x) STRINGIFY(x) + +extern int xlu_cfg_printf (const XLU_Config *cfg,const char *format, ...) + __attribute__((__format__ (__printf__,2 ,3 ))); +#endif /*LIBXLU_INTERNAL_H*/ /*
tools/libs/util/libxlu_pci.c +4 -7
@@ -5,9 +5,6 @@#include "libxlu_internal.h" -#define XLU__PCI_ERR(_c, _x, _a...) \ - if((_c) && (_c)->report) fprintf((_c)->report, _x, ##_a) -static int parse_bdf (libxl_device_pci *pci,const char *str,const char **endp) {const char *ptr = str;
@@ -129,7 +126,7 @@ static int parse_rdm_policy(XLU_Config *cfg, libxl_rdm_reserve_policy *policy,int ret =libxl_rdm_reserve_policy_from_string (str, policy);if (ret) -XLU__PCI_ERR (cfg,"Unknown RDM policy: %s" , str); +xlu_cfg_printf (cfg," Unknown RDM policy: %s" , str);return ret; }
@@ -193,7 +190,7 @@ int xlu_pci_parse_spec_string(XLU_Config *cfg, libxl_device_pci *pci, pci->name =strdup (val);if (!pci->name) ret =ERROR_NOMEM ; }else { -XLU__PCI_ERR (cfg,"Unknown PCI_SPEC_STRING option: %s" , key); +xlu_cfg_printf (cfg," Unknown PCI_SPEC_STRING option: %s" , key); ret =ERROR_INVAL ; }
@@ -233,7 +230,7 @@ int xlu_rdm_parse(XLU_Config *cfg, libxl_rdm_reserve *rdm, const char *str) }else if (!strcmp (tok,"policy" )) { state =STATE_RESERVE_POLICY ; }else { -XLU__PCI_ERR (cfg,"Unknown RDM state option: %s" , tok); +xlu_cfg_printf (cfg," Unknown RDM state option: %s" , tok); goto parse_error; } tok = ptr +1 ;
@@ -246,7 +243,7 @@ int xlu_rdm_parse(XLU_Config *cfg, libxl_rdm_reserve *rdm, const char *str)if (!strcmp (tok,"host" )) { rdm->strategy =LIBXL_RDM_RESERVE_STRATEGY_HOST ; }else { -XLU__PCI_ERR (cfg,"Unknown RDM strategy option: %s" , tok); +xlu_cfg_printf (cfg," Unknown RDM strategy option: %s" , tok); goto parse_error; } tok = ptr +1 ;
tools/libs/util/libxlu_vif.c +1 -3
@@ -6,9 +6,7 @@ static const char *vif_bytes_per_sec_re = "^[0-9]+[GMK]?[Bb]/s$";static const char *vif_internal_usec_re ="^[0-9]+[mu]?s?$" ;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->config_source, msg, rate); +xlu_cfg_printf (cfg," config parsing error in vif: %s in `%s'\n" , msg, rate); } static int vif_parse_rate_bytes_per_sec(XLU_Config *cfg, const char *bytes,
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
PATCH 15/22 tools/utils: move XLU_Config to libxlu_cfg.c
In reply to Elliott MitchellOnly the lowest layer of configuration handling looks inside XLU_Config. As such the structure can move to this header instead of the shared header.
Mark ->config_source as constant. Most places it truly is constant, only the free() violates the constant.
---
This could also move to libxlu_cfg_y.h and make preserving messages easier while allowing libxlu_cfg.c to split.
--- tools/libs/util/libxlu_cfg.c | 8 +++++++- tools/libs/util/libxlu_internal.h | 6 ------ 2 files changed, 7 insertions(+), 7 deletions(-)
tools/libs/util/libxlu_cfg.c +7 -1
@@ -47,6 +47,12 @@ struct XLU_ConfigValue {XLU__CFG_YYLTYPE loc; }; +struct XLU_Config { +XLU_ConfigSetting *settings; +FILE *report; +const char *config_source; +}; +XLU_Config *xlu_cfg_init (FILE *report,const char *report_source) {XLU_Config *cfg;
@@ -188,7 +194,7 @@ void xlu_cfg_destroy(XLU_Config *cfg) { set_next= set->next;xlu__cfg_set_free (set); } -free (cfg->config_source); +free ((void *)cfg->config_source);free (cfg); }
tools/libs/util/libxlu_internal.h +0 -6
@@ -27,12 +27,6 @@typedef struct XLU_ConfigSetting XLU_ConfigSetting ; -struct XLU_Config { -XLU_ConfigSetting *settings; -FILE *report; -char *config_source; -}; -#define STRINGIFY (x) #x#define TOSTRING (x) STRINGIFY(x)
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
PATCH 16/22 tools/utils: move XLU_Operation to libxlu_cfg_y.h
In reply to Elliott MitchellThis enumerated value is never used outside of the lowest layer of the configuration parser. As such, move to the internal header.
---
I'm unsure whether this is fixing a30910bfd7. Placing XLU_Operation in libxlutil.h was certainly erroneous, but it is quite unlikely to directly result in actual bugs.
--- tools/include/libxlutil.h | 5 ----- tools/libs/util/libxlu_cfg_y.y | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-)
tools/include/libxlutil.h +0 -5
@@ -25,11 +25,6 @@ enum XLU_ConfigValueType { XLU_LIST, }; -enum XLU_Operation { -XLU_OP_ASSIGNMENT =0 , -XLU_OP_ADDITION , -}; -/* Unless otherwise stated, all functions return an errno value. */ typedef struct XLU_Config XLU_Config ;typedef struct XLU_ConfigList XLU_ConfigList ;
tools/libs/util/libxlu_cfg_y.y +5 -0
@@ -27,6 +27,11 @@ typedef struct { } %code provides { +enum XLU_Operation { + XLU_OP_ASSIGNMENT = 0, + XLU_OP_ADDITION, +}; + void xlu__cfg_set_free(XLU_ConfigSetting *set); void xlu__cfg_set_store(CfgParseContext*, char *name, enum XLU_Operation op,
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
PATCH 17/22 tools/utils: move setting free loop to xlu__cfg_set_free()
In reply to Elliott MitchellThis better breaks layers apart. xlu_cfg_destroy() now only knows about the XLU_Config structure, while xlu__cfg_set_free() knows about XLU_ConfigSetting.
Move declaration of xlu__cfg_set_free() to shared header to indicate it will bridge layers.
---
This is the end of the higher-value series. Moving the loop is appropriate whether or not libxlu_cfg.c is split.
Moving the declaration and patches after this though are mostly valuable for splitting libxlu_cfg.c into reusable and non-reusable portions.
--- tools/libs/util/libxlu_cfg.c | 20 ++++++++------------ tools/libs/util/libxlu_cfg_y.y | 1 - tools/libs/util/libxlu_internal.h | 5 +++++ 3 files changed, 13 insertions(+), 13 deletions(-)
tools/libs/util/libxlu_cfg.c +8 -12
@@ -178,22 +178,18 @@ void xlu__cfg_value_free(XLU_ConfigValue *value) }void xlu__cfg_set_free (XLU_ConfigSetting *set) { -if (!set)return ; -free (set->name); -xlu__cfg_value_free (set->value); -free (set); +while (set) { +XLU_ConfigSetting *next = set->next; +free (set->name); +xlu__cfg_value_free (set->value); +free (set); + set = next; + } }void xlu_cfg_destroy (XLU_Config *cfg) { -XLU_ConfigSetting *set, *set_next; -if (!cfg)return ; -for (set= cfg->settings; - set; - set= set_next) { - set_next= set->next; -xlu__cfg_set_free (set); - } +xlu__cfg_set_free (cfg->settings);free ((void *)cfg->config_source);free (cfg); }
tools/libs/util/libxlu_cfg_y.y +0 -1
@@ -32,7 +32,6 @@ enum XLU_Operation { XLU_OP_ADDITION, }; -void xlu__cfg_set_free(XLU_ConfigSetting *set); void xlu__cfg_set_store(CfgParseContext*, char *name, enum XLU_Operation op, XLU_ConfigValue *val, int lineno);
tools/libs/util/libxlu_internal.h +5 -0
@@ -35,6 +35,11 @@ typedef struct XLU_ConfigSetting XLU_ConfigSetting;extern int xlu_cfg_printf (const XLU_Config *cfg,const char *format, ...) __attribute__((__format__ (__printf__,2 ,3 ))); +/* +* Internals for file parser *only*, NOT to be used by other parsing/lexing +*/ +extern void xlu__cfg_set_free (XLU_ConfigSetting *set); +#endif /*LIBXLU_INTERNAL_H*/ /*
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
PATCH 18/22 tools/utils: spread xlu_cfg_printf() over libxlu_cfg.c
In reply to Elliott MitchellThere are far more printf()s inside libxlu_cfg.c, so these had been left alone briefly. Now attack all of these.
---
Note, several messages change mildly. The message in parse() didn't previously include the filename.
--- tools/libs/util/libxlu_cfg.c | 78 ++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 43 deletions(-)
tools/libs/util/libxlu_cfg.c +35 -43
@@ -78,8 +78,7 @@ static int ctx_prep(CfgParseContext *ctx, XLU_Config *cfg) { e=xlu__cfg_yylex_init_extra (ctx, &ctx->scanner);if (e) { -fprintf (cfg->report,"%s: unable to create scanner: %s\n" , - cfg->config_source,strerror (e)); +xlu_cfg_printf (cfg," unable to create scanner: %s\n" ,strerror (e));return e; }return 0 ;
@@ -99,11 +98,12 @@ static void parse(CfgParseContext *ctx) {if (r)assert (ctx->err);if (ctx->err && ctx->likely_python) { -fputs ( -"warning: Config file looks like it contains Python code.\n" -"warning: Arbitrary Python is no longer supported.\n" -"warning: See https://wiki.xen.org/wiki/PythonInXlConfig\n" , - ctx->cfg->report); +xlu_cfg_printf (ctx->cfg, +" warning: Config file looks like it contains Python code.\n" ); +xlu_cfg_printf (ctx->cfg, +" warning: Arbitrary Python is no longer supported.\n" ); +xlu_cfg_printf (ctx->cfg, +" warning: See https://wiki.xen.org/wiki/PythonInXlConfig\n" ); } }
@@ -144,8 +144,7 @@ int xlu_cfg_readdata(XLU_Config *cfg, const char *data, int length) { buf =xlu__cfg_yy_scan_bytes (data, length, ctx.scanner);if (!buf) { -fprintf (cfg->report,"%s: unable to allocate scanner buffer\n" , - cfg->config_source); +xlu_cfg_printf (cfg," unable to allocate scanner buffer\n" ); ctx.err=ENOMEM ; goto xe; }
@@ -236,10 +235,10 @@ static int find_atom(const XLU_Config *cfg, const char *n,if (set->value->type!=XLU_STRING ) {if (!dont_warn) -fprintf (cfg->report, -"%s:%d: warning: parameter `%s' is" +xlu_cfg_printf (cfg, +"%d: warning: parameter `%s' is" " a list but should be a single value\n" , - cfg->config_source, set->lineno, n); + set->lineno, n);return EINVAL ; } *set_r= set;
@@ -257,10 +256,8 @@ int xlu_cfg_value_get_string(const XLU_Config *cfg, XLU_ConfigValue *value, {if (value->type !=XLU_STRING ) {if (!dont_warn) -fprintf (cfg->report, -"%s:%d:%d: warning: value is not a string\n" , - cfg->config_source, value->loc.first_line, - value->loc.first_column); +xlu_cfg_printf (cfg,"%d:%d: warning: value is not a string\n" , + value->loc.first_line, value->loc.first_column); *value_r =NULL ;return EINVAL ; }
@@ -274,10 +271,8 @@ int xlu_cfg_value_get_list(const XLU_Config *cfg, XLU_ConfigValue *value, {if (value->type !=XLU_LIST ) {if (!dont_warn) -fprintf (cfg->report, -"%s:%d:%d: warning: value is not a list\n" , - cfg->config_source, value->loc.first_line, - value->loc.first_column); +xlu_cfg_printf (cfg,"%d:%d: warning: value is not a list\n" , + value->loc.first_line, value->loc.first_column); *value_r =NULL ;return EINVAL ; }
@@ -325,10 +320,10 @@ int xlu_cfg_get_bounded_long(const XLU_Config *cfg, const char *n, e=find_atom (cfg,n,&set,dont_warn);if (e)return e;if (set->op ==XLU_OP_ADDITION ) {if (!dont_warn) -fprintf (cfg->report, -"%s:%d: warning: can't use += with numbers" +xlu_cfg_printf (cfg, +"%d: warning: can't use += with numbers" " for parameter `%s'\n" , - cfg->config_source, set->lineno, n); + set->lineno, n);return EINVAL ; } errno=0 ; l=strtol (set->value->u.string, &ep,0 );
@@ -337,31 +332,31 @@ int xlu_cfg_get_bounded_long(const XLU_Config *cfg, const char *n, e= errno;assert (e==EINVAL || e==ERANGE );if (!dont_warn) -fprintf (cfg->report, -"%s:%d: warning: parameter `%s' could not be parsed" +xlu_cfg_printf (cfg, +"%d: warning: parameter `%s' could not be parsed" " as a number: %s\n" , - cfg->config_source, set->lineno, n,strerror (e)); + set->lineno, n,strerror (e));return e; }if (*ep || ep==set->value->u.string) {if (!dont_warn) -fprintf (cfg->report, -"%s:%d: warning: parameter `%s' is not a valid number\n" , - cfg->config_source, set->lineno, n); +xlu_cfg_printf (cfg, +"%d: warning: parameter `%s' is not a valid number\n" , + set->lineno, n);return EINVAL ; }if (l < min) {if (!dont_warn) -fprintf (cfg->report, -"%s:%d: warning: value `%ld' is smaller than minimum bound '%ld'\n" , - cfg->config_source, set->lineno, l, min); +xlu_cfg_printf (cfg, +"%d: warning: value `%ld' is smaller than minimum bound '%ld'\n" , + set->lineno, l, min);return EINVAL ; }if (l > max) {if (!dont_warn) -fprintf (cfg->report, -"%s:%d: warning: value `%ld' is greater than maximum bound '%ld'\n" , - cfg->config_source, set->lineno, l, max); +xlu_cfg_printf (cfg, +"%d: warning: value `%ld' is greater than maximum bound '%ld'\n" , + set->lineno, l, max);return EINVAL ; }
@@ -393,10 +388,10 @@ int xlu_cfg_get_list(const XLU_Config *cfg, const char *n, set=find (cfg,n);if (!set)return ESRCH ;if (set->value->type!=XLU_LIST ) {if (!dont_warn) { -fprintf (cfg->report, -"%s:%d: warning: parameter `%s' is a single value" +xlu_cfg_printf (cfg, +"%d: warning: parameter `%s' is a single value" " but should be a list\n" , - cfg->config_source, set->lineno, n); + set->lineno, n); }return EINVAL ; }
@@ -743,11 +738,8 @@ void xlu__cfg_yyerror(XLU__CFG_YYLTYPE *loc, CfgParseContext *ctx, len--; } -fprintf (ctx->cfg->report, -"%s:%d: config parsing error near %s%.*s%s%s: %s\n" , - ctx->cfg->config_source, lineno, - len?"`" :"" , len, text, len?"'" :"" , newline, - msg); +xlu_cfg_printf (ctx->cfg,"%d: config parsing error near %s%.*s%s%s: %s\n" , + lineno, len?"`" :"" , len, text, len?"'" :"" , newline, msg);if (!ctx->err) ctx->err=EINVAL ; }
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
PATCH 19/22 tools/utils: add pointer to in-progress settings to CfgParseContext
In reply to Elliott MitchellRather than needing the full structure, for many operations the settings pointer is enough.
--- tools/libs/util/libxlu_cfg.c | 13 ++++++++----- tools/libs/util/libxlu_cfg_y.y | 1 + 2 files changed, 9 insertions(+), 5 deletions(-)
tools/libs/util/libxlu_cfg.c +8 -5
@@ -67,10 +67,13 @@ XLU_Config *xlu_cfg_init(FILE *report, const char *report_source) {return cfg; } -static int ctx_prep (CfgParseContext *ctx,XLU_Config *cfg) { +static int ctx_prep (CfgParseContext *ctx,XLU_Config *cfg, +XLU_ConfigSetting **psettings) +{int e; ctx->cfg= cfg; + ctx->psettings = psettings; ctx->err=0 ; ctx->lexerrlineno=-1 ; ctx->likely_python=0 ;
@@ -112,7 +115,7 @@ int xlu_cfg_readfile(XLU_Config *cfg, const char *real_filename) {int e;CfgParseContext ctx; - e =ctx_prep (&ctx, cfg); + e =ctx_prep (&ctx, cfg, &cfg->settings);if (e) { ctx.err= e; goto xe; } f=fopen (real_filename,"r" );
@@ -139,7 +142,7 @@ int xlu_cfg_readdata(XLU_Config *cfg, const char *data, int length) {YY_BUFFER_STATE buf=0 ;CfgParseContext ctx; - e=ctx_prep (&ctx, cfg); + e =ctx_prep (&ctx, cfg, &cfg->settings);if (e) { ctx.err= e; goto xe; } buf =xlu__cfg_yy_scan_bytes (data, length, ctx.scanner);
@@ -619,8 +622,8 @@ void xlu__cfg_set_store(CfgParseContext *ctx, char *name, set->value = val; set->op = op; set->lineno= lineno; - set->next= ctx->cfg->settings; - ctx->cfg->settings= set; + set->next = *ctx->psettings; + *ctx->psettings = set;return ; out:assert (ctx->err);
tools/libs/util/libxlu_cfg_y.y +1 -0
@@ -21,6 +21,7 @@ typedef struct { XLU_Config *cfg; + XLU_ConfigSetting **psettings; int err, lexerrlineno, likely_python; void *scanner; } CfgParseContext;
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
PATCH 20/22 tools/utils: add wrapper for readfile()/readdata() functions
In reply to Elliott MitchellThese functions needs to cross the boundary between core and lower-layer. As such split them in two. Pass most of the values from XLU_Config as they can be used by the lower-layer.
--- tools/libs/util/libxlu_cfg.c | 47 ++++++++++++++++++++++--------- tools/libs/util/libxlu_internal.h | 6 ++++ 2 files changed, 39 insertions(+), 14 deletions(-)
tools/libs/util/libxlu_cfg.c +33 -14
@@ -110,39 +110,58 @@ static void parse(CfgParseContext *ctx) { } } -int xlu_cfg_readfile (XLU_Config *cfg,const char *real_filename) { -FILE *f =0 ; +int xlu_cfg_readfile (XLU_Config *cfg,const char *name) +{ +FILE *file; +int ret; + + file =fopen (name,"r" ); +if (file) { + ret =xlu__cfg_readfile (cfg, cfg->report, cfg->config_source, + &cfg->settings, file, name); +fclose (file); + }else { + ret = errno; +fprintf (cfg->report,"%s: unable to open configuration file: %s\n" , + name,strerror (ret)); + } + +return ret; +} + +int xlu__cfg_readfile (XLU_Config *cfg,FILE *msgfile,const char *msgprefix, +XLU_ConfigSetting **psettings,FILE *f,const char *name) +{int e;CfgParseContext ctx; - e =ctx_prep (&ctx, cfg, &cfg->settings); + e =ctx_prep (&ctx, cfg, psettings);if (e) { ctx.err= e; goto xe; } - f=fopen (real_filename,"r" ); -if (!f) { - ctx.err = errno; -fprintf (cfg->report,"%s: unable to open configuration file: %s\n" , - real_filename,strerror (e)); - goto xe; - } -xlu__cfg_yyrestart (f, ctx.scanner);parse (&ctx); xe:ctx_dispose (&ctx); -if (f)fclose (f);return ctx.err; } -int xlu_cfg_readdata (XLU_Config *cfg,const char *data,int length) { +int xlu_cfg_readdata (XLU_Config *cfg,const char *data,int length) +{ +return xlu__cfg_readdata (cfg, cfg->report, cfg->config_source, + &cfg->settings, data, length); +} + +int xlu__cfg_readdata (XLU_Config *cfg,FILE *msgfile,const char *msgprefix, +XLU_ConfigSetting **psettings,const char *data,int length) +{int e;YY_BUFFER_STATE buf=0 ;CfgParseContext ctx; - e =ctx_prep (&ctx, cfg, &cfg->settings); + e =ctx_prep (&ctx, cfg, psettings);if (e) { ctx.err= e; goto xe; } buf =xlu__cfg_yy_scan_bytes (data, length, ctx.scanner);
tools/libs/util/libxlu_internal.h +6 -0
@@ -39,6 +39,12 @@ extern int xlu_cfg_printf(const XLU_Config *cfg, const char *format, ...)* Internals for file parser *only*, NOT to be used by other parsing/lexing */ extern void xlu__cfg_set_free (XLU_ConfigSetting *set); +extern int xlu__cfg_readfile (XLU_Config *cfg,FILE *msgfile, +const char *msgprefix,XLU_ConfigSetting **psettings,FILE *file, +const char *name); +extern int xlu__cfg_readdata (XLU_Config *cfg,FILE *msgfile, +const char *msgprefix,XLU_ConfigSetting **psettings,const char *data, +int length);#endif /*LIBXLU_INTERNAL_H*/
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
PATCH 21/22 tools/utils: add settings get function
In reply to Elliott MitchellThe better to isolate the shared portion of the interface from the low-level implementation.
--- tools/libs/util/libxlu_cfg.c | 7 ++++++- tools/libs/util/libxlu_internal.h | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-)
tools/libs/util/libxlu_cfg.c +6 -1
@@ -240,7 +240,7 @@ int xlu_cfg_printf(const XLU_Config *cfg, const char *format, ...)static XLU_ConfigSetting *find (const XLU_Config *cfg,const char *n) {XLU_ConfigSetting *set; -for (set= cfg->settings; +for (set =xlu__cfg_get_settings (cfg); set; set= set->next)if (!strcmp (set->name, n))
@@ -267,6 +267,11 @@ static int find_atom(const XLU_Config *cfg, const char *n,return 0 ; } +XLU_ConfigSetting *xlu__cfg_get_settings (const XLU_Config *cfg) +{ +return cfg->settings; +} +enum XLU_ConfigValueType xlu_cfg_value_type (const XLU_ConfigValue *value) {
tools/libs/util/libxlu_internal.h +2 -0
@@ -45,6 +45,8 @@ extern int xlu__cfg_readfile(XLU_Config *cfg, FILE *msgfile,extern int xlu__cfg_readdata (XLU_Config *cfg,FILE *msgfile,const char *msgprefix,XLU_ConfigSetting **psettings,const char *data,int length); +extern XLU_ConfigSetting *xlu__cfg_get_settings (const XLU_Config *cfg) + __attribute__((access (read_only,1 )));#endif /*LIBXLU_INTERNAL_H*/
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
PATCH 22/22 tools/utils: break flex/bison parser away from main config file
In reply to Elliott MitchellPotentially allowing a different parser to be substituted.
Omit libxlu_internal.h from libxlu_cfg_i.c, since it is kept in libxlu_cfg_y.h.
---
tools/libs/util/Makefile | 1 +
tools/libs/util/libxlu_cfg.c | 662 ------------------
.../util/{libxlu_cfg.c => libxlu_cfg_i.c} | 87 ---
3 files changed, 1 insertion(+), 749 deletions(-)
copy tools/libs/util/{libxlu_cfg.c => libxlu_cfg_i.c} (90%)tools/libs/util/Makefile +1 -0
@@ -3,6 +3,7 @@ include $(XEN_ROOT)/tools/Rules.mk OBJS-y += libxlu_cfg_y.o OBJS-y += libxlu_cfg_l.o +OBJS-y += libxlu_cfg_i.o OBJS-y += libxlu_cfg.o OBJS-y += libxlu_disk_l.o OBJS-y += libxlu_disk.o
tools/libs/util/libxlu_cfg.c +0 -662
704 lines not on this page · raw message
tools/libs/util/libxlu_cfg_i.c renamed from tools/libs/util/libxlu_cfg.c +0 -87
135 lines not on this page · raw message
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
Quoted 64 lines · Elliott Mitchell
Is there a freeze on that I'm unaware of? Is there so much traffic from other developers that smaller output ones are being missed? I'm wondering about the initial revision of this series not getting any feedback:
https://lists.xenproject.org/archives/html/xen-devel/2023-07/msg01264.htmlDue to the lack of news on the first thread, I've done some looking to assess the feasibility. The xl.cfg parser looks a bit jumbled. Too many things are visible to too many places. In general some pieces have really needed some TLC for a long time.
Note, some portions of this are semi-WIP. The first 5 patches are simply overdue maintenance. Not particularly urgent, but should probably be done.
Patch #06 is rather more urgent maintenance. While it might not explode soon, that is a landmine.
Patch #07 is the first big issue. The roles of the various headers had never been sorted out. The underlying issue was more the contents of "
libxlu_cfg_i.h" needed to be merged into "libxlu_cfg_y.h". Bison 2.3 may not have had the ability to embedded things into its header in 2010, but the functionality appears to have been present in Bison 3.3.There is an issue of what level of indentation should be used in libxlu_cfg_y.y? Normally the sections being added wouldn't be indented, but normally they would be directly in headers. I'm unsure of which direction to go here.
Patch #08 seemed best to leave after #07 due to overlap and difficulty with reordering. I'm a bit worried about the interfacing with flex.
Then comes the issue of moving things out of
libxlu_internal.hwhich should never have been there. The XLU_Config* values should have been placed inlibxlu_cfg_i.hinstead. Since I'm doing a thorough job, they're instead moving tolibxlu_cfg.c.I'm unsure splitting
libxlu_cfg.cis worthwhile. The resultant reusablelibxlu_cfg.cis rather small. Yet avoiding the need to reimplement the small portion is handy.Is the decision to keep in-tree copies of current Flex/Bison output still valid? I would be awful tempted to remove them from main/master, even if copies are maintained on release branches.
Elliott Mitchell (22):
tools/utils: cleanup formatting oflibxlutil.htools/utils: rename "n" arguments to "key"tools/utils: remove old declaration ofxlu__cfg_yyparse()tools/utils: enable all Bison warnings
tools/utils: update Bison parser directivestools/utils: removelibxlu_cfg_i.hfromlibxlu_disk.ctools/utils: merge contents oflibxlu_cfg_i.hto libxlu_cfg_y.ytools/utils: Bison: switch from name-prefix to api.prefixtools/utils: move CfgParseContext to top of libxlu_cfg_y.ytools/utils: moveXLU_ConfigSettingtolibxl_cfg.ctools/utils: moveXLU_ConfigValuetolibxl_cfg.ctools/utils: remove YYLTYPE definition fromlibxlu_internal.htools/utils: moveXLU_ConfigListtolibxl_cfg.ctools/utils: introducexlu_cfg_printf()function
Quoted 8 lines
tools/utils: moveXLU_Configtolibxlu_cfg.ctools/utils: moveXLU_Operationtolibxlu_cfg_y.htools/utils: move setting free loop toxlu__cfg_set_free()tools/utils: spreadxlu_cfg_printf()overlibxlu_cfg.ctools/utils: add pointer to in-progress settings to CfgParseContexttools/utils: add wrapper for readfile()/readdata() functionstools/utils: add settings get function
tools/utils: break flex/bison parser away from main config file
Some of the patches looks to have been posted previously as a 7-patch series. It would have been nice if therefore this one was marked as v2, indicating in a revision log what the differences are. It appears as if at least one out of those 7 earlier patches was dropped (or maybe assimilated into another one).
Jan
Quoted 6 lines · Jan Beulich
Some of the patches looks to have been posted previously as a 7-patch series. It would have been nice if therefore this one was marked as v2, indicating in a revision log what the differences are. It appears as if at least one out of those 7 earlier patches was dropped (or maybe assimilated into another one).
Indeed. Problem is several tags could potentially have been used. Should I have used all of them simultaneously? Should I have used only some of them? Which subset?
Several were mildly adjusted, so it could have been marked "v2".
No one responded at all to the previous round, so this could have been marked "RESEND".
Yet the refinements and general changes are large enough for the series to be pretty distinct.
I didn't know which way to go, so with no idea which option to choose the last one ended up winning out. Perhaps that was wrong yet I've still no feedback on the actual patches.
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
Hi Elliott,
Quoted 17 lines · Elliott Mitchell
Quoted 6 lines · Jan Beulich
Some of the patches looks to have been posted previously as a 7-patch series. It would have been nice if therefore this one was marked as v2, indicating in a revision log what the differences are. It appears as if at least one out of those 7 earlier patches was dropped (or maybe assimilated into another one).
Indeed. Problem is several tags could potentially have been used. Should I have used all of them simultaneously? Should I have used only some of them? Which subset?
Several were mildly adjusted, so it could have been marked "v2".
No one responded at all to the previous round, so this could have been marked "RESEND".
Quoted 6 lines
Yet the refinements and general changes are large enough for the series to be pretty distinct.
I didn't know which way to go, so with no idea which option to choose the last one ended up winning out. Perhaps that was wrong yet I've still no feedback on the actual patches.
Not sure if this is related to the lack of answer. But I didn't receive any of your patches via xen-devel (I received your replies). Skimming through the bounce for the xenproject mail server, I noticed a lot of the following:
host gmail-smtp-in.l.google.com [142.250.123.26]
SMTP error from remote mail server after pipelined end of data:
550-5.7.1 This message is not RFC 5322 compliant. There are
multiple Cc headers.
550-5.7.1 To reduce the amount of spam sent to Gmail, this message
has been
550-5.7.1 blocked. Please visit
550 5.7.1 https://support.google.com/mail/?p=RfcMessageNonCompliant t7-20020a81e447000000b005839e8b595dsi12027284ywl.554 - gsmtp
It might be possible that other mail server are not happy with your e-mails.
Cheers,
Signature · 1 line
Julien Grall
Quoted 18 lines · Julien Grall
Quoted 4 lines · Elliott Mitchell
I didn't know which way to go, so with no idea which option to choose the last one ended up winning out. Perhaps that was wrong yet I've still no feedback on the actual patches.
Not sure if this is related to the lack of answer. But I didn't receive any of your patches via xen-devel (I received your replies). Skimming through the bounce for the xenproject mail server, I noticed a lot of the following:
host gmail-smtp-in.l.google.com [142.250.123.26]
SMTP error from remote mail server after pipelined end of data:
550-5.7.1 This message is not RFC 5322 compliant. There are
multiple Cc headers.
550-5.7.1 To reduce the amount of spam sent to Gmail, this message
has been
Quoted 4 lines
550-5.7.1 blocked. Please visit 550 5.7.1https://support.google.com/mail/?p=RfcMessageNonCompliant
t7-20020a81e447000000b005839e8b595dsi12027284ywl.554 - gsmtp
That seems to be repotting a bug in scripts/add_maintainers.pl.
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
Hi,
Quoted 24 lines · Elliott Mitchell
Quoted 18 lines · Julien Grall
Quoted 4 lines · Elliott Mitchell
I didn't know which way to go, so with no idea which option to choose the last one ended up winning out. Perhaps that was wrong yet I've still no feedback on the actual patches.
Not sure if this is related to the lack of answer. But I didn't receive any of your patches via xen-devel (I received your replies). Skimming through the bounce for the xenproject mail server, I noticed a lot of the following:
host gmail-smtp-in.l.google.com [142.250.123.26]
SMTP error from remote mail server after pipelined end of data:
550-5.7.1 This message is not RFC 5322 compliant. There are
multiple Cc headers.
550-5.7.1 To reduce the amount of spam sent to Gmail, this message
has beenQuoted 4 lines
550-5.7.1 blocked. Please visit 550 5.7.1https://support.google.com/mail/?p=RfcMessageNonCompliant
t7-20020a81e447000000b005839e8b595dsi12027284ywl.554 - gsmtp
Quoted 1 line
That seems to be repotting a bug in
scripts/add_maintainers.pl.
I am curious to know why you think so?
I have been using scripts/add_maintainers.pl for quite a while and so far never seen any of my e-mail blocked.
My usual runes are:
42sh> scripts/add_maintainers.pl -d .
42sh> git-send-email *.patch
What's yours?
Cheers,
Signature · 1 line
Julien Grall
Quoted 28 lines · Julien Grall
Hi,
Quoted 18 lines · Elliott Mitchell
Quoted 12 lines · Julien Grall
Not sure if this is related to the lack of answer. But I didn't receive any of your patches via xen-devel (I received your replies). Skimming through the bounce for the xenproject mail server, I noticed a lot of the following:
host gmail-smtp-in.l.google.com [142.250.123.26]
SMTP error from remote mail server after pipelined end of data:
550-5.7.1 This message is not RFC 5322 compliant. There are
multiple Cc headers.
550-5.7.1 To reduce the amount of spam sent to Gmail, this message
has beenQuoted 4 lines
550-5.7.1 blocked. Please visit 550 5.7.1https://support.google.com/mail/?p=RfcMessageNonCompliant
t7-20020a81e447000000b005839e8b595dsi12027284ywl.554 - gsmtpQuoted 1 line
That seems to be repotting a bug in
scripts/add_maintainers.pl.I am curious to know why you think so?
I have been using
scripts/add_maintainers.plfor quite a while and so far never seen any of my e-mail blocked.
Quoted 6 lines
My usual runes are:
42sh>
scripts/add_maintainers.pl-d .
42sh> git-send-email *.patchWhat's yours?
Final steps are:
scp -r snd mailserver:
for f in snd/0*.patch
do sendmail -t < "$f"
sleep 45
done
Issue with git send-email is it really needs all the setup of a MUA, and I prefer to keep git on a distinct host.
Signature · 4 lines
(\___(\___(\______ --=> 8-) EHM <=-- ______/)___/)___/) \BS ( | [email protected] PGP 87145445 | ) / \_CS\ | _____ -O #include <stddisclaimer.h> O- _____ | / _/ 8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445
Quoted 17 lines · Elliott Mitchell
Quoted 6 lines · Jan Beulich
Some of the patches looks to have been posted previously as a 7-patch series. It would have been nice if therefore this one was marked as v2, indicating in a revision log what the differences are. It appears as if at least one out of those 7 earlier patches was dropped (or maybe assimilated into another one).
Indeed. Problem is several tags could potentially have been used. Should I have used all of them simultaneously? Should I have used only some of them? Which subset?
Several were mildly adjusted, so it could have been marked "v2".
No one responded at all to the previous round, so this could have been marked "RESEND".
Quoted 6 lines
Yet the refinements and general changes are large enough for the series to be pretty distinct.
I didn't know which way to go, so with no idea which option to choose the last one ended up winning out. Perhaps that was wrong yet I've still no feedback on the actual patches.
As, for this series, being just in the role of a committer, without clearly identifying that some earlier patches can now be dropped from the list of things which need monitoring, you're making my (in that regard) supposedly purely mechanical job harder (and presumably every other committer's as well). As to not getting feedback: Your posting (at least the cover letter) dates back to July 19. That's not all that long compared to other series. Plus if you were concerned, you could have pinged the respective maintainers.
Jan