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:
Jes Sorensen 2011-03-16 13:33:36 +01:00 committed by Anthony Liguori
parent 47b053690e
commit 821601ea5b
7 changed files with 104 additions and 43 deletions

View file

@ -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)