aboutsummaryrefslogtreecommitdiffstats
path: root/monitor.c
diff options
context:
space:
mode:
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/monitor.c b/monitor.c
index 8e6bc4c..083d53b 100644
--- a/monitor.c
+++ b/monitor.c
@@ -70,13 +70,14 @@ static int monitor_parse(struct qemu_window *win, char *buf, int len)
cmd = win->mrun->cmd;
reply = strstr(buf, "\r\n");
if (!reply) {
+ reply = "";
if (debug)
- fprintf(stderr, "%s: no reply for \"%s\"\n", __FUNCTION__, cmd);
- goto out;
+ fprintf(stderr, "%s: empty reply for \"%s\"\n", __FUNCTION__, cmd);
+ } else {
+ reply += 2;
+ if (debug)
+ fprintf(stderr, "%s: \"%s\" -> [%s]\n", __FUNCTION__, cmd, reply);
}
- reply += 2;
- if (debug)
- fprintf(stderr, "%s: \"%s\" -> [%s]\n", __FUNCTION__, cmd, reply);
/* parse reply */
if (0 == strcmp(cmd, "info version")) {
@@ -111,9 +112,18 @@ static int monitor_parse(struct qemu_window *win, char *buf, int len)
} else if (0 == strcmp(cmd, "info block")) {
devices_parse_info_block(win, reply);
+ } else if (0 == strcmp(cmd, "info usb")) {
+ devices_parse_info_usb(win, reply);
+
+ } else if (0 == strcmp(cmd, "info usbhost")) {
+ devices_parse_info_usbhost(win, reply);
+
} else if (0 == strncmp(cmd, "eject ", 6) ||
- 0 == strncmp(cmd, "change ", 7)) {
- show_error(win, cmd, reply);
+ 0 == strncmp(cmd, "change ", 7) ||
+ 0 == strncmp(cmd, "usb_add ", 8) ||
+ 0 == strncmp(cmd, "usb_del ", 8)) {
+ if (strlen(reply))
+ show_error(win, cmd, reply);
}
out:
@@ -234,6 +244,6 @@ int monitor_connect(struct qemu_window *win, char *dest)
monitor_append(win, "info version");
monitor_append(win, "info name");
monitor_append(win, "info vnc");
- monitor_append(win, "info block");
+ devices_rescan(win);
return fd;
}