All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Juergen Gross <jgross@suse.com>,
	linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org
Subject: Re: [PATCH] xen: don't print error message in case of missing Xenstore entry
Date: Tue, 30 May 2017 13:08:25 -0400	[thread overview]
Message-ID: <dc0bc4d3-12df-8638-e8fe-20d302393ada@oracle.com> (raw)
In-Reply-To: <78ae3bc7-fbd9-5f69-3177-67eeb3f43201@suse.com>

On 05/30/2017 11:03 AM, Juergen Gross wrote:
> On 30/05/17 15:25, Boris Ostrovsky wrote:
>> On 05/29/2017 05:13 AM, Juergen Gross wrote:
>>> 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 <jgross@suse.com>
>>> ---
>>>  drivers/xen/manage.c | 7 +++++--
>>>  1 file changed, 5 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c
>>> index c1ec8ee80924..7ddd0803da23 100644
>>> --- a/drivers/xen/manage.c
>>> +++ b/drivers/xen/manage.c
>>> @@ -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).


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



>
>
> Juergen
>
>> -boris
>>
>>> +			pr_err("Error %d reading sysrq code in control/sysrq\n",
>>> +			       err);
>>>  		xenbus_transaction_end(xbt, 1);
>>>  		return;
>>>  	}
>>

WARNING: multiple messages have this Message-ID (diff)
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Juergen Gross <jgross@suse.com>,
	linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org
Subject: Re: [PATCH] xen: don't print error message in case of missing Xenstore entry
Date: Tue, 30 May 2017 13:08:25 -0400	[thread overview]
Message-ID: <dc0bc4d3-12df-8638-e8fe-20d302393ada@oracle.com> (raw)
In-Reply-To: <78ae3bc7-fbd9-5f69-3177-67eeb3f43201@suse.com>

On 05/30/2017 11:03 AM, Juergen Gross wrote:
> On 30/05/17 15:25, Boris Ostrovsky wrote:
>> On 05/29/2017 05:13 AM, Juergen Gross wrote:
>>> 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 <jgross@suse.com>
>>> ---
>>>  drivers/xen/manage.c | 7 +++++--
>>>  1 file changed, 5 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c
>>> index c1ec8ee80924..7ddd0803da23 100644
>>> --- a/drivers/xen/manage.c
>>> +++ b/drivers/xen/manage.c
>>> @@ -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).


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



>
>
> Juergen
>
>> -boris
>>
>>> +			pr_err("Error %d reading sysrq code in control/sysrq\n",
>>> +			       err);
>>>  		xenbus_transaction_end(xbt, 1);
>>>  		return;
>>>  	}
>>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-05-30 17:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-29  9:13 [PATCH] xen: don't print error message in case of missing Xenstore entry Juergen Gross
2017-05-30 13:25 ` Boris Ostrovsky
2017-05-30 13:25   ` Boris Ostrovsky
2017-05-30 15:03   ` Juergen Gross
2017-05-30 15:03   ` Juergen Gross
2017-05-30 17:08     ` Boris Ostrovsky [this message]
2017-05-30 17:08       ` Boris Ostrovsky
2017-05-30 17:10       ` Juergen Gross
2017-05-30 17:10       ` Juergen Gross
  -- strict thread matches above, loose matches on Subject: below --
2017-05-29  9:13 Juergen Gross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dc0bc4d3-12df-8638-e8fe-20d302393ada@oracle.com \
    --to=boris.ostrovsky@oracle.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.