mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-10-24 23:41:52 +08:00
fix get vnc port error
This commit is contained in:
@@ -110,29 +110,21 @@ func (self *SKVMGuestDriver) GetGuestVncInfo(userCred mcclient.TokenCredential,
|
||||
err = fmt.Errorf("Can't get vnc information from host.")
|
||||
return nil, err
|
||||
}
|
||||
|
||||
/***
|
||||
Server:
|
||||
address: 0.0.0.0:5901
|
||||
auth: none
|
||||
Client: none
|
||||
***/
|
||||
|
||||
// info_vnc = result['results'].split('\n')
|
||||
// port = int(info_vnc[1].split(':')[-1].split()[0])
|
||||
|
||||
/*
|
||||
QEMU 2.12.1 monitor - type 'help' for more information
|
||||
(qemu) info vnc
|
||||
info vnc
|
||||
default:
|
||||
Server: :::5902 (ipv6)
|
||||
Auth: none (Sub: none)
|
||||
Server: 0.0.0.0:5902 (ipv4)
|
||||
Auth: none (Sub: none)
|
||||
/* QEMU 2.9.1
|
||||
info spice QEMU 2.12.1 monitor Server:
|
||||
Server: (qemu) info vnc address: 0.0.0.0:5901
|
||||
address: *:5921 info vnc auth: none
|
||||
migrated: false default: Client: none
|
||||
auth: spice Server: :::5902 (ipv6)
|
||||
compiled: 0.13.3 Auth: none (Sub: none)
|
||||
mouse-mode: server Server: 0.0.0.0:5902 (ipv4)
|
||||
Channels: none Auth: none (Sub: none)
|
||||
*/
|
||||
var port int
|
||||
if guest.CheckQemuVersion(guest.GetMetadata("__qemu_version", userCred), "2.12.1") {
|
||||
if guest.CheckQemuVersion(guest.GetMetadata("__qemu_version", userCred), "2.12.1") && strings.HasSuffix(cmd, "vnc") {
|
||||
port = findVNCPort2(results)
|
||||
} else {
|
||||
port = findVNCPort(results)
|
||||
|
||||
Reference in New Issue
Block a user