From: "Ján Tomko" <jtomko@redhat.com>
To: Eric Blake <eblake@redhat.com>,
libvir-list@redhat.com,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [libvirt] [PATCHv2] Don't log an internal error when the guest hasn't updated balloon stats
Date: Thu, 22 May 2014 14:54:21 +0200 [thread overview]
Message-ID: <537DF37D.6020904@redhat.com> (raw)
In-Reply-To: <53752F73.3030506@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2298 bytes --]
On 05/15/2014 11:19 PM, Eric Blake wrote:
> On 05/15/2014 01:22 AM, Ján Tomko wrote:
>> If virDomainMemoryStats is called too soon after domain startup,
>> QEMU returns:
>> "error":{"class":"GenericError","desc":"guest hasn't updated any stats yet"}
>> when we try to query balloon stats.
>>
>> Check for this reply and log it as OPERATION_INVALID instead of
>> INTERNAL_ERROR. This means the daemon only logs it at the debug level,
>> without polluting system logs.
>>
>> Reported by Laszlo Pal:
>> https://www.redhat.com/archives/libvirt-users/2014-May/msg00023.html
>> ---
>> v1: https://www.redhat.com/archives/libvir-list/2014-May/msg00420.html
>> v2:
>> return 0 in this case - even though balloon stats are not yet available,
>> we can still return 'rss' in qemuDomainMemoryStats
>> jump to cleanup if CheckError returns < 0
>>
>> src/qemu/qemu_monitor_json.c | 18 ++++++++++++++----
>> 1 file changed, 14 insertions(+), 4 deletions(-)
>
>> + if ((data = virJSONValueObjectGet(reply, "error"))) {
>> + const char *klass = virJSONValueObjectGetString(data, "class");
>> + const char *desc = virJSONValueObjectGetString(data, "desc");
>>
>> - if (ret < 0)
>> + if (STREQ_NULLABLE(klass, "GenericError") &&
>> + STREQ_NULLABLE(desc, "guest hasn't updated any stats yet")) {
>
> Adding qemu. Uggh - the qemu documentation of QMP states:
>
> - The "desc" member is a human-readable error message. Clients should
> not attempt to parse this message.
>
> because the contents of that field are NOT guaranteed to be stable.
> We're stuck parsing that field for old versions of qemu, but this is one
> case where upstream qemu (for future versions) should change the "class"
> member of that particular error case to a distinct value other than
> GenericError so that it is trivially obvious when this particular
> condition has occurred, since it is a case where libvirt wants to treat
> it as a non-error.
>
> reluctant ACK, while hoping that we can do something more reliable in
> the future.
>
I have pushed the patch now.
The qemu patch reporting empty stats instead of this error should be on its way:
https://lists.gnu.org/archive/html/qemu-devel/2014-05/msg04295.html
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
prev parent reply other threads:[~2014-05-22 12:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <d98650b5d89fc5a82ab02e5cafc04a66478052d5.1400138404.git.jtomko@redhat.com>
2014-05-15 21:19 ` [Qemu-devel] [libvirt] [PATCHv2] Don't log an internal error when the guest hasn't updated balloon stats Eric Blake
2014-05-16 5:59 ` Markus Armbruster
2014-05-16 6:11 ` Eric Blake
2014-05-16 13:13 ` Luiz Capitulino
2014-05-19 6:46 ` Ján Tomko
2014-05-22 12:54 ` Ján Tomko [this message]
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=537DF37D.6020904@redhat.com \
--to=jtomko@redhat.com \
--cc=eblake@redhat.com \
--cc=libvir-list@redhat.com \
--cc=qemu-devel@nongnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).