From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:60691) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RW4he-0001XT-2n for qemu-devel@nongnu.org; Thu, 01 Dec 2011 06:21:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RW4hY-00048T-95 for qemu-devel@nongnu.org; Thu, 01 Dec 2011 06:21:21 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54434) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RW4hY-00048M-1s for qemu-devel@nongnu.org; Thu, 01 Dec 2011 06:21:16 -0500 Message-ID: <4ED76325.6080305@redhat.com> Date: Thu, 01 Dec 2011 13:21:09 +0200 From: Avi Kivity MIME-Version: 1.0 References: <1322687028-29714-1-git-send-email-aliguori@us.ibm.com> <1322687028-29714-8-git-send-email-aliguori@us.ibm.com> In-Reply-To: <1322687028-29714-8-git-send-email-aliguori@us.ibm.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 07/18] qom: add link properties List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Kevin Wolf , Peter Maydell , Stefan Hajnoczi , Jan Kiszka , qemu-devel@nongnu.org, Markus Armbruster , Luiz Capitulino On 11/30/2011 11:03 PM, Anthony Liguori wrote: > Links represent an ephemeral relationship between devices. They are meant to > replace the qdev concept of busses by allowing more informal relationships > between devices. So, links are equivalent to pointers? > Links are fairly limited in their usefulness without implementing QOM-style > subclassing and interfaces. > > > +static void qdev_get_link_property(DeviceState *dev, Visitor *v, void *opaque, > + const char *name, Error **errp) > +{ > + DeviceState **child = opaque; > + gchar *path; > + > + if (*child) { > + path = qdev_get_canonical_path(*child); > + visit_type_str(v, &path, name, errp); > + g_free(path); > + } else { > + path = (gchar *)""; If gchar != char, this is wrong. Also, you're converting a const pointer into a non-const pointer, discarding type safety. > + visit_type_str(v, &path, name, errp); > + } Shouldn't this be visit_type_link()? -- error compiling committee.c: too many arguments to function