From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Henderson Subject: Re: [Qemu-devel] [RFC PATCH 01/13] Generic DMA memory access interface Date: Wed, 01 Jun 2011 08:45:56 -0700 Message-ID: <4DE65EB4.1070104@twiddle.net> References: <1306892315-7306-1-git-send-email-eduard.munteanu@linux360.ro> <1306892315-7306-2-git-send-email-eduard.munteanu@linux360.ro> <4DE64646.3010505@twiddle.net> <20110601145227.GA2936@localhost> <4DE65629.1010300@twiddle.net> <20110601153510.GA3339@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: mst@redhat.com, aliguori@us.ibm.com, david@gibson.dropbear.id.au, kvm@vger.kernel.org, aik@ozlabs.ru, joro@8bytes.org, seabios@seabios.org, qemu-devel@nongnu.org, agraf@suse.de, blauwirbel@gmail.com, yamahata@valinux.co.jp, kevin@koconnor.net, avi@redhat.com, dwg@au1.ibm.com, paul@codesourcery.com To: Eduard - Gabriel Munteanu Return-path: Received: from mail-yx0-f174.google.com ([209.85.213.174]:41994 "EHLO mail-yx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758207Ab1FAPqB (ORCPT ); Wed, 1 Jun 2011 11:46:01 -0400 Received: by yxs7 with SMTP id 7so2264724yxs.19 for ; Wed, 01 Jun 2011 08:46:00 -0700 (PDT) In-Reply-To: <20110601153510.GA3339@localhost> Sender: kvm-owner@vger.kernel.org List-ID: On 06/01/2011 08:35 AM, Eduard - Gabriel Munteanu wrote: > Maybe it's not nice, but you're missing the fact upcasting gives you > some type safety. With opaques you have none. Lol. Do you understand what container_of does? This is not dynamic_cast<> with RTTI. You can put any type name in there that you like, so long as it has a field name to match. The type of the field you give doesn't even have to match the type of the pointer that you pass in. Type safety this is not. r~