From 194b0a1c59438795b0fc2fc8a204c4604d154233 Mon Sep 17 00:00:00 2001 From: Zexi Li Date: Tue, 14 Dec 2021 21:02:25 +0800 Subject: [PATCH] feat(host): qemu add uuid option --- pkg/hostman/guestman/qemu-arm.go | 1 + pkg/hostman/guestman/qemu-kvmhelper.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/hostman/guestman/qemu-arm.go b/pkg/hostman/guestman/qemu-arm.go index 682dfb7d08..bcc821a148 100644 --- a/pkg/hostman/guestman/qemu-arm.go +++ b/pkg/hostman/guestman/qemu-arm.go @@ -188,6 +188,7 @@ func (s *SKVMGuestInstance) generateArmStartScript(data *jsonutils.JSONDict) (st // exceeds the recommended cpus supported by KVM (32) cmd += fmt.Sprintf(" -smp %d,maxcpus=32", cpu) cmd += fmt.Sprintf(" -name %s", name) + cmd += fmt.Sprintf(" -uuid %s", uuid) cmd += fmt.Sprintf(" -m %dM,slots=4,maxmem=262144M", mem) if options.HostOptions.HugepagesOption == "native" { diff --git a/pkg/hostman/guestman/qemu-kvmhelper.go b/pkg/hostman/guestman/qemu-kvmhelper.go index 6304016400..3bfb120e9b 100644 --- a/pkg/hostman/guestman/qemu-kvmhelper.go +++ b/pkg/hostman/guestman/qemu-kvmhelper.go @@ -521,7 +521,7 @@ function nic_mtu() { // #cmd += " -g 800x600" cmd += fmt.Sprintf(" -smp %d,maxcpus=255", cpu) cmd += fmt.Sprintf(" -name %s", name) - // #cmd += fmt.Sprintf(" -uuid %s", self.desc["uuid"]) + cmd += fmt.Sprintf(" -uuid %s", uuid) cmd += fmt.Sprintf(" -m %dM,slots=4,maxmem=524288M", mem) if s.manager.host.IsHugepagesEnabled() {