提交 731b0364 编写于 作者: A aliguori

monitor: Decouple terminals (Jan Kiszka)

Currently all registered (and activate) monitor terminals work in
broadcast mode: Everyone sees what someone else types on some other
terminal and what the monitor reports back. This model is broken when
you have a management monitor terminal that is automatically operated
and some other terminal used for independent guest inspection. Such
additional terminals can be multiplexed device channels or a gdb
frontend connected to QEMU's stub.

Therefore, this patch decouples the buffers and states of all monitor
terminals, allowing the user to operate them independently. It finally
starts to use the 'mon' parameter that was introduced earlier with the
API rework. It also defines the default monitor: the first instantance
that has the MONITOR_IS_DEFAULT flag set, and that is the monitor
created via the "-monitor" command line switch (or "vc" if none is
given).

As the patch requires to rework the monitor suspension interface, it
also takes the freedom to make it "truely" suspending (so far suspending
meant suppressing the prompt, but inputs were still processed).
Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6715 c046a42c-6fe2-441c-8c8c-71466251a162
上级 4c36ba32
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
#include "migration.h" #include "migration.h"
#include "qemu-char.h" #include "qemu-char.h"
#include "sysemu.h" #include "sysemu.h"
#include "monitor.h"
#include "buffered_file.h" #include "buffered_file.h"
#include "block.h" #include "block.h"
...@@ -55,7 +54,7 @@ static int exec_close(FdMigrationState *s) ...@@ -55,7 +54,7 @@ static int exec_close(FdMigrationState *s)
MigrationState *exec_start_outgoing_migration(const char *command, MigrationState *exec_start_outgoing_migration(const char *command,
int64_t bandwidth_limit, int64_t bandwidth_limit,
int async) int detach)
{ {
FdMigrationState *s; FdMigrationState *s;
FILE *f; FILE *f;
...@@ -89,14 +88,11 @@ MigrationState *exec_start_outgoing_migration(const char *command, ...@@ -89,14 +88,11 @@ MigrationState *exec_start_outgoing_migration(const char *command,
s->mig_state.release = migrate_fd_release; s->mig_state.release = migrate_fd_release;
s->state = MIG_STATE_ACTIVE; s->state = MIG_STATE_ACTIVE;
s->detach = !async; s->mon_resume = NULL;
s->bandwidth_limit = bandwidth_limit; s->bandwidth_limit = bandwidth_limit;
if (s->detach == 1) { if (!detach)
dprintf("detaching from monitor\n"); migrate_fd_monitor_suspend(s);
monitor_suspend(cur_mon);
s->detach = 2;
}
migrate_fd_connect(s); migrate_fd_connect(s);
return &s->mig_state; return &s->mig_state;
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include "migration.h" #include "migration.h"
#include "qemu-char.h" #include "qemu-char.h"
#include "sysemu.h" #include "sysemu.h"
#include "monitor.h"
#include "buffered_file.h" #include "buffered_file.h"
#include "block.h" #include "block.h"
...@@ -79,7 +78,7 @@ static void tcp_wait_for_connect(void *opaque) ...@@ -79,7 +78,7 @@ static void tcp_wait_for_connect(void *opaque)
MigrationState *tcp_start_outgoing_migration(const char *host_port, MigrationState *tcp_start_outgoing_migration(const char *host_port,
int64_t bandwidth_limit, int64_t bandwidth_limit,
int async) int detach)
{ {
struct sockaddr_in addr; struct sockaddr_in addr;
FdMigrationState *s; FdMigrationState *s;
...@@ -98,7 +97,7 @@ MigrationState *tcp_start_outgoing_migration(const char *host_port, ...@@ -98,7 +97,7 @@ MigrationState *tcp_start_outgoing_migration(const char *host_port,
s->mig_state.release = migrate_fd_release; s->mig_state.release = migrate_fd_release;
s->state = MIG_STATE_ACTIVE; s->state = MIG_STATE_ACTIVE;
s->detach = !async; s->mon_resume = NULL;
s->bandwidth_limit = bandwidth_limit; s->bandwidth_limit = bandwidth_limit;
s->fd = socket(PF_INET, SOCK_STREAM, 0); s->fd = socket(PF_INET, SOCK_STREAM, 0);
if (s->fd == -1) { if (s->fd == -1) {
...@@ -108,11 +107,8 @@ MigrationState *tcp_start_outgoing_migration(const char *host_port, ...@@ -108,11 +107,8 @@ MigrationState *tcp_start_outgoing_migration(const char *host_port,
socket_set_nonblock(s->fd); socket_set_nonblock(s->fd);
if (s->detach == 1) { if (!detach)
dprintf("detaching from monitor\n"); migrate_fd_monitor_suspend(s);
monitor_suspend(cur_mon);
s->detach = 2;
}
do { do {
ret = connect(s->fd, (struct sockaddr *)&addr, sizeof(addr)); ret = connect(s->fd, (struct sockaddr *)&addr, sizeof(addr));
......
...@@ -125,6 +125,13 @@ void do_info_migrate(Monitor *mon) ...@@ -125,6 +125,13 @@ void do_info_migrate(Monitor *mon)
/* shared migration helpers */ /* shared migration helpers */
void migrate_fd_monitor_suspend(FdMigrationState *s)
{
s->mon_resume = cur_mon;
monitor_suspend(cur_mon);
dprintf("suspending monitor\n");
}
void migrate_fd_error(FdMigrationState *s) void migrate_fd_error(FdMigrationState *s)
{ {
dprintf("setting error state\n"); dprintf("setting error state\n");
...@@ -145,10 +152,8 @@ void migrate_fd_cleanup(FdMigrationState *s) ...@@ -145,10 +152,8 @@ void migrate_fd_cleanup(FdMigrationState *s)
close(s->fd); close(s->fd);
/* Don't resume monitor until we've flushed all of the buffers */ /* Don't resume monitor until we've flushed all of the buffers */
if (s->detach == 2) { if (s->mon_resume)
monitor_resume(cur_mon); monitor_resume(s->mon_resume);
s->detach = 0;
}
s->fd = -1; s->fd = -1;
} }
......
...@@ -39,7 +39,7 @@ struct FdMigrationState ...@@ -39,7 +39,7 @@ struct FdMigrationState
int64_t bandwidth_limit; int64_t bandwidth_limit;
QEMUFile *file; QEMUFile *file;
int fd; int fd;
int detach; Monitor *mon_resume;
int state; int state;
int (*get_error)(struct FdMigrationState*); int (*get_error)(struct FdMigrationState*);
int (*close)(struct FdMigrationState*); int (*close)(struct FdMigrationState*);
...@@ -69,6 +69,8 @@ MigrationState *tcp_start_outgoing_migration(const char *host_port, ...@@ -69,6 +69,8 @@ MigrationState *tcp_start_outgoing_migration(const char *host_port,
int64_t bandwidth_limit, int64_t bandwidth_limit,
int detach); int detach);
void migrate_fd_monitor_suspend(FdMigrationState *s);
void migrate_fd_error(FdMigrationState *s); void migrate_fd_error(FdMigrationState *s);
void migrate_fd_cleanup(FdMigrationState *s); void migrate_fd_cleanup(FdMigrationState *s);
......
...@@ -69,6 +69,14 @@ typedef struct mon_cmd_t { ...@@ -69,6 +69,14 @@ typedef struct mon_cmd_t {
struct Monitor { struct Monitor {
CharDriverState *chr; CharDriverState *chr;
int flags;
int suspend_cnt;
uint8_t outbuf[1024];
int outbuf_index;
ReadLineState *rs;
CPUState *mon_cpu;
BlockDriverCompletionFunc *password_completion_cb;
void *password_opaque;
LIST_ENTRY(Monitor) entry; LIST_ENTRY(Monitor) entry;
}; };
...@@ -77,34 +85,30 @@ static LIST_HEAD(mon_list, Monitor) mon_list; ...@@ -77,34 +85,30 @@ static LIST_HEAD(mon_list, Monitor) mon_list;
static const mon_cmd_t mon_cmds[]; static const mon_cmd_t mon_cmds[];
static const mon_cmd_t info_cmds[]; static const mon_cmd_t info_cmds[];
static uint8_t term_outbuf[1024];
static int term_outbuf_index;
static BlockDriverCompletionFunc *password_completion_cb;
static void *password_opaque;
ReadLineState *rs;
Monitor *cur_mon = NULL; Monitor *cur_mon = NULL;
static void monitor_start_input(void); static void monitor_command_cb(Monitor *mon, const char *cmdline,
void *opaque);
static CPUState *mon_cpu = NULL; static void monitor_read_command(Monitor *mon, int show_prompt)
{
readline_start(mon->rs, "(qemu) ", 0, monitor_command_cb, NULL);
if (show_prompt)
readline_show_prompt(mon->rs);
}
static void monitor_read_password(Monitor *mon, ReadLineFunc *readline_func, static void monitor_read_password(Monitor *mon, ReadLineFunc *readline_func,
void *opaque) void *opaque)
{ {
readline_start(rs, "Password: ", 1, readline_func, opaque); readline_start(mon->rs, "Password: ", 1, readline_func, opaque);
/* prompt is printed on return from the command handler */
} }
void monitor_flush(Monitor *mon) void monitor_flush(Monitor *mon)
{ {
Monitor *m; if (mon && mon->outbuf_index != 0 && mon->chr->focus == 0) {
qemu_chr_write(mon->chr, mon->outbuf, mon->outbuf_index);
if (term_outbuf_index > 0) { mon->outbuf_index = 0;
LIST_FOREACH(m, &mon_list, entry) {
if (m->chr->focus == 0)
qemu_chr_write(m->chr, term_outbuf, term_outbuf_index);
}
term_outbuf_index = 0;
} }
} }
...@@ -112,15 +116,19 @@ void monitor_flush(Monitor *mon) ...@@ -112,15 +116,19 @@ void monitor_flush(Monitor *mon)
static void monitor_puts(Monitor *mon, const char *str) static void monitor_puts(Monitor *mon, const char *str)
{ {
char c; char c;
if (!mon)
return;
for(;;) { for(;;) {
c = *str++; c = *str++;
if (c == '\0') if (c == '\0')
break; break;
if (c == '\n') if (c == '\n')
term_outbuf[term_outbuf_index++] = '\r'; mon->outbuf[mon->outbuf_index++] = '\r';
term_outbuf[term_outbuf_index++] = c; mon->outbuf[mon->outbuf_index++] = c;
if (term_outbuf_index >= (sizeof(term_outbuf) - 1) || if (mon->outbuf_index >= (sizeof(mon->outbuf) - 1)
c == '\n') || c == '\n')
monitor_flush(mon); monitor_flush(mon);
} }
} }
...@@ -291,7 +299,7 @@ static int mon_set_cpu(int cpu_index) ...@@ -291,7 +299,7 @@ static int mon_set_cpu(int cpu_index)
for(env = first_cpu; env != NULL; env = env->next_cpu) { for(env = first_cpu; env != NULL; env = env->next_cpu) {
if (env->cpu_index == cpu_index) { if (env->cpu_index == cpu_index) {
mon_cpu = env; cur_mon->mon_cpu = env;
return 0; return 0;
} }
} }
...@@ -300,10 +308,10 @@ static int mon_set_cpu(int cpu_index) ...@@ -300,10 +308,10 @@ static int mon_set_cpu(int cpu_index)
static CPUState *mon_get_cpu(void) static CPUState *mon_get_cpu(void)
{ {
if (!mon_cpu) { if (!cur_mon->mon_cpu) {
mon_set_cpu(0); mon_set_cpu(0);
} }
return mon_cpu; return cur_mon->mon_cpu;
} }
static void do_info_registers(Monitor *mon) static void do_info_registers(Monitor *mon)
...@@ -330,7 +338,7 @@ static void do_info_cpus(Monitor *mon) ...@@ -330,7 +338,7 @@ static void do_info_cpus(Monitor *mon)
for(env = first_cpu; env != NULL; env = env->next_cpu) { for(env = first_cpu; env != NULL; env = env->next_cpu) {
monitor_printf(mon, "%c CPU #%d:", monitor_printf(mon, "%c CPU #%d:",
(env == mon_cpu) ? '*' : ' ', (env == mon->mon_cpu) ? '*' : ' ',
env->cpu_index); env->cpu_index);
#if defined(TARGET_I386) #if defined(TARGET_I386)
monitor_printf(mon, " pc=0x" TARGET_FMT_lx, monitor_printf(mon, " pc=0x" TARGET_FMT_lx,
...@@ -367,7 +375,7 @@ static void do_info_history(Monitor *mon) ...@@ -367,7 +375,7 @@ static void do_info_history(Monitor *mon)
i = 0; i = 0;
for(;;) { for(;;) {
str = readline_get_history(rs, i); str = readline_get_history(mon->rs, i);
if (!str) if (!str)
break; break;
monitor_printf(mon, "%d: '%s'\n", i, str); monitor_printf(mon, "%d: '%s'\n", i, str);
...@@ -451,7 +459,7 @@ static void change_vnc_password_cb(Monitor *mon, const char *password, ...@@ -451,7 +459,7 @@ static void change_vnc_password_cb(Monitor *mon, const char *password,
if (vnc_display_password(NULL, password) < 0) if (vnc_display_password(NULL, password) < 0)
monitor_printf(mon, "could not set VNC server password\n"); monitor_printf(mon, "could not set VNC server password\n");
monitor_start_input(); monitor_read_command(mon, 1);
} }
static void do_change_vnc(Monitor *mon, const char *target, const char *arg) static void do_change_vnc(Monitor *mon, const char *target, const char *arg)
...@@ -2688,7 +2696,7 @@ static void cmd_completion(const char *name, const char *list) ...@@ -2688,7 +2696,7 @@ static void cmd_completion(const char *name, const char *list)
memcpy(cmd, pstart, len); memcpy(cmd, pstart, len);
cmd[len] = '\0'; cmd[len] = '\0';
if (name[0] == '\0' || !strncmp(name, cmd, strlen(name))) { if (name[0] == '\0' || !strncmp(name, cmd, strlen(name))) {
readline_add_completion(rs, cmd); readline_add_completion(cur_mon->rs, cmd);
} }
if (*p == '\0') if (*p == '\0')
break; break;
...@@ -2741,7 +2749,7 @@ static void file_completion(const char *input) ...@@ -2741,7 +2749,7 @@ static void file_completion(const char *input)
stat(file, &sb); stat(file, &sb);
if(S_ISDIR(sb.st_mode)) if(S_ISDIR(sb.st_mode))
pstrcat(file, sizeof(file), "/"); pstrcat(file, sizeof(file), "/");
readline_add_completion(rs, file); readline_add_completion(cur_mon->rs, file);
} }
} }
closedir(ffs); closedir(ffs);
...@@ -2754,7 +2762,7 @@ static void block_completion_it(void *opaque, BlockDriverState *bs) ...@@ -2754,7 +2762,7 @@ static void block_completion_it(void *opaque, BlockDriverState *bs)
if (input[0] == '\0' || if (input[0] == '\0' ||
!strncmp(name, (char *)input, strlen(input))) { !strncmp(name, (char *)input, strlen(input))) {
readline_add_completion(rs, name); readline_add_completion(cur_mon->rs, name);
} }
} }
...@@ -2814,7 +2822,7 @@ static void monitor_find_completion(const char *cmdline) ...@@ -2814,7 +2822,7 @@ static void monitor_find_completion(const char *cmdline)
cmdname = ""; cmdname = "";
else else
cmdname = args[0]; cmdname = args[0];
readline_set_completion_index(rs, strlen(cmdname)); readline_set_completion_index(cur_mon->rs, strlen(cmdname));
for(cmd = mon_cmds; cmd->name != NULL; cmd++) { for(cmd = mon_cmds; cmd->name != NULL; cmd++) {
cmd_completion(cmdname, cmd->name); cmd_completion(cmdname, cmd->name);
} }
...@@ -2838,23 +2846,23 @@ static void monitor_find_completion(const char *cmdline) ...@@ -2838,23 +2846,23 @@ static void monitor_find_completion(const char *cmdline)
switch(*ptype) { switch(*ptype) {
case 'F': case 'F':
/* file completion */ /* file completion */
readline_set_completion_index(rs, strlen(str)); readline_set_completion_index(cur_mon->rs, strlen(str));
file_completion(str); file_completion(str);
break; break;
case 'B': case 'B':
/* block device name completion */ /* block device name completion */
readline_set_completion_index(rs, strlen(str)); readline_set_completion_index(cur_mon->rs, strlen(str));
bdrv_iterate(block_completion_it, (void *)str); bdrv_iterate(block_completion_it, (void *)str);
break; break;
case 's': case 's':
/* XXX: more generic ? */ /* XXX: more generic ? */
if (!strcmp(cmd->name, "info")) { if (!strcmp(cmd->name, "info")) {
readline_set_completion_index(rs, strlen(str)); readline_set_completion_index(cur_mon->rs, strlen(str));
for(cmd = info_cmds; cmd->name != NULL; cmd++) { for(cmd = info_cmds; cmd->name != NULL; cmd++) {
cmd_completion(str, cmd->name); cmd_completion(str, cmd->name);
} }
} else if (!strcmp(cmd->name, "sendkey")) { } else if (!strcmp(cmd->name, "sendkey")) {
readline_set_completion_index(rs, strlen(str)); readline_set_completion_index(cur_mon->rs, strlen(str));
for(key = key_defs; key->name != NULL; key++) { for(key = key_defs; key->name != NULL; key++) {
cmd_completion(str, key->name); cmd_completion(str, key->name);
} }
...@@ -2868,49 +2876,45 @@ static void monitor_find_completion(const char *cmdline) ...@@ -2868,49 +2876,45 @@ static void monitor_find_completion(const char *cmdline)
qemu_free(args[i]); qemu_free(args[i]);
} }
static int term_can_read(void *opaque) static int monitor_can_read(void *opaque)
{ {
return 128; Monitor *mon = opaque;
return (mon->suspend_cnt == 0) ? 128 : 0;
} }
static void term_read(void *opaque, const uint8_t *buf, int size) static void monitor_read(void *opaque, const uint8_t *buf, int size)
{ {
Monitor *old_mon = cur_mon;
int i; int i;
for(i = 0; i < size; i++) cur_mon = opaque;
readline_handle_byte(rs, buf[i]);
} for (i = 0; i < size; i++)
readline_handle_byte(cur_mon->rs, buf[i]);
static int monitor_suspended; cur_mon = old_mon;
}
static void monitor_command_cb(Monitor *mon, const char *cmdline, void *opaque) static void monitor_command_cb(Monitor *mon, const char *cmdline, void *opaque)
{ {
monitor_suspend(mon);
monitor_handle_command(mon, cmdline); monitor_handle_command(mon, cmdline);
if (!monitor_suspended) monitor_resume(mon);
readline_show_prompt(rs);
else
monitor_suspended = 2;
} }
void monitor_suspend(Monitor *mon) void monitor_suspend(Monitor *mon)
{ {
monitor_suspended = 1; mon->suspend_cnt++;
} }
void monitor_resume(Monitor *mon) void monitor_resume(Monitor *mon)
{ {
if (monitor_suspended == 2) if (--mon->suspend_cnt == 0)
monitor_start_input(); readline_show_prompt(mon->rs);
monitor_suspended = 0;
} }
static void monitor_start_input(void) static void monitor_event(void *opaque, int event)
{
readline_start(rs, "(qemu) ", 0, monitor_command_cb, NULL);
readline_show_prompt(rs);
}
static void term_event(void *opaque, int event)
{ {
Monitor *mon = opaque; Monitor *mon = opaque;
...@@ -2919,13 +2923,12 @@ static void term_event(void *opaque, int event) ...@@ -2919,13 +2923,12 @@ static void term_event(void *opaque, int event)
monitor_printf(mon, "QEMU %s monitor - type 'help' for more information\n", monitor_printf(mon, "QEMU %s monitor - type 'help' for more information\n",
QEMU_VERSION); QEMU_VERSION);
monitor_start_input(); readline_show_prompt(mon->rs);
} }
static int is_first_init = 1; void monitor_init(CharDriverState *chr, int flags)
void monitor_init(CharDriverState *chr)
{ {
static int is_first_init = 1;
Monitor *mon; Monitor *mon;
if (is_first_init) { if (is_first_init) {
...@@ -2936,15 +2939,16 @@ void monitor_init(CharDriverState *chr) ...@@ -2936,15 +2939,16 @@ void monitor_init(CharDriverState *chr)
mon = qemu_mallocz(sizeof(*mon)); mon = qemu_mallocz(sizeof(*mon));
mon->chr = chr; mon->chr = chr;
rs = readline_init(mon, monitor_find_completion); mon->flags = flags;
mon->rs = readline_init(mon, monitor_find_completion);
monitor_read_command(mon, 0);
qemu_chr_add_handlers(chr, term_can_read, term_read, term_event, mon); qemu_chr_add_handlers(chr, monitor_can_read, monitor_read, monitor_event,
mon);
LIST_INSERT_HEAD(&mon_list, mon, entry); LIST_INSERT_HEAD(&mon_list, mon, entry);
if (!cur_mon) if (!cur_mon || (flags & MONITOR_IS_DEFAULT))
cur_mon = mon; cur_mon = mon;
readline_start(rs, "", 0, monitor_command_cb, NULL);
} }
static void bdrv_password_cb(Monitor *mon, const char *password, void *opaque) static void bdrv_password_cb(Monitor *mon, const char *password, void *opaque)
...@@ -2956,10 +2960,10 @@ static void bdrv_password_cb(Monitor *mon, const char *password, void *opaque) ...@@ -2956,10 +2960,10 @@ static void bdrv_password_cb(Monitor *mon, const char *password, void *opaque)
monitor_printf(mon, "invalid password\n"); monitor_printf(mon, "invalid password\n");
ret = -EPERM; ret = -EPERM;
} }
if (password_completion_cb) if (mon->password_completion_cb)
password_completion_cb(password_opaque, ret); mon->password_completion_cb(mon->password_opaque, ret);
monitor_start_input(); monitor_read_command(mon, 1);
} }
void monitor_read_bdrv_key_start(Monitor *mon, BlockDriverState *bs, void monitor_read_bdrv_key_start(Monitor *mon, BlockDriverState *bs,
...@@ -2975,8 +2979,8 @@ void monitor_read_bdrv_key_start(Monitor *mon, BlockDriverState *bs, ...@@ -2975,8 +2979,8 @@ void monitor_read_bdrv_key_start(Monitor *mon, BlockDriverState *bs,
monitor_printf(mon, "%s (%s) is encrypted.\n", bdrv_get_device_name(bs), monitor_printf(mon, "%s (%s) is encrypted.\n", bdrv_get_device_name(bs),
bdrv_get_encrypted_filename(bs)); bdrv_get_encrypted_filename(bs));
password_completion_cb = completion_cb; mon->password_completion_cb = completion_cb;
password_opaque = opaque; mon->password_opaque = opaque;
monitor_read_password(mon, bdrv_password_cb, bs); monitor_read_password(mon, bdrv_password_cb, bs);
} }
...@@ -7,7 +7,10 @@ ...@@ -7,7 +7,10 @@
extern Monitor *cur_mon; extern Monitor *cur_mon;
void monitor_init(CharDriverState *chr); /* flags for monitor_init */
#define MONITOR_IS_DEFAULT 0x01
void monitor_init(CharDriverState *chr, int flags);
void monitor_suspend(Monitor *mon); void monitor_suspend(Monitor *mon);
void monitor_resume(Monitor *mon); void monitor_resume(Monitor *mon);
......
...@@ -2123,7 +2123,7 @@ CharDriverState *qemu_chr_open(const char *label, const char *filename, void (*i ...@@ -2123,7 +2123,7 @@ CharDriverState *qemu_chr_open(const char *label, const char *filename, void (*i
chr = qemu_chr_open(label, p, NULL); chr = qemu_chr_open(label, p, NULL);
if (chr) { if (chr) {
chr = qemu_chr_open_mux(chr); chr = qemu_chr_open_mux(chr);
monitor_init(chr); monitor_init(chr, 0);
} else { } else {
printf("Unable to open driver: %s\n", p); printf("Unable to open driver: %s\n", p);
} }
......
...@@ -5684,7 +5684,7 @@ int main(int argc, char **argv, char **envp) ...@@ -5684,7 +5684,7 @@ int main(int argc, char **argv, char **envp)
qemu_chr_initial_reset(); qemu_chr_initial_reset();
if (monitor_device && monitor_hd) if (monitor_device && monitor_hd)
monitor_init(monitor_hd); monitor_init(monitor_hd, MONITOR_IS_DEFAULT);
for(i = 0; i < MAX_SERIAL_PORTS; i++) { for(i = 0; i < MAX_SERIAL_PORTS; i++) {
const char *devname = serial_devices[i]; const char *devname = serial_devices[i];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册