From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:39101) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsjNE-0001Z1-GB for qemu-devel@nongnu.org; Tue, 08 Jan 2013 19:18:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TsjNC-00080X-Sv for qemu-devel@nongnu.org; Tue, 08 Jan 2013 19:18:28 -0500 Received: from cantor2.suse.de ([195.135.220.15]:52235 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsjNC-00080S-Jh for qemu-devel@nongnu.org; Tue, 08 Jan 2013 19:18:26 -0500 Message-ID: <50ECB73C.9090605@suse.de> Date: Wed, 09 Jan 2013 01:18:04 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1355834518-17989-1-git-send-email-vasilis.liaskovitis@profitbricks.com> <1355834518-17989-7-git-send-email-vasilis.liaskovitis@profitbricks.com> In-Reply-To: <1355834518-17989-7-git-send-email-vasilis.liaskovitis@profitbricks.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC PATCH v4 06/30] qapi: make visit_type_size fallback to type_int List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vasilis Liaskovitis , Michael Roth Cc: pingfank@linux.vnet.ibm.com, gleb@redhat.com, stefanha@gmail.com, jbaron@redhat.com, seabios@seabios.org, qemu-devel@nongnu.org, blauwirbel@gmail.com, kevin@koconnor.net, kraxel@redhat.com, Anthony Liguori Am 18.12.2012 13:41, schrieb Vasilis Liaskovitis: > Currently visit_type_size checks if the visitor's type_size function po= inter is > NULL. If not, it calls it, otherwise it calls v->type_uint64(). But nei= ther of > these pointers are ever set. Fallback to calling v->type_int() in this = third > (default) case. >=20 > Signed-off-by: Vasilis Liaskovitis Is this patch still needed? I thought size -> int fallback was fixed differently for the deallocation visitor... Anyway, someone (Anthony?) recently suggested to drop the size visitor completely in favor of string type (cf. frequency visitor discussion). Regards, Andreas > --- > qapi/qapi-visit-core.c | 11 ++++++++++- > 1 files changed, 10 insertions(+), 1 deletions(-) >=20 > diff --git a/qapi/qapi-visit-core.c b/qapi/qapi-visit-core.c > index 7a82b63..497e693 100644 > --- a/qapi/qapi-visit-core.c > +++ b/qapi/qapi-visit-core.c > @@ -236,8 +236,17 @@ void visit_type_int64(Visitor *v, int64_t *obj, co= nst char *name, Error **errp) > =20 > void visit_type_size(Visitor *v, uint64_t *obj, const char *name, Erro= r **errp) > { > + int64_t value; > if (!error_is_set(errp)) { > - (v->type_size ? v->type_size : v->type_uint64)(v, obj, name, e= rrp); > + if (v->type_size) { > + v->type_size(v, obj, name, errp); > + } else if (v->type_uint64) { > + v->type_uint64(v, obj, name, errp); > + } else { > + value =3D *obj; > + v->type_int(v, &value, name, errp); > + *obj =3D value; > + } > } > } > =20 --=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