From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33967) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ST082-0008Bu-1l for qemu-devel@nongnu.org; Fri, 11 May 2012 20:24:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ST080-0000T5-3A for qemu-devel@nongnu.org; Fri, 11 May 2012 20:24:09 -0400 Received: from cantor2.suse.de ([195.135.220.15]:40132 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ST07z-0000St-T4 for qemu-devel@nongnu.org; Fri, 11 May 2012 20:24:08 -0400 Message-ID: <4FADAD9E.7040808@suse.de> Date: Sat, 12 May 2012 02:23:58 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1335958273-769-1-git-send-email-pbonzini@redhat.com> <1335958273-769-9-git-send-email-pbonzini@redhat.com> <4FAD2048.80606@suse.de> <4FAD2611.9080403@redhat.com> In-Reply-To: <4FAD2611.9080403@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 08/21] qdev: use object_property_print in info qtree List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: peter.maydell@linaro.org, aliguori@us.ibm.com, qemu-devel@nongnu.org, liwp@linux.vnet.ibm.com Am 11.05.2012 16:45, schrieb Paolo Bonzini: > Il 11/05/2012 16:20, Andreas F=E4rber ha scritto: >> char *string =3D NULL; >> >>>> =20 >>>> mo =3D string_output_visitor_new(); >>>> - object_property_get(obj, string_output_get_visitor(mo), name, N= ULL); >>>> + object_property_get(obj, string_output_get_visitor(mo), name, e= rrp); >> If we do error checking we should be consequent and do: >> >> if (!error_is_set(errp)) { >> >>>> string =3D string_output_get_string(mo); >> } >> >>>> string_output_visitor_cleanup(mo); >=20 > Or just say that it is part of the string_output_visitor interface that > in case of an error the returned string is NULL. I see it now: The StringOutputVisitor is allocated with g_malloc0(), so that it's initially NULL. get_string_output() would thus simply pass through NULL and doesn't need special error handling. Thanks, applied to qom-1.1 and qom-next: http://repo.or.cz/w/qemu/afaerber.git/shortlog/refs/heads/qom-1.1 http://repo.or.cz/w/qemu/afaerber.git/shortlog/refs/heads/qom-next Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg