From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:48926) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOsNG-0004Bh-Ag for qemu-devel@nongnu.org; Thu, 18 Oct 2012 11:51:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TOsN9-0002XS-3l for qemu-devel@nongnu.org; Thu, 18 Oct 2012 11:51:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:12506) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOsN8-0002XC-Rc for qemu-devel@nongnu.org; Thu, 18 Oct 2012 11:50:59 -0400 Date: Thu, 18 Oct 2012 17:48:55 +0200 From: Stefan Hajnoczi Message-ID: <20121018154855.GA3656@stefanha-thinkpad.redhat.com> References: <1350572215-2231-1-git-send-email-stefanha@redhat.com> <1350572215-2231-3-git-send-email-stefanha@redhat.com> <50801ACF.50203@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <50801ACF.50203@redhat.com> Subject: Re: [Qemu-devel] [PATCH 2/4] net: add net_is_tap_client() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Anthony Liguori , Laszlo Ersek , qemu-devel@nongnu.org, Stefan Hajnoczi On Thu, Oct 18, 2012 at 05:05:51PM +0200, Paolo Bonzini wrote: > Il 18/10/2012 16:56, Stefan Hajnoczi ha scritto: > > From: Stefan Hajnoczi > > > > The vhost-net code interacts closely with the net/tap.c backend so that > > it can pass the underlying file descriptor to the vhost_net.ko driver. > > We need a check that confirms a NetClientState is indeed a tap backend > > (and not something else like slirp or socket). > > Could you use object_dynamic_cast(OBJECT(backend), TYPE_TAP_NET_CLIENT) > instead? Yes. Stefan