Loading console.h +0 −2 Original line number Diff line number Diff line Loading @@ -4,7 +4,6 @@ #include "qemu-char.h" #include "qdict.h" #include "notify.h" #include "qerror.h" #include "monitor.h" /* keyboard/mouse support */ Loading Loading @@ -388,7 +387,6 @@ static inline int vnc_display_password(DisplayState *ds, const char *password) } static inline int vnc_display_pw_expire(DisplayState *ds, time_t expires) { qerror_report(QERR_FEATURE_DISABLED, "vnc"); return -ENODEV; }; #endif Loading hmp-commands.hx +1 −2 Original line number Diff line number Diff line Loading @@ -1239,8 +1239,7 @@ ETEXI .args_type = "protocol:s,time:s", .params = "protocol time", .help = "set spice/vnc password expire-time", .user_print = monitor_user_noop, .mhandler.cmd_new = expire_password, .mhandler.cmd = hmp_expire_password, }, STEXI Loading hmp.c +10 −0 Original line number Diff line number Diff line Loading @@ -692,3 +692,13 @@ void hmp_set_password(Monitor *mon, const QDict *qdict) qmp_set_password(protocol, password, !!connected, connected, &err); hmp_handle_error(mon, &err); } void hmp_expire_password(Monitor *mon, const QDict *qdict) { const char *protocol = qdict_get_str(qdict, "protocol"); const char *whenstr = qdict_get_str(qdict, "time"); Error *err = NULL; qmp_expire_password(protocol, whenstr, &err); hmp_handle_error(mon, &err); } hmp.h +1 −0 Original line number Diff line number Diff line Loading @@ -50,5 +50,6 @@ void hmp_migrate_cancel(Monitor *mon, const QDict *qdict); void hmp_migrate_set_downtime(Monitor *mon, const QDict *qdict); void hmp_migrate_set_speed(Monitor *mon, const QDict *qdict); void hmp_set_password(Monitor *mon, const QDict *qdict); void hmp_expire_password(Monitor *mon, const QDict *qdict); #endif monitor.c +0 −39 Original line number Diff line number Diff line Loading @@ -884,45 +884,6 @@ static int do_change(Monitor *mon, const QDict *qdict, QObject **ret_data) return ret; } static int expire_password(Monitor *mon, const QDict *qdict, QObject **ret_data) { const char *protocol = qdict_get_str(qdict, "protocol"); const char *whenstr = qdict_get_str(qdict, "time"); time_t when; int rc; if (strcmp(whenstr, "now") == 0) { when = 0; } else if (strcmp(whenstr, "never") == 0) { when = TIME_MAX; } else if (whenstr[0] == '+') { when = time(NULL) + strtoull(whenstr+1, NULL, 10); } else { when = strtoull(whenstr, NULL, 10); } if (strcmp(protocol, "spice") == 0) { if (!using_spice) { /* correct one? spice isn't a device ,,, */ qerror_report(QERR_DEVICE_NOT_ACTIVE, "spice"); return -1; } rc = qemu_spice_set_pw_expire(when); if (rc != 0) { qerror_report(QERR_SET_PASSWD_FAILED); return -1; } return 0; } if (strcmp(protocol, "vnc") == 0) { return vnc_display_pw_expire(NULL, when); } qerror_report(QERR_INVALID_PARAMETER, "protocol"); return -1; } static int add_graphics_client(Monitor *mon, const QDict *qdict, QObject **ret_data) { const char *protocol = qdict_get_str(qdict, "protocol"); Loading Loading
console.h +0 −2 Original line number Diff line number Diff line Loading @@ -4,7 +4,6 @@ #include "qemu-char.h" #include "qdict.h" #include "notify.h" #include "qerror.h" #include "monitor.h" /* keyboard/mouse support */ Loading Loading @@ -388,7 +387,6 @@ static inline int vnc_display_password(DisplayState *ds, const char *password) } static inline int vnc_display_pw_expire(DisplayState *ds, time_t expires) { qerror_report(QERR_FEATURE_DISABLED, "vnc"); return -ENODEV; }; #endif Loading
hmp-commands.hx +1 −2 Original line number Diff line number Diff line Loading @@ -1239,8 +1239,7 @@ ETEXI .args_type = "protocol:s,time:s", .params = "protocol time", .help = "set spice/vnc password expire-time", .user_print = monitor_user_noop, .mhandler.cmd_new = expire_password, .mhandler.cmd = hmp_expire_password, }, STEXI Loading
hmp.c +10 −0 Original line number Diff line number Diff line Loading @@ -692,3 +692,13 @@ void hmp_set_password(Monitor *mon, const QDict *qdict) qmp_set_password(protocol, password, !!connected, connected, &err); hmp_handle_error(mon, &err); } void hmp_expire_password(Monitor *mon, const QDict *qdict) { const char *protocol = qdict_get_str(qdict, "protocol"); const char *whenstr = qdict_get_str(qdict, "time"); Error *err = NULL; qmp_expire_password(protocol, whenstr, &err); hmp_handle_error(mon, &err); }
hmp.h +1 −0 Original line number Diff line number Diff line Loading @@ -50,5 +50,6 @@ void hmp_migrate_cancel(Monitor *mon, const QDict *qdict); void hmp_migrate_set_downtime(Monitor *mon, const QDict *qdict); void hmp_migrate_set_speed(Monitor *mon, const QDict *qdict); void hmp_set_password(Monitor *mon, const QDict *qdict); void hmp_expire_password(Monitor *mon, const QDict *qdict); #endif
monitor.c +0 −39 Original line number Diff line number Diff line Loading @@ -884,45 +884,6 @@ static int do_change(Monitor *mon, const QDict *qdict, QObject **ret_data) return ret; } static int expire_password(Monitor *mon, const QDict *qdict, QObject **ret_data) { const char *protocol = qdict_get_str(qdict, "protocol"); const char *whenstr = qdict_get_str(qdict, "time"); time_t when; int rc; if (strcmp(whenstr, "now") == 0) { when = 0; } else if (strcmp(whenstr, "never") == 0) { when = TIME_MAX; } else if (whenstr[0] == '+') { when = time(NULL) + strtoull(whenstr+1, NULL, 10); } else { when = strtoull(whenstr, NULL, 10); } if (strcmp(protocol, "spice") == 0) { if (!using_spice) { /* correct one? spice isn't a device ,,, */ qerror_report(QERR_DEVICE_NOT_ACTIVE, "spice"); return -1; } rc = qemu_spice_set_pw_expire(when); if (rc != 0) { qerror_report(QERR_SET_PASSWD_FAILED); return -1; } return 0; } if (strcmp(protocol, "vnc") == 0) { return vnc_display_pw_expire(NULL, when); } qerror_report(QERR_INVALID_PARAMETER, "protocol"); return -1; } static int add_graphics_client(Monitor *mon, const QDict *qdict, QObject **ret_data) { const char *protocol = qdict_get_str(qdict, "protocol"); Loading