From 82d5be209653fcf5c564b2cece395e245396f164 Mon Sep 17 00:00:00 2001 From: wanyaoqi <18528551+wanyaoqi@users.noreply.github.com> Date: Thu, 11 Aug 2022 18:00:17 +0800 Subject: [PATCH] feat(region): add virtio vga type support (#14785) Signed-off-by: wanyaoqi Signed-off-by: wanyaoqi --- pkg/compute/models/guests.go | 2 +- pkg/mcclient/options/compute/servers.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/compute/models/guests.go b/pkg/compute/models/guests.go index 529f4cfa97..827d1aea84 100644 --- a/pkg/compute/models/guests.go +++ b/pkg/compute/models/guests.go @@ -4263,7 +4263,7 @@ func (self *SGuest) GetDeployConfigOnHost(ctx context.Context, userCred mcclient } func (self *SGuest) getVga() string { - if utils.IsInStringArray(self.Vga, []string{"cirrus", "vmware", "qxl"}) { + if utils.IsInStringArray(self.Vga, []string{"cirrus", "vmware", "qxl", "virtio", "std"}) { return self.Vga } return "std" diff --git a/pkg/mcclient/options/compute/servers.go b/pkg/mcclient/options/compute/servers.go index d740610232..788c1371bf 100644 --- a/pkg/mcclient/options/compute/servers.go +++ b/pkg/mcclient/options/compute/servers.go @@ -400,7 +400,7 @@ type ServerCreateOptionalOptions struct { Iso string `help:"ISO image ID" metavar:"IMAGE_ID" json:"cdrom"` VcpuCount int `help:"#CPU cores of VM server, default 1" default:"1" metavar:"" json:"vcpu_count" token:"ncpu"` InstanceType string `help:"instance flavor"` - Vga string `help:"VGA driver" choices:"std|vmware|cirrus|qxl"` + Vga string `help:"VGA driver" choices:"std|vmware|cirrus|qxl|virtio"` Vdi string `help:"VDI protocool" choices:"vnc|spice"` Bios string `help:"BIOS" choices:"BIOS|UEFI"` Machine string `help:"Machine type" choices:"pc|q35"` @@ -625,7 +625,7 @@ type ServerUpdateOptions struct { Name string `help:"New name to change"` Vmem string `help:"Memory size" json:"vmem_size"` Ncpu *int `help:"CPU count" json:"vcpu_count"` - Vga string `help:"VGA driver" choices:"std|vmware|cirrus|qxl"` + Vga string `help:"VGA driver" choices:"std|vmware|cirrus|qxl|virtio"` Vdi string `help:"VDI protocol" choices:"vnc|spice"` Bios string `help:"BIOS" choices:"BIOS|UEFI"` Desc string `help:"Description" json:"description"`