From: "Michael S. Tsirkin" <mst@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCHv4 1/2] qdev: add bit property type
Date: Mon, 4 Jan 2010 17:38:39 +0200 [thread overview]
Message-ID: <20100104153839.GB13813@redhat.com> (raw)
In-Reply-To: <4B41F9AC.9010104@redhat.com>
On Mon, Jan 04, 2010 at 03:22:36PM +0100, Gerd Hoffmann wrote:
> On 12/24/09 13:43, Michael S. Tsirkin wrote:
>> This adds "bit" property type, which is a boolean stored in a 32 bit
>> integer field, with legal values on and off. Will be used by virtio for
>> feature bits.
>
>> +static void *qdev_bit_prop_ptr(DeviceState *dev, Property *prop)
>> +{
>> + void *ptr = dev;
>> + assert(prop->info->type == PROP_TYPE_BIT);
>> + ptr += prop->offset / 32;
>> + return ptr;
>> +}
>
> I don't like that idea. IMHO prop->offset should be specified in bytes
> no matter what the property is. Better add a new prop->bitnr field to
> specify which bit of the 32bit word should be toggled. Then you don't
> need this function in the first place.
>
> cheers,
> Gerd
OK, I reworked the patches in this way.
next prev parent reply other threads:[~2010-01-04 15:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1261657570.git.mst@redhat.com>
[not found] ` <20091224124358.GB31553@redhat.com>
2010-01-04 14:22 ` [Qemu-devel] Re: [PATCHv4 1/2] qdev: add bit property type Gerd Hoffmann
2010-01-04 15:38 ` Michael S. Tsirkin [this message]
[not found] ` <20091224124427.GC31553@redhat.com>
2010-01-04 14:24 ` [Qemu-devel] Re: [PATCHv4 2/2] virtio: add features as qdev properties Gerd Hoffmann
2010-01-04 15:38 ` Michael S. Tsirkin
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=20100104153839.GB13813@redhat.com \
--to=mst@redhat.com \
--cc=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).