1 /*
2  * Generic Virtual-Device Fuzzing Target Configs
3  *
4  * Copyright Red Hat Inc., 2020
5  *
6  * Authors:
7  *  Alexander Bulekov   <alxndr@bu.edu>
8  *
9  * This work is licensed under the terms of the GNU GPL, version 2 or later.
10  * See the COPYING file in the top-level directory.
11  */
12 
13 #ifndef GENERIC_FUZZ_CONFIGS_H
14 #define GENERIC_FUZZ_CONFIGS_H
15 
16 
17 typedef struct generic_fuzz_config {
18     const char *name, *args, *objects;
19 } generic_fuzz_config;
20 
21 const generic_fuzz_config predefined_configs[] = {
22     {
23         .name = "virtio-net-pci-slirp",
24         .args = "-M q35 -nodefaults "
25         "-device virtio-net,netdev=net0 -netdev user,id=net0",
26         .objects = "virtio*",
27     },{
28         .name = "virtio-blk",
29         .args = "-machine q35 -device virtio-blk,drive=disk0 "
30         "-drive file=null-co://,id=disk0,if=none,format=raw",
31         .objects = "virtio*",
32     },{
33         .name = "virtio-scsi",
34         .args = "-machine q35 -device virtio-scsi,num_queues=8 "
35         "-device scsi-hd,drive=disk0 "
36         "-drive file=null-co://,id=disk0,if=none,format=raw",
37         .objects = "scsi* virtio*",
38     },{
39         .name = "virtio-gpu",
40         .args = "-machine q35 -nodefaults -device virtio-gpu",
41         .objects = "virtio*",
42     },{
43         .name = "virtio-vga",
44         .args = "-machine q35 -nodefaults -device virtio-vga",
45         .objects = "virtio*",
46     },{
47         .name = "virtio-rng",
48         .args = "-machine q35 -nodefaults -device virtio-rng",
49         .objects = "virtio*",
50     },{
51         .name = "virtio-balloon",
52         .args = "-machine q35 -nodefaults -device virtio-balloon",
53         .objects = "virtio*",
54     },{
55         .name = "virtio-serial",
56         .args = "-machine q35 -nodefaults -device virtio-serial",
57         .objects = "virtio*",
58     },{
59         .name = "virtio-mouse",
60         .args = "-machine q35 -nodefaults -device virtio-mouse",
61         .objects = "virtio*",
62     },{
63         .name = "e1000",
64         .args = "-M q35 -nodefaults "
65         "-device e1000,netdev=net0 -netdev user,id=net0",
66         .objects = "e1000",
67     },{
68         .name = "e1000e",
69         .args = "-M q35 -nodefaults "
70         "-device e1000e,netdev=net0 -netdev user,id=net0",
71         .objects = "e1000e",
72     },{
73         .name = "cirrus-vga",
74         .args = "-machine q35 -nodefaults -device cirrus-vga",
75         .objects = "cirrus*",
76     },{
77         .name = "bochs-display",
78         .args = "-machine q35 -nodefaults -device bochs-display",
79         .objects = "bochs*",
80     },{
81         .name = "intel-hda",
82         .args = "-machine q35 -nodefaults -device intel-hda,id=hda0 "
83         "-device hda-output,bus=hda0.0 -device hda-micro,bus=hda0.0 "
84         "-device hda-duplex,bus=hda0.0",
85         .objects = "intel-hda",
86     },{
87         .name = "ide-hd",
88         .args = "-machine q35 -nodefaults "
89         "-drive file=null-co://,if=none,format=raw,id=disk0 "
90         "-device ide-hd,drive=disk0",
91         .objects = "ahci*",
92     },{
93         .name = "floppy",
94         .args = "-machine pc -nodefaults -device floppy,id=floppy0 "
95         "-drive id=disk0,file=null-co://,file.read-zeroes=on,if=none,format=raw "
96         "-device floppy,drive=disk0,drive-type=288",
97         .objects = "fd* floppy* i8257",
98     },{
99         .name = "xhci",
100         .args = "-machine q35 -nodefaults "
101         "-drive file=null-co://,if=none,format=raw,id=disk0 "
102         "-device qemu-xhci,id=xhci -device usb-tablet,bus=xhci.0 "
103         "-device usb-bot -device usb-storage,drive=disk0 "
104         "-chardev null,id=cd0 -chardev null,id=cd1 "
105         "-device usb-braille,chardev=cd0 -device usb-ccid -device usb-ccid "
106         "-device usb-kbd -device usb-mouse -device usb-serial,chardev=cd1 "
107         "-device usb-tablet -device usb-wacom-tablet -device usb-audio",
108         .objects = "*usb* *uhci* *xhci*",
109     },{
110         .name = "pc-i440fx",
111         .args = "-machine pc",
112         .objects = "*",
113     },{
114         .name = "pc-q35",
115         .args = "-machine q35",
116         .objects = "*",
117     },{
118         .name = "vmxnet3",
119         .args = "-machine q35 -nodefaults "
120         "-device vmxnet3,netdev=net0 -netdev user,id=net0",
121         .objects = "vmxnet3"
122     },{
123         .name = "ne2k_pci",
124         .args = "-machine q35 -nodefaults "
125         "-device ne2k_pci,netdev=net0 -netdev user,id=net0",
126         .objects = "ne2k*"
127     },{
128         .name = "pcnet",
129         .args = "-machine q35 -nodefaults "
130         "-device pcnet,netdev=net0 -netdev user,id=net0",
131         .objects = "pcnet"
132     },{
133         .name = "rtl8139",
134         .args = "-machine q35 -nodefaults "
135         "-device rtl8139,netdev=net0 -netdev user,id=net0",
136         .objects = "rtl8139"
137     },{
138         .name = "i82550",
139         .args = "-machine q35 -nodefaults "
140         "-device i82550,netdev=net0 -netdev user,id=net0",
141         .objects = "eepro*"
142     },{
143         .name = "sdhci-v3",
144         .args = "-nodefaults -device sdhci-pci,sd-spec-version=3 "
145         "-device sd-card,drive=mydrive "
146         "-drive if=sd,index=0,file=null-co://,format=raw,id=mydrive -nographic",
147         .objects = "sd*"
148     },{
149         .name = "ehci",
150         .args = "-machine q35 -nodefaults "
151         "-device ich9-usb-ehci1,bus=pcie.0,addr=1d.7,"
152         "multifunction=on,id=ich9-ehci-1 "
153         "-device ich9-usb-uhci1,bus=pcie.0,addr=1d.0,"
154         "multifunction=on,masterbus=ich9-ehci-1.0,firstport=0 "
155         "-device ich9-usb-uhci2,bus=pcie.0,addr=1d.1,"
156         "multifunction=on,masterbus=ich9-ehci-1.0,firstport=2 "
157         "-device ich9-usb-uhci3,bus=pcie.0,addr=1d.2,"
158         "multifunction=on,masterbus=ich9-ehci-1.0,firstport=4 "
159         "-drive if=none,id=usbcdrom,media=cdrom "
160         "-device usb-tablet,bus=ich9-ehci-1.0,port=1,usb_version=1 "
161         "-device usb-storage,bus=ich9-ehci-1.0,port=2,drive=usbcdrom",
162         .objects = "*usb* *hci*",
163     },{
164         .name = "ohci",
165         .args = "-machine q35 -nodefaults  -device pci-ohci -device usb-kbd",
166         .objects = "*usb* *ohci*",
167     },{
168         .name = "megaraid",
169         .args = "-machine q35 -nodefaults -device megasas -device scsi-cd,drive=null0 "
170         "-blockdev driver=null-co,read-zeroes=on,node-name=null0",
171         .objects = "megasas*",
172     },{
173         .name = "ac97",
174         .args = "-machine q35 -nodefaults "
175         "-device ac97,audiodev=snd0 -audiodev none,id=snd0 -nodefaults",
176         .objects = "ac97*",
177     },{
178         .name = "cs4231a",
179         .args = "-machine q35 -nodefaults "
180         "-device cs4231a,audiodev=snd0 -audiodev none,id=snd0 -nodefaults",
181         .objects = "cs4231a* i8257*",
182     },{
183         .name = "es1370",
184         .args = "-machine q35 -nodefaults "
185         "-device es1370,audiodev=snd0 -audiodev none,id=snd0 -nodefaults",
186         .objects = "es1370*",
187     },{
188         .name = "sb16",
189         .args = "-machine q35 -nodefaults "
190         "-device sb16,audiodev=snd0 -audiodev none,id=snd0 -nodefaults",
191         .objects = "sb16* i8257*",
192     },{
193         .name = "parallel",
194         .args = "-machine q35 -nodefaults "
195         "-parallel file:/dev/null",
196         .objects = "parallel*",
197     }
198 };
199 
200 #endif
201