Revision 72cf2d4f monitor.c

b/monitor.c
80 80
struct mon_fd_t {
81 81
    char *name;
82 82
    int fd;
83
    LIST_ENTRY(mon_fd_t) next;
83
    QLIST_ENTRY(mon_fd_t) next;
84 84
};
85 85

  
86 86
struct Monitor {
......
95 95
    CPUState *mon_cpu;
96 96
    BlockDriverCompletionFunc *password_completion_cb;
97 97
    void *password_opaque;
98
    LIST_HEAD(,mon_fd_t) fds;
99
    LIST_ENTRY(Monitor) entry;
98
    QLIST_HEAD(,mon_fd_t) fds;
99
    QLIST_ENTRY(Monitor) entry;
100 100
};
101 101

  
102
static LIST_HEAD(mon_list, Monitor) mon_list;
102
static QLIST_HEAD(mon_list, Monitor) mon_list;
103 103

  
104 104
static const mon_cmd_t mon_cmds[];
105 105
static const mon_cmd_t info_cmds[];
......
270 270
    const char *device = qdict_get_str(qdict, "device");
271 271

  
272 272
    all_devices = !strcmp(device, "all");
273
    TAILQ_FOREACH(dinfo, &drives, next) {
273
    QTAILQ_FOREACH(dinfo, &drives, next) {
274 274
        if (!all_devices)
275 275
            if (strcmp(bdrv_get_device_name(dinfo->bdrv), device))
276 276
                continue;
......
1477 1477
#endif
1478 1478

  
1479 1479
/* Capture support */
1480
static LIST_HEAD (capture_list_head, CaptureState) capture_head;
1480
static QLIST_HEAD (capture_list_head, CaptureState) capture_head;
1481 1481

  
1482 1482
static void do_info_capture(Monitor *mon)
1483 1483
{
......
1500 1500
    for (s = capture_head.lh_first, i = 0; s; s = s->entries.le_next, ++i) {
1501 1501
        if (i == n) {
1502 1502
            s->ops.destroy (s->opaque);
1503
            LIST_REMOVE (s, entries);
1503
            QLIST_REMOVE (s, entries);
1504 1504
            qemu_free (s);
1505 1505
            return;
1506 1506
        }
......
1528 1528
        monitor_printf(mon, "Faied to add wave capture\n");
1529 1529
        qemu_free (s);
1530 1530
    }
1531
    LIST_INSERT_HEAD (&capture_head, s, entries);
1531
    QLIST_INSERT_HEAD (&capture_head, s, entries);
1532 1532
}
1533 1533
#endif
1534 1534

  
......
1600 1600
    if (acl) {
1601 1601
        monitor_printf(mon, "policy: %s\n",
1602 1602
                       acl->defaultDeny ? "deny" : "allow");
1603
        TAILQ_FOREACH(entry, &acl->entries, next) {
1603
        QTAILQ_FOREACH(entry, &acl->entries, next) {
1604 1604
            i++;
1605 1605
            monitor_printf(mon, "%d: %s %s\n", i,
1606 1606
                           entry->deny ? "deny" : "allow", entry->match);
......
1729 1729
        return;
1730 1730
    }
1731 1731

  
1732
    LIST_FOREACH(monfd, &mon->fds, next) {
1732
    QLIST_FOREACH(monfd, &mon->fds, next) {
1733 1733
        if (strcmp(monfd->name, fdname) != 0) {
1734 1734
            continue;
1735 1735
        }
......
1743 1743
    monfd->name = qemu_strdup(fdname);
1744 1744
    monfd->fd = fd;
1745 1745

  
1746
    LIST_INSERT_HEAD(&mon->fds, monfd, next);
1746
    QLIST_INSERT_HEAD(&mon->fds, monfd, next);
1747 1747
}
1748 1748

  
1749 1749
static void do_closefd(Monitor *mon, const QDict *qdict)
......
1751 1751
    const char *fdname = qdict_get_str(qdict, "fdname");
1752 1752
    mon_fd_t *monfd;
1753 1753

  
1754
    LIST_FOREACH(monfd, &mon->fds, next) {
1754
    QLIST_FOREACH(monfd, &mon->fds, next) {
1755 1755
        if (strcmp(monfd->name, fdname) != 0) {
1756 1756
            continue;
1757 1757
        }
1758 1758

  
1759
        LIST_REMOVE(monfd, next);
1759
        QLIST_REMOVE(monfd, next);
1760 1760
        close(monfd->fd);
1761 1761
        qemu_free(monfd->name);
1762 1762
        qemu_free(monfd);
......
1782 1782
{
1783 1783
    mon_fd_t *monfd;
1784 1784

  
1785
    LIST_FOREACH(monfd, &mon->fds, next) {
1785
    QLIST_FOREACH(monfd, &mon->fds, next) {
1786 1786
        int fd;
1787 1787

  
1788 1788
        if (strcmp(monfd->name, fdname) != 0) {
......
1792 1792
        fd = monfd->fd;
1793 1793

  
1794 1794
        /* caller takes ownership of fd */
1795
        LIST_REMOVE(monfd, next);
1795
        QLIST_REMOVE(monfd, next);
1796 1796
        qemu_free(monfd->name);
1797 1797
        qemu_free(monfd);
1798 1798

  
......
3178 3178
    qemu_chr_add_handlers(chr, monitor_can_read, monitor_read, monitor_event,
3179 3179
                          mon);
3180 3180

  
3181
    LIST_INSERT_HEAD(&mon_list, mon, entry);
3181
    QLIST_INSERT_HEAD(&mon_list, mon, entry);
3182 3182
    if (!cur_mon || (flags & MONITOR_IS_DEFAULT))
3183 3183
        cur_mon = mon;
3184 3184
}

Also available in: Unified diff