summaryrefslogtreecommitdiffstats
path: root/tools/lguest
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2015-02-11 15:18:01 +1030
committerRusty Russell <rusty@rustcorp.com.au>2015-02-11 16:47:40 +1030
commitebff01137acd21534fffaffcf35cd4a3681b95ae (patch)
tree34a7811fafd187fba328080ec9cb657299377a3b /tools/lguest
parent0d5b5d399f8cecfeebefdd010048b2d608eab463 (diff)
downloadlinux-ebff01137acd21534fffaffcf35cd4a3681b95ae.tar.bz2
lguest: Convert console device to virtio 1.0 PCI.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'tools/lguest')
-rw-r--r--tools/lguest/lguest.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/tools/lguest/lguest.c b/tools/lguest/lguest.c
index 842c82bd76ff..fadd5723ba57 100644
--- a/tools/lguest/lguest.c
+++ b/tools/lguest/lguest.c
@@ -2221,9 +2221,6 @@ static void init_pci_config(struct pci_config *pci, u16 type,
* PCI have specific codes for different types of devices.
* Linux doesn't care, but it's a good clue for people looking
* at the device.
- *
- * eg :
- * VIRTIO_ID_CONSOLE: class = 0x07, subclass = 0x00
*/
pci->class = class;
pci->subclass = subclass;
@@ -2370,7 +2367,7 @@ static void setup_console(void)
tcsetattr(STDIN_FILENO, TCSANOW, &term);
}
- dev = new_device("console", VIRTIO_ID_CONSOLE);
+ dev = new_pci_device("console", VIRTIO_ID_CONSOLE, 0x07, 0x00);
/* We store the console state in dev->priv, and initialize it. */
dev->priv = malloc(sizeof(struct console_abort));
@@ -2382,10 +2379,13 @@ static void setup_console(void)
* stdin. When they put something in the output queue, we write it to
* stdout.
*/
- add_virtqueue(dev, VIRTQUEUE_NUM, console_input);
- add_virtqueue(dev, VIRTQUEUE_NUM, console_output);
+ add_pci_virtqueue(dev, console_input);
+ add_pci_virtqueue(dev, console_output);
+
+ /* There's no configuration area for this device. */
+ no_device_config(dev);
- verbose("device %u: console\n", ++devices.device_num);
+ verbose("device %u: console\n", devices.device_num);
}
/*:*/