File: Set-CPU-type-for-mipsel-mips64el.patch

package info (click to toggle)
libguestfs 1%3A1.54.1-3.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 98,888 kB
  • sloc: ansic: 379,443; ml: 38,771; sh: 10,328; java: 9,631; cs: 6,377; haskell: 5,729; makefile: 5,178; python: 3,821; perl: 2,467; erlang: 2,461; ruby: 349; xml: 275; pascal: 257; javascript: 157; cpp: 10
file content (25 lines) | stat: -rw-r--r-- 822 bytes parent folder | download | duplicates (2)
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
From: Hilko Bengen <bengen@debian.org>
Date: Thu, 30 Dec 2021 21:05:43 +0100
Subject: Set CPU type for mipsel, mips64el

---
 lib/appliance-cpu.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/appliance-cpu.c b/lib/appliance-cpu.c
index 8ce5084..841e601 100644
--- a/lib/appliance-cpu.c
+++ b/lib/appliance-cpu.c
@@ -90,6 +90,12 @@ guestfs_int_get_cpu_model (int kvm)
 #elif defined(__loongarch64)
   /* qemu-system-loongarch64 doesn't yet support -cpu max */
   return NULL;
+#elif defined(__mips64)
+  /* Taken from https://gist.github.com/bradfa/46ceff759a0cf9f392cc069c4f0f095a */
+  return "5KEc";
+#elif defined(__mips)
+  /* Guessed from mips64 */
+  return "4KEc";
 #else
   /* On most architectures we can use "max" to get the best possible CPU.
    * For recent qemu this should work even on TCG.