xen: don't print error message in case of missing Xenstore entry
Juergen Gross
maintainerPATCH 1/1 xen: don't print error message in case of missing Xenstore entry
When registering for the Xenstore watch of the node control/sysrq the handler will be called at once. Don't issue an error message if the Xenstore node isn't there, as it will be created only when an event is being triggered.
--- drivers/xen/manage.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/xen/manage.c +5 -2
@@ -277,8 +277,11 @@ static void sysrq_handler(struct xenbus_watch *watch, const char *path, err =xenbus_transaction_start (&xbt);if (err)return ; -if (xenbus_scanf (xbt,"control" ,"sysrq" ,"%c" , &sysrq_key) <0 ) { -pr_err ("Unable to read sysrq code in control/sysrq\n" ); + err =xenbus_scanf (xbt,"control" ,"sysrq" ,"%c" , &sysrq_key); +if (err <0 ) { +if (err != -ENOENT ) +pr_err ("Error %d reading sysrq code in control/sysrq\n" , + err);xenbus_transaction_end (xbt,1 );return ; }
Signature · 1 line
2.12.3
Quoted 15 lines · Juergen Gross
When registering for the Xenstore watch of the node control/sysrq the handler will be called at once. Don't issue an error message if the Xenstore node isn't there, as it will be created only when an event is being triggered.
Signed-off-by Juergen Gross <[email protected]>--- drivers/xen/manage.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)drivers/xen/manage.c +0
-0
drivers/xen/manage.c static void sysrq_handler(struct xenbus_watch *watch, const char *path, · line 282
Quoted 8 lines
drivers/xen/manage.c +3
-2@@ -277,8 +277,11 @@ static void sysrq_handler(struct xenbus_watch *watch, const char *path, err =xenbus_transaction_start (&xbt);if (err)return ; -if (xenbus_scanf (xbt,"control" ,"sysrq" ,"%c" , &sysrq_key) <0 ) { -pr_err ("Unable to read sysrq code in control/sysrq\n" ); + err =xenbus_scanf (xbt,"control" ,"sysrq" ,"%c" , &sysrq_key); +if (err <0 ) { +if (err != -ENOENT )
Can we distinguish initialization invocation from actual watch firing? E.g. '|| (system_state >= SYSTEM_RUNNING)'?
-boris
drivers/xen/manage.c static void sysrq_handler(struct xenbus_watch *watch, const char *path, · line 287
Quoted 5 lines
drivers/xen/manage.c +2
-0+pr_err ("Error %d reading sysrq code in control/sysrq\n" , + err);xenbus_transaction_end (xbt,1 );return ; }
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Juergen Gross
maintainerQuoted 11 lines · Boris Ostrovsky
Quoted 10 lines · Juergen Gross
When registering for the Xenstore watch of the node control/sysrq the handler will be called at once. Don't issue an error message if the Xenstore node isn't there, as it will be created only when an event is being triggered.
Signed-off-by Juergen Gross <[email protected]>--- drivers/xen/manage.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
Quoted 16 lines
drivers/xen/manage.c static void sysrq_handler(struct xenbus_watch *watch, const char *path, · line 282
Quoted 13 lines
drivers/xen/manage.c +3
-2@@ -277,8 +277,11 @@ static void sysrq_handler(struct xenbus_watch *watch, const char *path, err =xenbus_transaction_start (&xbt);if (err)return ; -if (xenbus_scanf (xbt,"control" ,"sysrq" ,"%c" , &sysrq_key) <0 ) { -pr_err ("Unable to read sysrq code in control/sysrq\n" ); + err =xenbus_scanf (xbt,"control" ,"sysrq" ,"%c" , &sysrq_key); +if (err <0 ) { +if (err != -ENOENT )Can we distinguish initialization invocation from actual watch firing? E.g. '|| (
system_state>=SYSTEM_RUNNING)'?
The watch will fire again after suspend/resume (e.g. live migration).
Juergen
Quoted 10 lines
-boris
drivers/xen/manage.c static void sysrq_handler(struct xenbus_watch *watch, const char *path, · line 287
Quoted 5 lines
drivers/xen/manage.c +2
-0+pr_err ("Error %d reading sysrq code in control/sysrq\n" , + err);xenbus_transaction_end (xbt,1 );return ; }
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Juergen Gross
maintainerQuoted 11 lines · Boris Ostrovsky
Quoted 10 lines · Juergen Gross
When registering for the Xenstore watch of the node control/sysrq the handler will be called at once. Don't issue an error message if the Xenstore node isn't there, as it will be created only when an event is being triggered.
Signed-off-by Juergen Gross <[email protected]>--- drivers/xen/manage.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
Quoted 16 lines
drivers/xen/manage.c static void sysrq_handler(struct xenbus_watch *watch, const char *path, · line 282
Quoted 13 lines
drivers/xen/manage.c +3
-2@@ -277,8 +277,11 @@ static void sysrq_handler(struct xenbus_watch *watch, const char *path, err =xenbus_transaction_start (&xbt);if (err)return ; -if (xenbus_scanf (xbt,"control" ,"sysrq" ,"%c" , &sysrq_key) <0 ) { -pr_err ("Unable to read sysrq code in control/sysrq\n" ); + err =xenbus_scanf (xbt,"control" ,"sysrq" ,"%c" , &sysrq_key); +if (err <0 ) { +if (err != -ENOENT )Can we distinguish initialization invocation from actual watch firing? E.g. '|| (
system_state>=SYSTEM_RUNNING)'?
The watch will fire again after suspend/resume (e.g. live migration).
Juergen
Quoted 10 lines
-boris
Quoted 5 lines
drivers/xen/manage.c +2
-0+pr_err ("Error %d reading sysrq code in control/sysrq\n" , + err);xenbus_transaction_end (xbt,1 );return ; }
Quoted 27 lines · Juergen Gross
Quoted 11 lines · Boris Ostrovsky
Quoted 10 lines · Juergen Gross
When registering for the Xenstore watch of the node control/sysrq the handler will be called at once. Don't issue an error message if the Xenstore node isn't there, as it will be created only when an event is being triggered.
Signed-off-by Juergen Gross <[email protected]>--- drivers/xen/manage.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)Quoted 15 lines
drivers/xen/manage.c static void sysrq_handler(struct xenbus_watch *watch, const char *path, · line 282
Quoted 13 lines
drivers/xen/manage.c +3
-2@@ -277,8 +277,11 @@ static void sysrq_handler(struct xenbus_watch *watch, const char *path, err =xenbus_transaction_start (&xbt);if (err)return ; -if (xenbus_scanf (xbt,"control" ,"sysrq" ,"%c" , &sysrq_key) <0 ) { -pr_err ("Unable to read sysrq code in control/sysrq\n" ); + err =xenbus_scanf (xbt,"control" ,"sysrq" ,"%c" , &sysrq_key); +if (err <0 ) { +if (err != -ENOENT )Can we distinguish initialization invocation from actual watch firing? E.g. '|| (
system_state>=SYSTEM_RUNNING)'?
Quoted 1 line
The watch will fire again after suspend/resume (e.g. live migration).
That's unfortunate. (And system_state check would also not be a good solution btw since the watch might be processed by the watch thread after we enter SYSTEM_RUNNING).
Can you add a comment explaining why we are ignoring ENOENT?
-boris
Quoted 12 lines
Juergen
Quoted 8 lines
-boris
Quoted 5 lines
drivers/xen/manage.c +2
-0+pr_err ("Error %d reading sysrq code in control/sysrq\n" , + err);xenbus_transaction_end (xbt,1 );return ; }
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Juergen Gross
maintainerQuoted 28 lines · Boris Ostrovsky
Quoted 27 lines · Juergen Gross
Quoted 26 lines · Boris Ostrovsky
Quoted 15 lines · Juergen Gross
When registering for the Xenstore watch of the node control/sysrq the handler will be called at once. Don't issue an error message if the Xenstore node isn't there, as it will be created only when an event is being triggered.
Signed-off-by Juergen Gross <[email protected]>--- drivers/xen/manage.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)drivers/xen/manage.c +0
-0drivers/xen/manage.c static void sysrq_handler(struct xenbus_watch *watch, const char *path, · line 282
Quoted 8 lines
drivers/xen/manage.c +3
-2@@ -277,8 +277,11 @@ static void sysrq_handler(struct xenbus_watch *watch, const char *path, err =xenbus_transaction_start (&xbt);if (err)return ; -if (xenbus_scanf (xbt,"control" ,"sysrq" ,"%c" , &sysrq_key) <0 ) { -pr_err ("Unable to read sysrq code in control/sysrq\n" ); + err =xenbus_scanf (xbt,"control" ,"sysrq" ,"%c" , &sysrq_key); +if (err <0 ) { +if (err != -ENOENT )Can we distinguish initialization invocation from actual watch firing? E.g. '|| (
system_state>=SYSTEM_RUNNING)'?
Quoted 8 lines
Quoted 1 line
The watch will fire again after suspend/resume (e.g. live migration).
That's unfortunate. (And
system_statecheck would also not be a good solution btw since the watch might be processed by the watch thread after we enterSYSTEM_RUNNING).Can you add a comment explaining why we are ignoring ENOENT?
Sure.
Juergen
Juergen Gross
maintainerQuoted 28 lines · Boris Ostrovsky
Quoted 27 lines · Juergen Gross
Quoted 26 lines · Boris Ostrovsky
Quoted 15 lines · Juergen Gross
When registering for the Xenstore watch of the node control/sysrq the handler will be called at once. Don't issue an error message if the Xenstore node isn't there, as it will be created only when an event is being triggered.
Signed-off-by Juergen Gross <[email protected]>--- drivers/xen/manage.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)drivers/xen/manage.c +0
-0drivers/xen/manage.c static void sysrq_handler(struct xenbus_watch *watch, const char *path, · line 282
Quoted 8 lines
drivers/xen/manage.c +3
-2@@ -277,8 +277,11 @@ static void sysrq_handler(struct xenbus_watch *watch, const char *path, err =xenbus_transaction_start (&xbt);if (err)return ; -if (xenbus_scanf (xbt,"control" ,"sysrq" ,"%c" , &sysrq_key) <0 ) { -pr_err ("Unable to read sysrq code in control/sysrq\n" ); + err =xenbus_scanf (xbt,"control" ,"sysrq" ,"%c" , &sysrq_key); +if (err <0 ) { +if (err != -ENOENT )Can we distinguish initialization invocation from actual watch firing? E.g. '|| (
system_state>=SYSTEM_RUNNING)'?
Quoted 8 lines
Quoted 1 line
The watch will fire again after suspend/resume (e.g. live migration).
That's unfortunate. (And
system_statecheck would also not be a good solution btw since the watch might be processed by the watch thread after we enterSYSTEM_RUNNING).Can you add a comment explaining why we are ignoring ENOENT?
Sure.
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel