mirror of https://github.com/apache/cloudstack.git
kvm: truncate vnc password to 8 chars (#6244)
This PR truncates the vnc password of kvm vms to 8 chars to support latest versions of libvirt.
Backport of aa0197c141
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
3e1d85139a
commit
3d420b9622
|
|
@ -1723,7 +1723,7 @@ public class LibvirtVMDef {
|
|||
graphicBuilder.append(" listen=''");
|
||||
}
|
||||
if (_passwd != null) {
|
||||
graphicBuilder.append(" passwd='" + _passwd + "'");
|
||||
graphicBuilder.append(" passwd='" + StringUtils.truncate(_passwd, 8) + "'");
|
||||
} else if (_keyMap != null) {
|
||||
graphicBuilder.append(" _keymap='" + _keyMap + "'");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ import org.apache.cloudstack.utils.linux.CPUStat;
|
|||
import org.apache.cloudstack.utils.linux.MemStat;
|
||||
import org.apache.cloudstack.utils.qemu.QemuImg.PhysicalDiskFormat;
|
||||
import org.apache.commons.lang.SystemUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.joda.time.Duration;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
|
|
@ -372,7 +373,7 @@ public class LibvirtComputingResourceTest {
|
|||
assertXpath(domainDoc, "/domain/devices/graphics/@type", "vnc");
|
||||
assertXpath(domainDoc, "/domain/devices/graphics/@listen", to.getVncAddr());
|
||||
assertXpath(domainDoc, "/domain/devices/graphics/@autoport", "yes");
|
||||
assertXpath(domainDoc, "/domain/devices/graphics/@passwd", to.getVncPassword());
|
||||
assertXpath(domainDoc, "/domain/devices/graphics/@passwd", StringUtils.truncate(to.getVncPassword(), 8));
|
||||
|
||||
assertXpath(domainDoc, "/domain/devices/console/@type", "pty");
|
||||
assertXpath(domainDoc, "/domain/devices/console/target/@port", "0");
|
||||
|
|
|
|||
Loading…
Reference in New Issue