Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 148001
b: refs/heads/master
c: 95c517c
h: refs/heads/master
i:
  147999: 69879e5
v: v3
  • Loading branch information
Rusty Russell committed Jun 12, 2009
1 parent 2c05f58 commit 09efe65
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 38bc2b8c56a2e212bbd19de7cf9976dcc7bf9953
refs/heads/master: 95c517c09bad31a03e22f2fdb5f0aa26a490a92d
9 changes: 9 additions & 0 deletions trunk/Documentation/lguest/lguest.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ struct virtqueue
/* Last available index we saw. */
u16 last_avail_idx;

/* How many are used since we sent last irq? */
unsigned int pending_used;

/* Eventfd where Guest notifications arrive. */
int eventfd;

Expand Down Expand Up @@ -556,6 +559,11 @@ static void trigger_irq(struct virtqueue *vq)
{
unsigned long buf[] = { LHREQ_IRQ, vq->config.irq };

/* Don't inform them if nothing used. */
if (!vq->pending_used)
return;
vq->pending_used = 0;

/* If they don't want an interrupt, don't send one, unless empty. */
if ((vq->vring.avail->flags & VRING_AVAIL_F_NO_INTERRUPT)
&& lg_last_avail(vq) != vq->vring.avail->idx)
Expand Down Expand Up @@ -647,6 +655,7 @@ static void add_used(struct virtqueue *vq, unsigned int head, int len)
/* Make sure buffer is written before we update index. */
wmb();
vq->vring.used->idx++;
vq->pending_used++;
}

/* And here's the combo meal deal. Supersize me! */
Expand Down

0 comments on commit 09efe65

Please sign in to comment.