diff options
Diffstat (limited to 'recipes-test/virt-test/files/virt-test-ppc.patch')
-rw-r--r-- | recipes-test/virt-test/files/virt-test-ppc.patch | 121 |
1 files changed, 121 insertions, 0 deletions
diff --git a/recipes-test/virt-test/files/virt-test-ppc.patch b/recipes-test/virt-test/files/virt-test-ppc.patch new file mode 100644 index 0000000..865f42d --- /dev/null +++ b/recipes-test/virt-test/files/virt-test-ppc.patch | |||
@@ -0,0 +1,121 @@ | |||
1 | Enable ppc support in virt-test | ||
2 | |||
3 | Signed-off-by: Jonas Eriksson <jonas.eriksson@enea.com> | ||
4 | Upstream-Status: Pending | ||
5 | diff --git a/virttest/arch.py b/virttest/arch.py | ||
6 | index d5e92f6..b1f0084 100644 | ||
7 | --- a/virttest/arch.py | ||
8 | +++ b/virttest/arch.py | ||
9 | @@ -3,7 +3,7 @@ from virttest import utils_misc | ||
10 | |||
11 | ARCH = platform.machine() | ||
12 | |||
13 | -if ARCH == "ppc64": | ||
14 | +if ARCH == "ppc64" or ARCH == "ppc": | ||
15 | # From include/linux/sockios.h | ||
16 | SIOCSIFHWADDR = 0x8924 | ||
17 | SIOCGIFHWADDR = 0x8927 | ||
18 | @@ -58,5 +58,5 @@ def get_kvm_module_list(): | ||
19 | arch_convert = {'GenuineIntel': 'intel', 'AuthenticAMD': 'amd'} | ||
20 | host_cpu_type = utils_misc.get_cpu_vendor(verbose=False) | ||
21 | return ["kvm", "kvm-%s" % arch_convert[host_cpu_type]] | ||
22 | - elif ARCH == 'ppc64': | ||
23 | + elif ARCH == 'ppc64' or ARCH == 'ppc': | ||
24 | return ["kvm"] | ||
25 | diff --git a/virttest/utils_misc.py b/virttest/utils_misc.py | ||
26 | index c6a3104..a5098be 100644 | ||
27 | --- a/virttest/utils_misc.py | ||
28 | +++ b/virttest/utils_misc.py | ||
29 | @@ -1589,6 +1590,8 @@ def get_host_cpu_models(): | ||
30 | |||
31 | if ARCH == 'ppc64': | ||
32 | return ['POWER7'] | ||
33 | + if ARCH == 'ppc': | ||
34 | + return ['e500mc'] | ||
35 | |||
36 | cpu_types = {"AuthenticAMD": ["Opteron_G5", "Opteron_G4", "Opteron_G3", | ||
37 | "Opteron_G2", "Opteron_G1"], | ||
38 | diff --git a/virttest/qemu_vm.py b/virttest/qemu_vm.py | ||
39 | index 27a6025..3e982bb 100644 | ||
40 | --- a/virttest/qemu_vm.py | ||
41 | +++ b/virttest/qemu_vm.py | ||
42 | @@ -421,20 +421,33 @@ class VM(virt_vm.BaseVM): | ||
43 | cmd += _add_option("mode", "control") | ||
44 | return cmd | ||
45 | |||
46 | - def add_serial(devices, name, filename): | ||
47 | - if not devices.has_option("chardev"): | ||
48 | - return " -serial unix:'%s',server,nowait" % filename | ||
49 | - | ||
50 | - serial_id = "serial_id_%s" % name | ||
51 | + def add_serial_chardev(serial_id, filename): | ||
52 | cmd = " -chardev socket" | ||
53 | cmd += _add_option("id", serial_id) | ||
54 | cmd += _add_option("path", filename) | ||
55 | cmd += _add_option("server", "NO_EQUAL_STRING") | ||
56 | cmd += _add_option("nowait", "NO_EQUAL_STRING") | ||
57 | + return cmd | ||
58 | + | ||
59 | + def add_isa_serial(devices, name, filename): | ||
60 | + if not devices.has_option("chardev"): | ||
61 | + return " -serial unix:'%s',server,nowait" % filename | ||
62 | + | ||
63 | + serial_id = "serial_id_%s" % name | ||
64 | + cmd = add_serial_chardev(serial_id, filename) | ||
65 | cmd += " -device isa-serial" | ||
66 | cmd += _add_option("chardev", serial_id) | ||
67 | return cmd | ||
68 | |||
69 | + def add_direct_serial(devices, name, filename): | ||
70 | + if not devices.has_option("chardev"): | ||
71 | + return " -serial unix:'%s',server,nowait" % filename | ||
72 | + | ||
73 | + serial_id = "serial_id_%s" % name | ||
74 | + cmd = add_serial_chardev(serial_id, filename) | ||
75 | + cmd += " -serial chardev:%s" % serial_id | ||
76 | + return cmd | ||
77 | + | ||
78 | def add_virtio_port(devices, name, bus, filename, porttype, chardev, | ||
79 | name_prefix=None, index=None, extra_params=""): | ||
80 | """ | ||
81 | @@ -1190,7 +1203,11 @@ class VM(virt_vm.BaseVM): | ||
82 | # Add serial console redirection | ||
83 | for serial in params.objects("isa_serials"): | ||
84 | serial_filename = vm.get_serial_console_filename(serial) | ||
85 | - cmd = add_serial(devices, serial, serial_filename) | ||
86 | + cmd = add_isa_serial(devices, serial, serial_filename) | ||
87 | + devices.insert(StrDev('SER-%s' % serial, cmdline=cmd)) | ||
88 | + for serial in params.objects("direct_serials"): | ||
89 | + serial_filename = vm.get_serial_console_filename(serial) | ||
90 | + cmd = add_direct_serial(devices, serial, serial_filename) | ||
91 | devices.insert(StrDev('SER-%s' % serial, cmdline=cmd)) | ||
92 | |||
93 | # Add virtio_serial ports | ||
94 | @@ -1473,10 +1490,10 @@ class VM(virt_vm.BaseVM): | ||
95 | continue | ||
96 | cpu_model = model | ||
97 | break | ||
98 | - else: | ||
99 | - cpu_model = model | ||
100 | - logging.error("Non existing CPU model %s will be passed " | ||
101 | - "to qemu (wrong config or negative test)", model) | ||
102 | + else: | ||
103 | + cpu_model = model | ||
104 | + logging.error("Non existing CPU model %s will be passed " | ||
105 | + "to qemu (wrong config or negative test)", model) | ||
106 | |||
107 | if use_default_cpu_model: | ||
108 | cpu_model = params.get("default_cpu_model") | ||
109 | @@ -2230,9 +2247,11 @@ class VM(virt_vm.BaseVM): | ||
110 | # Add this monitor to the list | ||
111 | self.monitors += [monitor] | ||
112 | |||
113 | - # Create isa serial ports. | ||
114 | + # Create serial ports. | ||
115 | for serial in params.objects("isa_serials"): | ||
116 | self.serial_ports.append(serial) | ||
117 | + for serial in params.objects("direct_serials"): | ||
118 | + self.serial_ports.append(serial) | ||
119 | |||
120 | # Create virtio_ports (virtio_serialports and virtio_consoles) | ||
121 | i = 0 | ||