mirror of
https://github.com/ultravioletrs/cocos.git
synced 2026-06-23 04:10:25 +00:00
Fix capitalized Vnc field and increment Vnc on run (#139)
Corrected the struct field 'vnc' to 'Vnc' to match Go's public field naming conventions and to make it exportable. Each QEMU virtual machine's VNC display number now increments upon instantiation to avoid display conflicts. Signed-off-by: SammyOina <sammyoina@gmail.com>
This commit is contained in:
committed by
GitHub
parent
ff64c10ac3
commit
4c4161ccfb
@@ -55,7 +55,7 @@ type SevConfig struct {
|
||||
type VSockConfig struct {
|
||||
ID string `env:"VSOCK_ID" envDefault:"vhost-vsock-pci0"`
|
||||
GuestCID int `env:"VSOCK_GUEST_CID" envDefault:"3"`
|
||||
vnc int `env:"VSOCK_VNC" envDefault:"0"`
|
||||
Vnc int `env:"VSOCK_VNC" envDefault:"0"`
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
@@ -157,7 +157,7 @@ func constructQemuArgs(config Config) []string {
|
||||
config.VirtioNetPciConfig.ROMFile))
|
||||
|
||||
args = append(args, "-device", fmt.Sprintf("vhost-vsock-pci,id=%s,guest-cid=%d", config.VSockConfig.ID, config.VSockConfig.GuestCID))
|
||||
args = append(args, "-vnc", fmt.Sprintf(":%d", config.vnc))
|
||||
args = append(args, "-vnc", fmt.Sprintf(":%d", config.Vnc))
|
||||
|
||||
if config.EnableSEVSNP {
|
||||
args = append(args, "-object",
|
||||
|
||||
@@ -119,6 +119,7 @@ func (ms *managerService) Run(ctx context.Context, c *manager.ComputationRunReq)
|
||||
return "", err
|
||||
}
|
||||
ms.qemuCfg.VSockConfig.GuestCID++
|
||||
ms.qemuCfg.VSockConfig.Vnc++
|
||||
|
||||
ms.publishEvent("vm-provision", c.Id, "complete", json.RawMessage{})
|
||||
return fmt.Sprint(ms.qemuCfg.HostFwdAgent), nil
|
||||
|
||||
Reference in New Issue
Block a user