[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [PATCH RFC] virtio: add features qdev property
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] Re: [PATCH RFC] virtio: add features qdev property |
Date: |
Mon, 14 Dec 2009 12:37:29 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4pre) Gecko/20090922 Fedora/3.0-3.9.b4.fc12 Lightning/1.0pre Thunderbird/3.0b4 |
On 12/14/09 12:10, Michael S. Tsirkin wrote:
On Mon, Dec 14, 2009 at 11:24:41AM +0100, Gerd Hoffmann wrote:
for block:
if (strcmp(s->serial_str, "0"))
features |= 1<< VIRTIO_BLK_F_IDENTIFY;
if (bdrv_is_read_only(s->bs))
features |= 1<< VIRTIO_BLK_F_RO;
Sure you want these be configurable?
Also, I'd like these things to be saved in bits and not add a ton
of fields in device. Ideas how to do this?
I guess you only want disable features?
You could have a bitmap property then, which accepts names for the bits.
It would need a table like this ...
char *bitnames[] = {
[ VIRTIO_BLK_F_IDENTIFY ] = "blk-identify",
[ VIRTIO_BLK_F_RO [ = "blk-ro",
[ ... ]
};
Then the property parser would accepts strings such as 'bit1|bit2' and
you can have
-device 'virtio-blk-pci,disable=blk-identify|ring-indirect'
The driver will just do 'vdev->host_features &= ~disable'.
cheers,
Gerd
- [Qemu-devel] [PATCH RFC] virtio: add features qdev property, Michael S. Tsirkin, 2009/12/13
- [Qemu-devel] Re: [PATCH RFC] virtio: add features qdev property, Gerd Hoffmann, 2009/12/14
- [Qemu-devel] Re: [PATCH RFC] virtio: add features qdev property, Michael S. Tsirkin, 2009/12/14
- [Qemu-devel] Re: [PATCH RFC] virtio: add features qdev property, Gerd Hoffmann, 2009/12/14
- [Qemu-devel] Re: [PATCH RFC] virtio: add features qdev property, Michael S. Tsirkin, 2009/12/14
- [Qemu-devel] Re: [PATCH RFC] virtio: add features qdev property,
Gerd Hoffmann <=
- [Qemu-devel] Re: [PATCH RFC] virtio: add features qdev property, Michael S. Tsirkin, 2009/12/14
- Re: [Qemu-devel] Re: [PATCH RFC] virtio: add features qdev property, Markus Armbruster, 2009/12/14
- Re: [Qemu-devel] Re: [PATCH RFC] virtio: add features qdev property, Michael S. Tsirkin, 2009/12/14
- Re: [Qemu-devel] Re: [PATCH RFC] virtio: add features qdev property, Gerd Hoffmann, 2009/12/14
- Re: [Qemu-devel] Re: [PATCH RFC] virtio: add features qdev property, Michael S. Tsirkin, 2009/12/14
- Re: [Qemu-devel] Re: [PATCH RFC] virtio: add features qdev property, Gerd Hoffmann, 2009/12/14
- Re: [Qemu-devel] Re: [PATCH RFC] virtio: add features qdev property, Michael S. Tsirkin, 2009/12/14
- Re: [Qemu-devel] Re: [PATCH RFC] virtio: add features qdev property, Gerd Hoffmann, 2009/12/14
- Re: [Qemu-devel] Re: [PATCH RFC] virtio: add features qdev property, Michael S. Tsirkin, 2009/12/14
- Re: [Qemu-devel] Re: [PATCH RFC] virtio: add features qdev property, Gerd Hoffmann, 2009/12/14