Skip to content

Commit 2ef53b2

Browse files
committed
optimize qemu params on x86_64
1 parent 05e3eb8 commit 2ef53b2

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

source/aarch64.d

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ class AARCH64_VM : VirtualMachine
2323
return [
2424
"-machine", "virt",
2525
"-cpu", "max",
26-
"-bios", "/usr/share/qemu/aavmf-aarch64-code.bin"
27-
26+
"-bios", "/usr/share/qemu/aavmf-aarch64-code.bin",
2827
];
2928
}
3029

@@ -33,7 +32,7 @@ class AARCH64_VM : VirtualMachine
3332
{
3433
return [
3534
"-drive",
36-
format("file=%s,if=virtio,cache=none,aio=native,discard=unmap", diskPath)
35+
format("file=%s,if=virtio,cache=writeback,aio=native,discard=unmap,cache.direct=on", diskPath)
3736
];
3837
}
3938

source/ppc64le.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class PPC64LE_VM : VirtualMachine
2525
{
2626
return [
2727
"-drive",
28-
format("file=%s,if=virtio,cache=none,aio=native,discard=unmap", diskPath)
28+
format("file=%s,if=virtio,cache=writeback,aio=native,discard=unmap,cache.direct=on", diskPath)
2929
];
3030
}
3131

source/x86_64.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class X86_64_VM : VirtualMachine
1717
/// Returns an array of architecture-specific QEMU arguments.
1818
override string[] getArchArgs()
1919
{
20-
return ["-M", "q35"];
20+
return ["-M", "q35", "-enable-kvm", "-cpu", "host"];
2121
}
2222

2323
/// Returns an array of QEMU arguments for graphical output.
@@ -31,7 +31,7 @@ class X86_64_VM : VirtualMachine
3131
{
3232
return [
3333
"-drive",
34-
format("file=%s,if=virtio,cache=none,aio=native,discard=unmap", diskPath)
34+
format("file=%s,if=virtio,cache=writeback,aio=native,discard=unmap,cache.direct=on", diskPath)
3535
];
3636
}
3737

0 commit comments

Comments
 (0)