-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathController.java
More file actions
94 lines (83 loc) · 1.92 KB
/
Copy pathController.java
File metadata and controls
94 lines (83 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
package javaforce.vm;
import java.io.*;
/** Controller (optional).
*
* libvirt will usually automatically add required controllers.
*
* @author pquiring
*/
public class Controller extends Address implements Serializable {
private static final long serialVersionUID = 1L;
//type
public String type;
public String model;
public Controller(String type, String model) {
this.type = type;
this.model = model;
}
public Controller(String type, String model, String addr_type, String domain, String bus, String slot, String function) {
this.type = type;
this.model = model;
this.addr_type = addr_type;
this.domain = domain;
this.bus = bus;
this.slot = slot;
this.function = function;
}
public static String[] get_scsi_models() {
return new String[] {
"auto",
"buslogic",
"ibmvscsi",
"lsilogic",
"lsisas1068",
"lsisas1078",
"virtio-scsi",
"vmpvscsi",
"virtio-transitional",
"virtio-non-transitional",
"ncr53c90",
"am53c974",
"dc390",
};
}
public static String[] get_usb_models() {
return new String[] {
"auto",
"piix3-uhci",
"piix4-uhci",
"ehci",
"ich9-ehci1",
"ich9-uhci1",
"ich9-uhci2",
"ich9-uhci3",
"vt82c686b-uhci",
"pci-ohci",
"nec-xhci",
"qusb1",
"qusb2",
"qemu-xhci",
};
}
public static String[] get_ide_models() {
return new String[] {
"auto",
"piix3",
"piix4",
"ich6"
};
}
public String toString() {
return type + ":" + model;
}
public String toXML() {
StringBuilder xml = new StringBuilder();
if (type == null || type.equals("auto")) return "";
xml.append("<controller type='" + type + "' model='" + model + "'>");
if (!type.endsWith("-root")) {
xml.append(getAddressXML());
}
xml.append("</controller>");
return xml.toString();
}
}