aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/lguest
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2009-07-30 18:03:46 -0400
committerRusty Russell <rusty@rustcorp.com.au>2009-07-30 02:33:46 -0400
commit1842f23c05b6a866be831aa60bc8a8731c58ddd0 (patch)
tree8047f21d149b3958b5c4278c1a5601ddce9e0e4b /Documentation/lguest
parenta91d74a3c4de8115295ee87350c13a329164aaaf (diff)
lguest and virtio: cleanup struct definitions to Linux style.
I've been doing this for years, and akpm picked me up on it about 12 months ago. lguest partly serves as example code, so let's do it Right. Also, remove two unused fields in struct vblk_info in the example launcher. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Cc: Ingo Molnar <mingo@redhat.com>
Diffstat (limited to 'Documentation/lguest')
-rw-r--r--Documentation/lguest/lguest.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/Documentation/lguest/lguest.c b/Documentation/lguest/lguest.c
index 45163651b519..950cde6d6e58 100644
--- a/Documentation/lguest/lguest.c
+++ b/Documentation/lguest/lguest.c
@@ -93,8 +93,7 @@ static int lguest_fd;
93static unsigned int __thread cpu_id; 93static unsigned int __thread cpu_id;
94 94
95/* This is our list of devices. */ 95/* This is our list of devices. */
96struct device_list 96struct device_list {
97{
98 /* Counter to assign interrupt numbers. */ 97 /* Counter to assign interrupt numbers. */
99 unsigned int next_irq; 98 unsigned int next_irq;
100 99
@@ -114,8 +113,7 @@ struct device_list
114static struct device_list devices; 113static struct device_list devices;
115 114
116/* The device structure describes a single device. */ 115/* The device structure describes a single device. */
117struct device 116struct device {
118{
119 /* The linked-list pointer. */ 117 /* The linked-list pointer. */
120 struct device *next; 118 struct device *next;
121 119
@@ -140,8 +138,7 @@ struct device
140}; 138};
141 139
142/* The virtqueue structure describes a queue attached to a device. */ 140/* The virtqueue structure describes a queue attached to a device. */
143struct virtqueue 141struct virtqueue {
144{
145 struct virtqueue *next; 142 struct virtqueue *next;
146 143
147 /* Which device owns me. */ 144 /* Which device owns me. */
@@ -779,8 +776,7 @@ static void add_used_and_trigger(struct virtqueue *vq, unsigned head, int len)
779 * 776 *
780 * We associate some data with the console for our exit hack. 777 * We associate some data with the console for our exit hack.
781 */ 778 */
782struct console_abort 779struct console_abort {
783{
784 /* How many times have they hit ^C? */ 780 /* How many times have they hit ^C? */
785 int count; 781 int count;
786 /* When did they start? */ 782 /* When did they start? */
@@ -1570,20 +1566,13 @@ static void setup_tun_net(char *arg)
1570/*:*/ 1566/*:*/
1571 1567
1572/* This hangs off device->priv. */ 1568/* This hangs off device->priv. */
1573struct vblk_info 1569struct vblk_info {
1574{
1575 /* The size of the file. */ 1570 /* The size of the file. */
1576 off64_t len; 1571 off64_t len;
1577 1572
1578 /* The file descriptor for the file. */ 1573 /* The file descriptor for the file. */
1579 int fd; 1574 int fd;
1580 1575
1581 /* IO thread listens on this file descriptor [0]. */
1582 int workpipe[2];
1583
1584 /* IO thread writes to this file descriptor to mark it done, then
1585 * Launcher triggers interrupt to Guest. */
1586 int done_fd;
1587}; 1576};
1588 1577
1589/*L:210 1578/*L:210