All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: Avi Kivity <avi@qumranet.com>
Cc: kvm-devel@lists.sf.net, Aurelien Jarno <aurelien@aurel32.net>
Subject: Re: [PATCH] Use QEMU functions to access guest memory for	virtio
Date: Wed, 26 Mar 2008 09:41:18 -0500	[thread overview]
Message-ID: <47EA608E.3040708@codemonkey.ws> (raw)
In-Reply-To: <47EA5E92.5080004@qumranet.com>

Avi Kivity wrote:
> Anthony Liguori wrote:
>   
>>> #define s_ld_u64(phys, field, type) \
>>>       ldq_phys(phys + offsetof(field, type))
>>>
>>>
>>> And now we don't need individual accessors, or to encode the offsets 
>>> as magic numbers.
>>>       
>> It's a nice thought but it doesn't work out in practice because most 
>> of these accessor functions are accessing array elements.  However, I 
>> thought about using offsetof() to eliminate the magic constants and I 
>> don't think that's a bad idea.  In the very least, it makes the code 
>> more readable.  It'll be part of the next series.
>>
>>     
>
> offsetof() should work for array members (i.e. offsetof(struct s, a[8])).
>   

You're right.  That's pretty sweet.

Regards,

Anthony Liguori



-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace

  reply	other threads:[~2008-03-26 14:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-25 21:39 [PATCH] Use QEMU functions to access guest memory for virtio Anthony Liguori
2008-03-26 13:27 ` Avi Kivity
2008-03-26 14:23   ` Anthony Liguori
2008-03-26 14:32     ` Avi Kivity
2008-03-26 14:41       ` Anthony Liguori [this message]
2008-03-29 21:49       ` Anthony Liguori
2008-03-30 10:51         ` Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47EA608E.3040708@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=aurelien@aurel32.net \
    --cc=avi@qumranet.com \
    --cc=kvm-devel@lists.sf.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.