qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH-RFC 01/13] virtio: export virtqueue structure


From: Anthony Liguori
Subject: [Qemu-devel] Re: [PATCH-RFC 01/13] virtio: export virtqueue structure
Date: Mon, 25 Jan 2010 13:23:35 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091209 Fedora/3.0-4.fc12 Lightning/1.0pre Thunderbird/3.0

On 01/25/2010 01:10 PM, Michael S. Tsirkin wrote:
On Tue, Jan 12, 2010 at 04:32:44PM -0600, Anthony Liguori wrote:
On 01/11/2010 11:16 AM, Michael S. Tsirkin wrote:
vhost needs physical addresses for
ring so expose that structure.

Signed-off-by: Michael S. Tsirkin<address@hidden>

I think accessor functions might make more sense.

Regards,

Anthony Liguori
Well, take a look:

typedef struct VRing
{
     unsigned int num;
     target_phys_addr_t desc;
     target_phys_addr_t avail;
     target_phys_addr_t used;
} VRing;

struct VirtQueue
{
     VRing vring;
     target_phys_addr_t pa;
     uint16_t last_avail_idx;
     int inuse;
     uint16_t vector;
     void (*handle_output)(VirtIODevice *vdev, VirtQueue *vq);
     VirtIODevice *vdev;
     EventNotifier guest_notifier;
     EventNotifier host_notifier;
}

(Notifiers are added by patches I will shortly post).
We need at least:

     unsigned int num;
     target_phys_addr_t desc;
     target_phys_addr_t avail;
     target_phys_addr_t used;
     VRing vring;
     target_phys_addr_t pa;

You need num and the physical address of the ring. The location of desc/available/used are all fixed offsets rom the start of the ring (by spec).

     uint16_t vector;
     VirtIODevice *vdev;
     EventNotifier guest_notifier;
     EventNotifier host_notifier;

guest_notifier and host_notifier appear to be new. I don't see them in your previous patchset. I can't see why you need vdev. The backlink is there only for handle_output because handle_output is passed a VirtQueue. I also don't see you using vector in this patch series.

So at least from what you posted in the RFC, you just need to know the ring pa and num which would be totally reasonable to have an accessor for.

Regards,

Anthony Liguori




reply via email to

[Prev in Thread] Current Thread [Next in Thread]