Revision b4694b7c

b/hw/qdev.c
314 314
    return main_system_bus;
315 315
}
316 316

  
317
static int qbus_reset_one(BusState *bus, void *opaque)
318
{
319
    if (bus->info->reset) {
320
        return bus->info->reset(bus);
321
    }
322
    return 0;
323
}
324

  
317 325
void qbus_reset_all(BusState *bus)
318 326
{
319
    qbus_walk_children(bus, qdev_reset_one, NULL, NULL);
327
    qbus_walk_children(bus, qdev_reset_one, qbus_reset_one, NULL);
320 328
}
321 329

  
322 330
/* can be used as ->unplug() callback for the simple cases */
b/hw/qdev.h
49 49

  
50 50
typedef void (*bus_dev_printfn)(Monitor *mon, DeviceState *dev, int indent);
51 51
typedef char *(*bus_get_dev_path)(DeviceState *dev);
52
typedef int (qbus_resetfn)(BusState *bus);
52 53

  
53 54
struct BusInfo {
54 55
    const char *name;
55 56
    size_t size;
56 57
    bus_dev_printfn print_dev;
57 58
    bus_get_dev_path get_dev_path;
59
    qbus_resetfn *reset;
58 60
    Property *props;
59 61
};
60 62

  

Also available in: Unified diff