qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] virtio virt-queue and virt-ring


From: Yaodong Yang
Subject: [Qemu-devel] virtio virt-queue and virt-ring
Date: Sun, 01 Dec 2013 05:12:52 +0000 (GMT)

Inside file ./hw/virtio/virtio.c, The following structs are defined. I understood that for each virtual disk, there is a corresponding queue and this queue is implemented by a ring. My questions is what is the meaning of each element inside struct VRing?

Thanks a lot!

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

struct VirtQueue
{
    VRing vring;
    hwaddr pa;
    uint16_t last_avail_idx;
    /* Last used index value we have signalled on */
    uint16_t signalled_used;

    /* Last used index value we have signalled on */
    bool signalled_used_valid;

    /* Notification enabled? */
    bool notification;

    uint16_t queue_index;

    int inuse;

    uint16_t vector;
    void (*handle_output)(VirtIODevice *vdev, VirtQueue *vq);
    VirtIODevice *vdev;
    EventNotifier guest_notifier;
    EventNotifier host_notifier;
};

reply via email to

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