From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48110) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WnSWB-0006kn-UJ for qemu-devel@nongnu.org; Thu, 22 May 2014 08:54:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WnSW6-0006vW-B9 for qemu-devel@nongnu.org; Thu, 22 May 2014 08:54:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:2659) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WnSW6-0006vO-32 for qemu-devel@nongnu.org; Thu, 22 May 2014 08:54:38 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s4MCsaJk027795 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 22 May 2014 08:54:36 -0400 Message-ID: <537DF37D.6020904@redhat.com> Date: Thu, 22 May 2014 14:54:21 +0200 From: =?ISO-8859-1?Q?J=E1n_Tomko?= MIME-Version: 1.0 References: <53752F73.3030506@redhat.com> In-Reply-To: <53752F73.3030506@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="bqpbm3ObukEEMQ63DPSRNnbRagCrR7Cxl" 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: Eric Blake , libvir-list@redhat.com, "qemu-devel@nongnu.org" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --bqpbm3ObukEEMQ63DPSRNnbRagCrR7Cxl Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 05/15/2014 11:19 PM, Eric Blake wrote: > On 05/15/2014 01:22 AM, J=E1n 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 availa= ble, >> 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(-) >=20 >> + if ((data =3D virJSONValueObjectGet(reply, "error"))) { >> + const char *klass =3D virJSONValueObjectGetString(data, "clas= s"); >> + 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"= )) { >=20 > Adding qemu. Uggh - the qemu documentation of QMP states: >=20 > - The "desc" member is a human-readable error message. Clients should > not attempt to parse this message. >=20 > 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 on= e > 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. >=20 > reluctant ACK, while hoping that we can do something more reliable in > the future. >=20 I have pushed the patch now. The qemu patch reporting empty stats instead of this error should be on i= ts way: https://lists.gnu.org/archive/html/qemu-devel/2014-05/msg04295.html Jan --bqpbm3ObukEEMQ63DPSRNnbRagCrR7Cxl Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJTffOJAAoJEMr6XT10/wJpPE4P+wRFke0rCV3WLqPc5CYo8i/e c5wBXwHa0qQeMDOhjacucSzfR6MdQwnoI+VEc0v67ULl5Poqp8qrry0paBwkymGc UeZQl7JeoyCM4Q0JXtC+Rg05nNPxu1YppbgpbiamO5Ug7lVIp8A8RQ1wNIwSd0Tb RMoHNUaOj2roTTev44Ql/zIB38d3o+mXMz/Acgx9xloNMn3U0wuRZvb79mcGfs9O PpKk56poQGzQymeKK1ElaLvVcp3uSVpMfc/TO3cfRx8JY/mUwurBYdh0IBXOST4c iLU50HZkdBjEfcUQdmrFn30j2/FW+WZnXFIKcX86tTdtiypStwpBd9o52pO8nbdv XVAdZNSH4AlNAx7Q5uUnaP1Eto9GXB2SSFEPgsmLv5hTRR4mSsqmHuxL3lxY8x2L vHd/PPpsi9v4VT/64gJsxSLXpRAQqgo4rlL/v42wv3YBZGiRmDKx9w4wfGcPWapP R9byg5CMRdF5PMYgmLz37Yx7n9aKhusOHflHbYUi+NuuNha4/NkTTbVc0GvCc3Pr 4NofuGfnvmIi2QiHCwPM9ulYqi2qR6S6ml+wrJafux3LnB07wxM73RoK/3n1BaxV 80X5KDvOIhaEifmkyhOXARjQG4jCpTRifKzyfDtp8uyji4A7cubbCbd0XehZnfCM UTHBZUuGYctb3Sqm8U4U =LDif -----END PGP SIGNATURE----- --bqpbm3ObukEEMQ63DPSRNnbRagCrR7Cxl--