qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Re: [PATCHv4 1/2] qdev: add bit property type
       [not found] ` <20091224124358.GB31553@redhat.com>
@ 2010-01-04 14:22   ` Gerd Hoffmann
  2010-01-04 15:38     ` Michael S. Tsirkin
  0 siblings, 1 reply; 4+ messages in thread
From: Gerd Hoffmann @ 2010-01-04 14:22 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: qemu-devel

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Qemu-devel] Re: [PATCHv4 2/2] virtio: add features as qdev properties
       [not found] ` <20091224124427.GC31553@redhat.com>
@ 2010-01-04 14:24   ` Gerd Hoffmann
  2010-01-04 15:38     ` Michael S. Tsirkin
  0 siblings, 1 reply; 4+ messages in thread
From: Gerd Hoffmann @ 2010-01-04 14:24 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: qemu-devel

On 12/24/09 13:44, Michael S. Tsirkin wrote:
> Add feature bits as properties to virtio. This makes it possible to e.g. define
> machine without indirect buffer support, which is required for 0.10
> compatibility, or without hardware checksum support, which is required for 0.11
> compatibility.  Since default values for optional features are now set by qdev,
> get_features callback has been modified: it sets non-optional bits, and clears
> bits not supported by host.

I guess you'll need a bunch of entries for pc-0.10 and pc-0.11 to switch 
the virtio devices into the correct compatibility modes?  Should 
probably go as patch #3 of this series.

cheers,
   Gerd

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Qemu-devel] Re: [PATCHv4 2/2] virtio: add features as qdev properties
  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
  0 siblings, 0 replies; 4+ messages in thread
From: Michael S. Tsirkin @ 2010-01-04 15:38 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: qemu-devel

On Mon, Jan 04, 2010 at 03:24:18PM +0100, Gerd Hoffmann wrote:
> On 12/24/09 13:44, Michael S. Tsirkin wrote:
>> Add feature bits as properties to virtio. This makes it possible to e.g. define
>> machine without indirect buffer support, which is required for 0.10
>> compatibility, or without hardware checksum support, which is required for 0.11
>> compatibility.  Since default values for optional features are now set by qdev,
>> get_features callback has been modified: it sets non-optional bits, and clears
>> bits not supported by host.
>
> I guess you'll need a bunch of entries for pc-0.10 and pc-0.11 to switch  
> the virtio devices into the correct compatibility modes?  Should  
> probably go as patch #3 of this series.
>
> cheers,
>   Gerd

Yes, but this will be done separately, after these are applied.

-- 
MST

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Qemu-devel] Re: [PATCHv4 1/2] qdev: add bit property type
  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
  0 siblings, 0 replies; 4+ messages in thread
From: Michael S. Tsirkin @ 2010-01-04 15:38 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: qemu-devel

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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-01-04 15:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [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
     [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

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).