mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 10:34:58 -06:00
Make VNC support optional
Per default VNC is enabled. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
47b053690e
commit
821601ea5b
7 changed files with 104 additions and 43 deletions
14
ui/vnc.c
14
ui/vnc.c
|
@ -2638,16 +2638,19 @@ int vnc_display_disable_login(DisplayState *ds)
|
|||
|
||||
int vnc_display_password(DisplayState *ds, const char *password)
|
||||
{
|
||||
int ret = 0;
|
||||
VncDisplay *vs = ds ? (VncDisplay *)ds->opaque : vnc_display;
|
||||
|
||||
if (!vs) {
|
||||
return -1;
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (!password) {
|
||||
/* This is not the intention of this interface but err on the side
|
||||
of being safe */
|
||||
return vnc_display_disable_login(ds);
|
||||
ret = vnc_display_disable_login(ds);
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (vs->password) {
|
||||
|
@ -2656,8 +2659,11 @@ int vnc_display_password(DisplayState *ds, const char *password)
|
|||
}
|
||||
vs->password = qemu_strdup(password);
|
||||
vs->auth = VNC_AUTH_VNC;
|
||||
|
||||
return 0;
|
||||
out:
|
||||
if (ret != 0) {
|
||||
qerror_report(QERR_SET_PASSWD_FAILED);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int vnc_display_pw_expire(DisplayState *ds, time_t expires)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue