Revision 2569da0c monitor.c
b/monitor.c | ||
---|---|---|
429 | 429 |
qemu_key_check(bs, filename); |
430 | 430 |
} |
431 | 431 |
|
432 |
static void do_change_vnc(const char *target) |
|
432 |
static void do_change_vnc(const char *target, const char *arg)
|
|
433 | 433 |
{ |
434 | 434 |
if (strcmp(target, "passwd") == 0 || |
435 | 435 |
strcmp(target, "password") == 0) { |
436 | 436 |
char password[9]; |
437 |
monitor_readline("Password: ", 1, password, sizeof(password)); |
|
437 |
if (arg) { |
|
438 |
strncpy(password, arg, sizeof(password)); |
|
439 |
password[sizeof(password) - 1] = '\0'; |
|
440 |
} else |
|
441 |
monitor_readline("Password: ", 1, password, sizeof(password)); |
|
438 | 442 |
if (vnc_display_password(NULL, password) < 0) |
439 | 443 |
term_printf("could not set VNC server password\n"); |
440 | 444 |
} else { |
... | ... | |
443 | 447 |
} |
444 | 448 |
} |
445 | 449 |
|
446 |
static void do_change(const char *device, const char *target, const char *fmt)
|
|
450 |
static void do_change(const char *device, const char *target, const char *arg)
|
|
447 | 451 |
{ |
448 | 452 |
if (strcmp(device, "vnc") == 0) { |
449 |
do_change_vnc(target); |
|
453 |
do_change_vnc(target, arg);
|
|
450 | 454 |
} else { |
451 |
do_change_block(device, target, fmt);
|
|
455 |
do_change_block(device, target, arg);
|
|
452 | 456 |
} |
453 | 457 |
} |
454 | 458 |
|
Also available in: Unified diff