diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2015-02-10 23:48:01 -0500 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2015-02-11 01:17:40 -0500 |
commit | ebff01137acd21534fffaffcf35cd4a3681b95ae (patch) | |
tree | 34a7811fafd187fba328080ec9cb657299377a3b /tools | |
parent | 0d5b5d399f8cecfeebefdd010048b2d608eab463 (diff) |
lguest: Convert console device to virtio 1.0 PCI.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/lguest/lguest.c | 14 |
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, | |||
2221 | * PCI have specific codes for different types of devices. | 2221 | * PCI have specific codes for different types of devices. |
2222 | * Linux doesn't care, but it's a good clue for people looking | 2222 | * Linux doesn't care, but it's a good clue for people looking |
2223 | * at the device. | 2223 | * at the device. |
2224 | * | ||
2225 | * eg : | ||
2226 | * VIRTIO_ID_CONSOLE: class = 0x07, subclass = 0x00 | ||
2227 | */ | 2224 | */ |
2228 | pci->class = class; | 2225 | pci->class = class; |
2229 | pci->subclass = subclass; | 2226 | pci->subclass = subclass; |
@@ -2370,7 +2367,7 @@ static void setup_console(void) | |||
2370 | tcsetattr(STDIN_FILENO, TCSANOW, &term); | 2367 | tcsetattr(STDIN_FILENO, TCSANOW, &term); |
2371 | } | 2368 | } |
2372 | 2369 | ||
2373 | dev = new_device("console", VIRTIO_ID_CONSOLE); | 2370 | dev = new_pci_device("console", VIRTIO_ID_CONSOLE, 0x07, 0x00); |
2374 | 2371 | ||
2375 | /* We store the console state in dev->priv, and initialize it. */ | 2372 | /* We store the console state in dev->priv, and initialize it. */ |
2376 | dev->priv = malloc(sizeof(struct console_abort)); | 2373 | dev->priv = malloc(sizeof(struct console_abort)); |
@@ -2382,10 +2379,13 @@ static void setup_console(void) | |||
2382 | * stdin. When they put something in the output queue, we write it to | 2379 | * stdin. When they put something in the output queue, we write it to |
2383 | * stdout. | 2380 | * stdout. |
2384 | */ | 2381 | */ |
2385 | add_virtqueue(dev, VIRTQUEUE_NUM, console_input); | 2382 | add_pci_virtqueue(dev, console_input); |
2386 | add_virtqueue(dev, VIRTQUEUE_NUM, console_output); | 2383 | add_pci_virtqueue(dev, console_output); |
2384 | |||
2385 | /* There's no configuration area for this device. */ | ||
2386 | no_device_config(dev); | ||
2387 | 2387 | ||
2388 | verbose("device %u: console\n", ++devices.device_num); | 2388 | verbose("device %u: console\n", devices.device_num); |
2389 | } | 2389 | } |
2390 | /*:*/ | 2390 | /*:*/ |
2391 | 2391 | ||