Revision 72cf2d4f hw/qdev.c

b/hw/qdev.c
101 101
    qdev_prop_set_defaults(dev, dev->info->props);
102 102
    qdev_prop_set_defaults(dev, dev->parent_bus->info->props);
103 103
    qdev_prop_set_compat(dev);
104
    LIST_INSERT_HEAD(&bus->children, dev, sibling);
104
    QLIST_INSERT_HEAD(&bus->children, dev, sibling);
105 105
    return dev;
106 106
}
107 107

  
......
235 235
#endif
236 236
    if (dev->info->reset)
237 237
        qemu_unregister_reset(dev->info->reset, dev);
238
    LIST_REMOVE(dev, sibling);
238
    QLIST_REMOVE(dev, sibling);
239 239
    qemu_free(dev);
240 240
}
241 241

  
......
321 321
{
322 322
    BusState *bus;
323 323

  
324
    LIST_FOREACH(bus, &dev->child_bus, sibling) {
324
    QLIST_FOREACH(bus, &dev->child_bus, sibling) {
325 325
        if (strcmp(name, bus->name) == 0) {
326 326
            return bus;
327 327
        }
......
346 346
        return bus;
347 347
    }
348 348

  
349
    LIST_FOREACH(dev, &bus->children, sibling) {
350
        LIST_FOREACH(child, &dev->child_bus, sibling) {
349
    QLIST_FOREACH(dev, &bus->children, sibling) {
350
        QLIST_FOREACH(child, &dev->child_bus, sibling) {
351 351
            ret = qbus_find_recursive(child, name, info);
352 352
            if (ret) {
353 353
                return ret;
......
365 365

  
366 366
    pos += snprintf(dest+pos, len-pos,"child busses at \"%s\":",
367 367
                    dev->id ? dev->id : dev->info->name);
368
    LIST_FOREACH(child, &dev->child_bus, sibling) {
368
    QLIST_FOREACH(child, &dev->child_bus, sibling) {
369 369
        pos += snprintf(dest+pos, len-pos, "%s\"%s\"", sep, child->name);
370 370
        sep = ", ";
371 371
    }
......
379 379

  
380 380
    pos += snprintf(dest+pos, len-pos, "devices at \"%s\":",
381 381
                    bus->name);
382
    LIST_FOREACH(dev, &bus->children, sibling) {
382
    QLIST_FOREACH(dev, &bus->children, sibling) {
383 383
        pos += snprintf(dest+pos, len-pos, "%s\"%s\"",
384 384
                        sep, dev->info->name);
385 385
        if (dev->id)
......
392 392
{
393 393
    BusState *child;
394 394

  
395
    LIST_FOREACH(child, &dev->child_bus, sibling) {
395
    QLIST_FOREACH(child, &dev->child_bus, sibling) {
396 396
        if (strcmp(child->name, elem) == 0) {
397 397
            return child;
398 398
        }
......
410 410
     *   (2) driver name
411 411
     *   (3) driver alias, if present
412 412
     */
413
    LIST_FOREACH(dev, &bus->children, sibling) {
413
    QLIST_FOREACH(dev, &bus->children, sibling) {
414 414
        if (dev->id  &&  strcmp(dev->id, elem) == 0) {
415 415
            return dev;
416 416
        }
417 417
    }
418
    LIST_FOREACH(dev, &bus->children, sibling) {
418
    QLIST_FOREACH(dev, &bus->children, sibling) {
419 419
        if (strcmp(dev->info->name, elem) == 0) {
420 420
            return dev;
421 421
        }
422 422
    }
423
    LIST_FOREACH(dev, &bus->children, sibling) {
423
    QLIST_FOREACH(dev, &bus->children, sibling) {
424 424
        if (dev->info->alias && strcmp(dev->info->alias, elem) == 0) {
425 425
            return dev;
426 426
        }
......
478 478
                qemu_error("device has no child bus (%s)\n", path);
479 479
                return NULL;
480 480
            case 1:
481
                return LIST_FIRST(&dev->child_bus);
481
                return QLIST_FIRST(&dev->child_bus);
482 482
            default:
483 483
                qbus_list_bus(dev, msg, sizeof(msg));
484 484
                qemu_error("device has multiple child busses (%s)\n%s\n",
......
532 532
        bus->name = buf;
533 533
    }
534 534

  
535
    LIST_INIT(&bus->children);
535
    QLIST_INIT(&bus->children);
536 536
    if (parent) {
537
        LIST_INSERT_HEAD(&parent->child_bus, bus, sibling);
537
        QLIST_INSERT_HEAD(&parent->child_bus, bus, sibling);
538 538
        parent->num_child_bus++;
539 539
    }
540 540
    return bus;
......
575 575
    qdev_print_props(mon, dev, dev->parent_bus->info->props, "bus", indent);
576 576
    if (dev->parent_bus->info->print_dev)
577 577
        dev->parent_bus->info->print_dev(mon, dev, indent);
578
    LIST_FOREACH(child, &dev->child_bus, sibling) {
578
    QLIST_FOREACH(child, &dev->child_bus, sibling) {
579 579
        qbus_print(mon, child, indent);
580 580
    }
581 581
}
......
587 587
    qdev_printf("bus: %s\n", bus->name);
588 588
    indent += 2;
589 589
    qdev_printf("type %s\n", bus->info->name);
590
    LIST_FOREACH(dev, &bus->children, sibling) {
590
    QLIST_FOREACH(dev, &bus->children, sibling) {
591 591
        qdev_print(mon, dev, indent);
592 592
    }
593 593
}

Also available in: Unified diff