From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: [Qemu-devel] [PATCH 3/6] virtio for QEMU Date: Fri, 04 Apr 2008 22:09:28 -0500 Message-ID: <47F6ED68.5090200@codemonkey.ws> References: <1206827760-4566-1-git-send-email-aliguori@us.ibm.com> <1206827760-4566-3-git-send-email-aliguori@us.ibm.com> <1206897941.3357.15.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel@lists.sourceforge.net, Marcelo Tosatti , qemu-devel@nongnu.org, Aurelien Jarno To: dor.laor@qumranet.com Return-path: In-Reply-To: <1206897941.3357.15.camel@localhost.localdomain> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces@lists.sourceforge.net Errors-To: kvm-devel-bounces@lists.sourceforge.net List-Id: kvm.vger.kernel.org Dor Laor wrote: > >> +static uint32_t vring_desc_len(VirtQueue *vq, unsigned int i) >> +{ > > Below there were place you did use offsetof(vq->vring.desc[i], len) so > we better be consistent + its nicer > >> + return ldl_phys(vq->vring.desc + i * sizeof(VRingDesc) + >> + offsetof(VRingDesc, len)); >> +} >> + Oh, this bit is different because you need to do offsetof(Type, member) and vq->vring.desc[i] is not a type. It only works when you're doing an array with member[X]. Regards, Anthony Liguori ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Register now and save $200. Hurry, offer ends at 11:59 p.m., Monday, April 7! Use priority code J8TLD2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone