Revision e23a1b33 hw/qdev.c

b/hw/qdev.c
269 269
    return 0;
270 270
}
271 271

  
272
/* Like qdev_init(), but terminate program via hw_error() instead of
273
   returning an error value.  This is okay during machine creation.
274
   Don't use for hotplug, because there callers need to recover from
275
   failure.  Exception: if you know the device's init() callback can't
276
   fail, then qdev_init_nofail() can't fail either, and is therefore
277
   usable even then.  But relying on the device implementation that
278
   way is somewhat unclean, and best avoided.  */
279
void qdev_init_nofail(DeviceState *dev)
280
{
281
    DeviceInfo *info = dev->info;
282

  
283
    if (qdev_init(dev) < 0)
284
        hw_error("Initialization of device %s failed\n", info->name);
285
}
286

  
272 287
/* Unlink device from bus and free the structure.  */
273 288
void qdev_free(DeviceState *dev)
274 289
{

Also available in: Unified diff