summaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorJes Sorensen <Jes.Sorensen@redhat.com>2011-03-16 13:33:36 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2011-03-22 08:39:12 -0500
commit821601ea5b02a68ada479731a4d3d07a9876632a (patch)
tree1d99ac90c4a076ebd06f3c9df1656186f0b56cf2 /ui
parent47b053690e8582ab52e09181c2c3f19a2ade134f (diff)
downloadqemu-821601ea5b02a68ada479731a4d3d07a9876632a.tar.gz
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>
Diffstat (limited to 'ui')
-rw-r--r--ui/vnc.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/ui/vnc.c b/ui/vnc.c
index fdc4a70d02..0b5aad2952 100644
--- a/ui/vnc.c
+++ b/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)