Skip to contentSkip to conversation

xen/hypfs: fix loglvl parameter setting

PATCH In review Juergen Gross 4 participants 6 messages Jun 9, 2020 – Jun 11, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/hypfs: fix loglvl parameter setting

Writing the runtime parameters loglvl or guest_loglvl omits setting the new length of the resulting parameter value.

---
 xen/drivers/char/console.c | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)
xen/drivers/char/console.c +15 -4
index 56e24821b2..861ad53a8f 100644
@@ -241,14 +241,25 @@ static int _parse_loglvl(const char *s, int *lower, int *upper, char *val)
 
 static int parse_loglvl(const char *s)
 {
-    return _parse_loglvl(s, &xenlog_lower_thresh, &xenlog_upper_thresh,
-                         xenlog_val);
+    int ret;
+
+    ret = _parse_loglvl(s, &xenlog_lower_thresh, &xenlog_upper_thresh,
+                        xenlog_val);
+    custom_runtime_set_var(param_2_parfs(parse_loglvl), xenlog_val);
+
+    return ret;
 }
 
 static int parse_guest_loglvl(const char *s)
 {
-    return _parse_loglvl(s, &xenlog_guest_lower_thresh,
-                         &xenlog_guest_upper_thresh, xenlog_guest_val);
+    int ret;
+
+    ret = _parse_loglvl(s, &xenlog_guest_lower_thresh,
+                        &xenlog_guest_upper_thresh, xenlog_guest_val);
+    custom_runtime_set_var(param_2_parfs(parse_guest_loglvl),
+                           xenlog_guest_val);
+
+    return ret;
 }
 
 static char *loglvl_str(int lvl)
Signature · 1 line
2.26.2
Reviewed-by on v1 1/1
#1 lore raw

Hi Juergen,

Quoted 5 lines · Juergen Gross

Writing the runtime parameters loglvl or guest_loglvl omits setting the new length of the resulting parameter value.

Although one unrelated comment below.

Quoted 9 lines
---
  xen/drivers/char/console.c | 19 +++++++++++++++----
  1 file changed, 15 insertions(+), 4 deletions(-)
xen/drivers/char/console.c +0 -0
index 56e24821b2..861ad53a8f 100644

xen/drivers/char/console.c static int _parse_loglvl(const char *s, int *lower, int *upper, char *val) · line 248

Quoted 10 lines
xen/drivers/char/console.c +5 -2
@@ -241,14 +241,25 @@ static int _parse_loglvl(const char *s, int *lower, int *upper, char *val)
 
  static int parse_loglvl(const char *s)
  {
-    return _parse_loglvl(s, &xenlog_lower_thresh, &xenlog_upper_thresh,
-                         xenlog_val);
+    int ret;
+
+    ret = _parse_loglvl(s, &xenlog_lower_thresh, &xenlog_upper_thresh,
+                        xenlog_val);
+    custom_runtime_set_var(param_2_parfs(parse_loglvl), xenlog_val);

Mixing function and variable name is pretty confusing. It took me sometimes to go through the macro maze to figure out what's happening.

It might be worth thinking to document more the custom_runtime_* interface.

Cheers,

Signature · 1 line
Julien Grall
#2 lore raw
Quoted 35 lines · Julien Grall

Hi Juergen,

Quoted 5 lines · Juergen Gross

Writing the runtime parameters loglvl or guest_loglvl omits setting the new length of the resulting parameter value.

Although one unrelated comment below.

Quoted 9 lines

---
  xen/drivers/char/console.c | 19 +++++++++++++++----

  1 file changed, 15 insertions(+), 4 deletions(-)
xen/drivers/char/console.c +0 -0
index 56e24821b2..861ad53a8f 100644

xen/drivers/char/console.c static int _parse_loglvl(const char *s, int · line 248

Quoted 10 lines
xen/drivers/char/console.c +5 -2
@@ -241,14 +241,25 @@ static int _parse_loglvl(const char *s, int 
 *lower, int *upper, char *val)
   static int parse_loglvl(const char *s)
   {
-    return _parse_loglvl(s, &xenlog_lower_thresh, &xenlog_upper_thresh,
-                         xenlog_val);
+    int ret;
+
+    ret = _parse_loglvl(s, &xenlog_lower_thresh, &xenlog_upper_thresh,
+                        xenlog_val);
+    custom_runtime_set_var(param_2_parfs(parse_loglvl), xenlog_val);

Mixing function and variable name is pretty confusing. It took me sometimes to go through the macro maze to figure out what's happening.

Quoted 1 line

It might be worth thinking to document more the custom_runtime_* interface.

I have already some streamlining ideas for 4.15.

Juergen

#3 lore raw
Quoted 38 lines · Jürgen Groß
Quoted 36 lines · Julien Grall

Hi Juergen,

Quoted 5 lines · Juergen Gross

Writing the runtime parameters loglvl or guest_loglvl omits setting the new length of the resulting parameter value.

Although one unrelated comment below.

Quoted 9 lines
---
  xen/drivers/char/console.c | 19 +++++++++++++++----
  1 file changed, 15 insertions(+), 4 deletions(-)
xen/drivers/char/console.c +0 -0
index 56e24821b2..861ad53a8f 100644

xen/drivers/char/console.c static int _parse_loglvl(const char *s, int · line 248

Quoted 10 lines
xen/drivers/char/console.c +5 -2
@@ -241,14 +241,25 @@ static int _parse_loglvl(const char *s, int
 *lower, int *upper, char *val)
  static int parse_loglvl(const char *s)
  {
-    return _parse_loglvl(s, &xenlog_lower_thresh, &xenlog_upper_thresh,
-                         xenlog_val);
+    int ret;
+
+    ret = _parse_loglvl(s, &xenlog_lower_thresh, &xenlog_upper_thresh,
+                        xenlog_val);
+    custom_runtime_set_var(param_2_parfs(parse_loglvl), xenlog_val);

Mixing function and variable name is pretty confusing. It took me sometimes to go through the macro maze to figure out what's happening.

Quoted 3 lines
Quoted 1 line

It might be worth thinking to document more the custom_runtime_* interface.

I have already some streamlining ideas for 4.15.

Cool! I will commit it tomorrow morning.

Cheers,

#4 lore raw
Quoted 39 lines · Julien Grall
Quoted 38 lines · Jürgen Groß
Quoted 36 lines · Julien Grall

Hi Juergen,

Quoted 5 lines · Juergen Gross

Writing the runtime parameters loglvl or guest_loglvl omits setting the new length of the resulting parameter value.

Although one unrelated comment below.

Quoted 9 lines
---
   xen/drivers/char/console.c | 19 +++++++++++++++----
   1 file changed, 15 insertions(+), 4 deletions(-)
xen/drivers/char/console.c +0 -0
index 56e24821b2..861ad53a8f 100644

xen/drivers/char/console.c static int _parse_loglvl(const char *s, int · line 248

Quoted 10 lines
xen/drivers/char/console.c +5 -2
@@ -241,14 +241,25 @@ static int _parse_loglvl(const char *s, int
 *lower, int *upper, char *val)
   static int parse_loglvl(const char *s)
   {
-    return _parse_loglvl(s, &xenlog_lower_thresh, &xenlog_upper_thresh,
-                         xenlog_val);
+    int ret;
+
+    ret = _parse_loglvl(s, &xenlog_lower_thresh, &xenlog_upper_thresh,
+                        xenlog_val);
+    custom_runtime_set_var(param_2_parfs(parse_loglvl), xenlog_val);

Mixing function and variable name is pretty confusing. It took me sometimes to go through the macro maze to figure out what's happening.

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

It might be worth thinking to document more the custom_runtime_* interface.

I have already some streamlining ideas for 4.15.

Cool! I will commit it tomorrow morning.

Actually I am missing a Released-acked-by from Paul on this patch.

Cheers,

Signature · 1 line
Julien Grall
#5 lore raw
Quoted 52 lines

-----Original Message-----
From: Julien Grall <[email protected]>
Sent: 11 June 2020 10:20
To: Julien Grall <[email protected]>; Jürgen Groß <[email protected]>; Paul Durrant <[email protected]>
Cc: xen-devel <[email protected]>; Andrew Cooper <[email protected]>; George Dunlap <[email protected]>; Ian Jackson <[email protected]>; Jan Beulich <[email protected]>; Stefano Stabellini <[email protected]>; Wei Liu <[email protected]>
Subject: Re: [PATCH for-4.14] xen/hypfs: fix loglvl parameter setting

Quoted 39 lines · Julien Grall
Quoted 38 lines · Jürgen Groß
Quoted 36 lines · Julien Grall

Hi Juergen,

Quoted 5 lines · Juergen Gross

Writing the runtime parameters loglvl or guest_loglvl omits setting the new length of the resulting parameter value.

Although one unrelated comment below.

Quoted 9 lines
---
   xen/drivers/char/console.c | 19 +++++++++++++++----
   1 file changed, 15 insertions(+), 4 deletions(-)
xen/drivers/char/console.c +0 -0
index 56e24821b2..861ad53a8f 100644

xen/drivers/char/console.c static int _parse_loglvl(const char *s, int · line 248

Quoted 10 lines
xen/drivers/char/console.c +5 -2
@@ -241,14 +241,25 @@ static int _parse_loglvl(const char *s, int
 *lower, int *upper, char *val)
   static int parse_loglvl(const char *s)
   {
-    return _parse_loglvl(s, &xenlog_lower_thresh, &xenlog_upper_thresh,
-                         xenlog_val);
+    int ret;
+
+    ret = _parse_loglvl(s, &xenlog_lower_thresh, &xenlog_upper_thresh,
+                        xenlog_val);
+    custom_runtime_set_var(param_2_parfs(parse_loglvl), xenlog_val);

Mixing function and variable name is pretty confusing. It took me sometimes to go through the macro maze to figure out what's happening.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

It might be worth thinking to document more the custom_runtime_* interface.

I have already some streamlining ideas for 4.15.

Cool! I will commit it tomorrow morning.

Actually I am missing a Released-acked-by from Paul on this patch.

Quoted 4 lines

Cheers,

--
Julien Grall