aboutsummaryrefslogtreecommitdiff
path: root/monitor.c
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 /monitor.c
parent47b053690e8582ab52e09181c2c3f19a2ade134f (diff)
downloadqemu-821601ea5b02a68ada479731a4d3d07a9876632a.zip
qemu-821601ea5b02a68ada479731a4d3d07a9876632a.tar.gz
qemu-821601ea5b02a68ada479731a4d3d07a9876632a.tar.bz2
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 'monitor.c')
-rw-r--r--monitor.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/monitor.c b/monitor.c
index 552e951..76a8207 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1020,6 +1020,7 @@ static int do_quit(Monitor *mon, const QDict *qdict, QObject **ret_data)
return 0;
}
+#ifdef CONFIG_VNC
static int change_vnc_password(const char *password)
{
if (!password || !password[0]) {
@@ -1066,6 +1067,13 @@ static int do_change_vnc(Monitor *mon, const char *target, const char *arg)
return 0;
}
+#else
+static int do_change_vnc(Monitor *mon, const char *target, const char *arg)
+{
+ qerror_report(QERR_FEATURE_DISABLED, "vnc");
+ return -ENODEV;
+}
+#endif
/**
* do_change(): Change a removable medium, or VNC configuration
@@ -1131,12 +1139,7 @@ static int set_password(Monitor *mon, const QDict *qdict, QObject **ret_data)
}
/* Note that setting an empty password will not disable login through
* this interface. */
- rc = vnc_display_password(NULL, password);
- if (rc != 0) {
- qerror_report(QERR_SET_PASSWD_FAILED);
- return -1;
- }
- return 0;
+ return vnc_display_password(NULL, password);
}
qerror_report(QERR_INVALID_PARAMETER, "protocol");
@@ -1175,12 +1178,7 @@ static int expire_password(Monitor *mon, const QDict *qdict, QObject **ret_data)
}
if (strcmp(protocol, "vnc") == 0) {
- rc = vnc_display_pw_expire(NULL, when);
- if (rc != 0) {
- qerror_report(QERR_SET_PASSWD_FAILED);
- return -1;
- }
- return 0;
+ return vnc_display_pw_expire(NULL, when);
}
qerror_report(QERR_INVALID_PARAMETER, "protocol");