Re: [PATCH v6 2/4] qemu_command: switch accelerator option to new style

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





在 2021/11/22 16:43, Peter Krempa 写道:
On Sat, Nov 20, 2021 at 03:20:46 -0500, huangy81@xxxxxxxxxxxxxxx wrote:
From: Hyman Huang(黄勇) <huangy81@xxxxxxxxxxxxxxx>

QEMU greater than 2.9.0 support '-accel' option, change the way
of assembling commandline from "accel=kvm" to "-accel kvm" when
specifying accelerator.

Signed-off-by: Hyman Huang(黄勇) <huangy81@xxxxxxxxxxxxxxx>
---

[...]


diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 3108bdd581..a8f73c2d3e 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -7027,6 +7027,23 @@ qemuBuildNameCommandLine(virCommand *cmd,
      return 0;
  }
+static void
+qemuBuildAccelCommandLineKvmOptions(virCommand *cmd,
+                                    const virDomainDef *def)
+{
+    /*
+     * only handle the kvm case, tcg case use the legacy style
+     * not that either kvm or tcg can be specified by libvirt
+     * so do not worry about the conflict of specifying both
+     * */
+    if ((virDomainVirtType)def->virtType == VIR_DOMAIN_VIRT_KVM) {
+        g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
+        virCommandAddArg(cmd, "-accel");
+        virBufferAddLit(&buf, "kvm");
+        virCommandAddArgBuffer(cmd, &buf);
+    }
+}

Michal's patch that I referenced in my previous reply seems to be a bit
better and more extensible. I'd prefer if we go with that one.

Sounds good, i'll rebase this commit.

--
Best regard

Hyman Huang(黄勇)





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux