From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35245) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wl34F-0000Aa-CG for qemu-devel@nongnu.org; Thu, 15 May 2014 17:20:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wl34A-0005R5-DY for qemu-devel@nongnu.org; Thu, 15 May 2014 17:19:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35230) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wl34A-0005QU-5Y for qemu-devel@nongnu.org; Thu, 15 May 2014 17:19:50 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s4FLJmSb016697 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 15 May 2014 17:19:48 -0400 Message-ID: <53752F73.3030506@redhat.com> Date: Thu, 15 May 2014 15:19:47 -0600 From: Eric Blake MIME-Version: 1.0 References: In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="RMoIQAXUrLviNnNdigimCILv5xu6RnDn8" Subject: Re: [Qemu-devel] [libvirt] [PATCHv2] Don't log an internal error when the guest hasn't updated balloon stats List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?SsOhbiBUb21rbw==?= , libvir-list@redhat.com, "qemu-devel@nongnu.org" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --RMoIQAXUrLviNnNdigimCILv5xu6RnDn8 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 05/15/2014 01:22 AM, J=C3=A1n 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. >=20 > 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. >=20 > 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 availab= le, > we can still return 'rss' in qemuDomainMemoryStats > jump to cleanup if CheckError returns < 0 >=20 > src/qemu/qemu_monitor_json.c | 18 ++++++++++++++---- > 1 file changed, 14 insertions(+), 4 deletions(-) > + if ((data =3D virJSONValueObjectGet(reply, "error"))) { > + const char *klass =3D virJSONValueObjectGetString(data, "class= "); > + const char *desc =3D virJSONValueObjectGetString(data, "desc")= ; > =20 > - 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. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --RMoIQAXUrLviNnNdigimCILv5xu6RnDn8 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJTdS9zAAoJEKeha0olJ0NqZcMH/Rykdu4AOOj4XzLItgrIiCmL jABzMJOwFh3jTxo5GQpq1tPK5BDVvcqg2WLl8WLKsdrVy8q9BsdEHeeZYeXpCrd0 9N3Of66sA/ge+jpRK2kd5SKizgw+qm0zrvWlvvJU34spClYe8ueYqPaocOqzjMv0 7WBWdJ1Df7NXkrCpd0SV7/7xhdKrUCS39wZxS6QPa8e9bzfwDDL/ijrkUfUrjStW nIo8zv/EFYdUxJiEAR1VOqSNYGlvemcq5ksgC0MSJ0k1wo6Gdlz9/Eb4GKRIZ2WI y/O0czPTXty9h+pOPRBFMquzE4J6BmqLWzbGlmzDohfn1aHO0MCHxWnViAEFk2c= =CHFM -----END PGP SIGNATURE----- --RMoIQAXUrLviNnNdigimCILv5xu6RnDn8--