Received: from eggs.gnu.org ([2001:4830:134:3::10]:57085) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VmzL2-0005Ce-GR for qemu-devel@nongnu.org; Sun, 01 Dec 2013 00:13:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VmzKt-0001ep-Od for qemu-devel@nongnu.org; Sun, 01 Dec 2013 00:13:00 -0500 MIME-version: 1.0 Content-type: multipart/alternative; boundary="Boundary_(ID_kKesIn67Swmo7nul6OlVww)" From: Yaodong Yang Date: Sun, 01 Dec 2013 05:12:52 +0000 (GMT) Message-id: Subject: [Qemu-devel] virtio virt-queue and virt-ring List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, qemu-discuss@nongnu.org Cc: Yaodong Yang --Boundary_(ID_kKesIn67Swmo7nul6OlVww) Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: quoted-printable Inside file ./hw/virtio/virtio.c, The following structs are defined. I und= erstood that for each virtual disk, there is a corresponding queue and thi= s queue is implemented by a ring. My questions is what is the meaning of e= ach element inside struct VRing?=0A=0AThanks a lot!=0A=0Atypedef struct VR= ing=0A{=0A=A0 =A0 unsigned int num;=0A=A0 =A0 hwaddr desc;=0A=A0 =A0 hwadd= r avail;=0A=A0 =A0 hwaddr used;=0A} VRing;=0A=0Astruct VirtQueue=0A{=0A=A0= =A0 VRing vring;=0A=A0 =A0 hwaddr pa;=0A=A0 =A0 uint16_t last_avail_idx;=0A= =A0 =A0 /* Last used index value we have signalled on */=0A=A0 =A0 uint16_= t signalled_used;=0A=0A=A0 =A0 /* Last used index value we have signalled = on */=0A=A0 =A0 bool signalled_used_valid;=0A=0A=A0 =A0 /* Notification en= abled? */=0A=A0 =A0 bool notification;=0A=0A=A0 =A0 uint16_t queue_index;=0A= =0A=A0 =A0 int inuse;=0A=0A=A0 =A0 uint16_t vector;=0A=A0 =A0 void (*handl= e_output)(VirtIODevice *vdev, VirtQueue *vq);=0A=A0 =A0 VirtIODevice *vdev= ;=0A=A0 =A0 EventNotifier guest_notifier;=0A=A0 =A0 EventNotifier host_not= ifier;=0A};= --Boundary_(ID_kKesIn67Swmo7nul6OlVww) Content-type: multipart/related; boundary="Boundary_(ID_Ei55u3mecNFbLkK2NeYcFw)"; type="text/html" --Boundary_(ID_Ei55u3mecNFbLkK2NeYcFw) Content-type: text/html; CHARSET=US-ASCII Content-transfer-encoding: quoted-printable
Inside file ./hw/virtio/virtio.c, The following structs are defined. = I understood that for each virtual disk, there is a corresponding queue an= d this queue is implemented by a ring. My questions is what is the meaning= of each element inside struct VRing?

Thanks a lo= t!

typedef struct VRing
{
&nb= sp;   unsigned int num;
    hwaddr desc;
    hwaddr avail;
    hwaddr used;
} VRing;

struct VirtQueue
{
    VRing vring;
    hwaddr pa;
=     uint16_t last_avail_idx;
    /* Last use= d index value we have signalled on */
    uint16_t sig= nalled_used;

    /* Last used index val= ue we have signalled on */
    bool signalled_used_val= id;

    /* Notification enabled? */
    bool notification;

  &n= bsp; uint16_t queue_index;

    int inus= e;

    uint16_t vector;
 = ;   void (*handle_output)(VirtIODevice *vdev, VirtQueue *vq);
    VirtIODevice *vdev;
    EventNotifier= guest_notifier;
    EventNotifier host_notifier;
};
= --Boundary_(ID_Ei55u3mecNFbLkK2NeYcFw)-- --Boundary_(ID_kKesIn67Swmo7nul6OlVww)--