struct mon_fd_t {
char *name;
int fd;
- LIST_ENTRY(mon_fd_t) next;
+ QLIST_ENTRY(mon_fd_t) next;
};
struct Monitor {
CPUState *mon_cpu;
BlockDriverCompletionFunc *password_completion_cb;
void *password_opaque;
- LIST_HEAD(,mon_fd_t) fds;
- LIST_ENTRY(Monitor) entry;
+ QLIST_HEAD(,mon_fd_t) fds;
+ QLIST_ENTRY(Monitor) entry;
};
-static LIST_HEAD(mon_list, Monitor) mon_list;
+static QLIST_HEAD(mon_list, Monitor) mon_list;
static const mon_cmd_t mon_cmds[];
static const mon_cmd_t info_cmds[];
const char *device = qdict_get_str(qdict, "device");
all_devices = !strcmp(device, "all");
- TAILQ_FOREACH(dinfo, &drives, next) {
+ QTAILQ_FOREACH(dinfo, &drives, next) {
if (!all_devices)
if (strcmp(bdrv_get_device_name(dinfo->bdrv), device))
continue;
#endif
/* Capture support */
-static LIST_HEAD (capture_list_head, CaptureState) capture_head;
+static QLIST_HEAD (capture_list_head, CaptureState) capture_head;
static void do_info_capture(Monitor *mon)
{
for (s = capture_head.lh_first, i = 0; s; s = s->entries.le_next, ++i) {
if (i == n) {
s->ops.destroy (s->opaque);
- LIST_REMOVE (s, entries);
+ QLIST_REMOVE (s, entries);
qemu_free (s);
return;
}
monitor_printf(mon, "Faied to add wave capture\n");
qemu_free (s);
}
- LIST_INSERT_HEAD (&capture_head, s, entries);
+ QLIST_INSERT_HEAD (&capture_head, s, entries);
}
#endif
if (acl) {
monitor_printf(mon, "policy: %s\n",
acl->defaultDeny ? "deny" : "allow");
- TAILQ_FOREACH(entry, &acl->entries, next) {
+ QTAILQ_FOREACH(entry, &acl->entries, next) {
i++;
monitor_printf(mon, "%d: %s %s\n", i,
entry->deny ? "deny" : "allow", entry->match);
return;
}
- LIST_FOREACH(monfd, &mon->fds, next) {
+ QLIST_FOREACH(monfd, &mon->fds, next) {
if (strcmp(monfd->name, fdname) != 0) {
continue;
}
monfd->name = qemu_strdup(fdname);
monfd->fd = fd;
- LIST_INSERT_HEAD(&mon->fds, monfd, next);
+ QLIST_INSERT_HEAD(&mon->fds, monfd, next);
}
static void do_closefd(Monitor *mon, const QDict *qdict)
const char *fdname = qdict_get_str(qdict, "fdname");
mon_fd_t *monfd;
- LIST_FOREACH(monfd, &mon->fds, next) {
+ QLIST_FOREACH(monfd, &mon->fds, next) {
if (strcmp(monfd->name, fdname) != 0) {
continue;
}
- LIST_REMOVE(monfd, next);
+ QLIST_REMOVE(monfd, next);
close(monfd->fd);
qemu_free(monfd->name);
qemu_free(monfd);
{
mon_fd_t *monfd;
- LIST_FOREACH(monfd, &mon->fds, next) {
+ QLIST_FOREACH(monfd, &mon->fds, next) {
int fd;
if (strcmp(monfd->name, fdname) != 0) {
fd = monfd->fd;
/* caller takes ownership of fd */
- LIST_REMOVE(monfd, next);
+ QLIST_REMOVE(monfd, next);
qemu_free(monfd->name);
qemu_free(monfd);
qemu_chr_add_handlers(chr, monitor_can_read, monitor_read, monitor_event,
mon);
- LIST_INSERT_HEAD(&mon_list, mon, entry);
+ QLIST_INSERT_HEAD(&mon_list, mon, entry);
if (!cur_mon || (flags & MONITOR_IS_DEFAULT))
cur_mon = mon;
}