Diff for /qemu/hw/qdev.c between versions 1.1.1.4 and 1.1.1.5

version 1.1.1.4, 2018/04/24 18:37:51 version 1.1.1.5, 2018/04/24 18:59:52
Line 106  static DeviceState *qdev_create_from_inf Line 106  static DeviceState *qdev_create_from_inf
    initialize the actual device emulation.  */     initialize the actual device emulation.  */
 DeviceState *qdev_create(BusState *bus, const char *name)  DeviceState *qdev_create(BusState *bus, const char *name)
 {  {
       DeviceState *dev;
   
       dev = qdev_try_create(bus, name);
       if (!dev) {
           hw_error("Unknown device '%s' for bus '%s'\n", name, bus->info->name);
       }
   
       return dev;
   }
   
   DeviceState *qdev_try_create(BusState *bus, const char *name)
   {
     DeviceInfo *info;      DeviceInfo *info;
   
     if (!bus) {      if (!bus) {
Line 114  DeviceState *qdev_create(BusState *bus,  Line 126  DeviceState *qdev_create(BusState *bus, 
   
     info = qdev_find_info(bus->info, name);      info = qdev_find_info(bus->info, name);
     if (!info) {      if (!info) {
         hw_error("Unknown device '%s' for bus '%s'\n", name, bus->info->name);          return NULL;
     }      }
   
     return qdev_create_from_info(bus, info);      return qdev_create_from_info(bus, info);
Line 346  int qdev_simple_unplug_cb(DeviceState *d Line 358  int qdev_simple_unplug_cb(DeviceState *d
     return 0;      return 0;
 }  }
   
 /* Like qdev_init(), but terminate program via hw_error() instead of  
   /* Like qdev_init(), but terminate program via error_report() instead of
    returning an error value.  This is okay during machine creation.     returning an error value.  This is okay during machine creation.
    Don't use for hotplug, because there callers need to recover from     Don't use for hotplug, because there callers need to recover from
    failure.  Exception: if you know the device's init() callback can't     failure.  Exception: if you know the device's init() callback can't
Line 358  void qdev_init_nofail(DeviceState *dev) Line 371  void qdev_init_nofail(DeviceState *dev)
     DeviceInfo *info = dev->info;      DeviceInfo *info = dev->info;
   
     if (qdev_init(dev) < 0) {      if (qdev_init(dev) < 0) {
         error_report("Initialization of device %s failed\n", info->name);          error_report("Initialization of device %s failed", info->name);
         exit(1);          exit(1);
     }      }
 }  }
Line 446  void qdev_connect_gpio_out(DeviceState * Line 459  void qdev_connect_gpio_out(DeviceState *
   
 void qdev_set_nic_properties(DeviceState *dev, NICInfo *nd)  void qdev_set_nic_properties(DeviceState *dev, NICInfo *nd)
 {  {
     qdev_prop_set_macaddr(dev, "mac", nd->macaddr);      qdev_prop_set_macaddr(dev, "mac", nd->macaddr.a);
     if (nd->vlan)      if (nd->vlan)
         qdev_prop_set_vlan(dev, "vlan", nd->vlan);          qdev_prop_set_vlan(dev, "vlan", nd->vlan);
     if (nd->netdev)      if (nd->netdev)
Line 455  void qdev_set_nic_properties(DeviceState Line 468  void qdev_set_nic_properties(DeviceState
         qdev_prop_exists(dev, "vectors")) {          qdev_prop_exists(dev, "vectors")) {
         qdev_prop_set_uint32(dev, "vectors", nd->nvectors);          qdev_prop_set_uint32(dev, "vectors", nd->nvectors);
     }      }
       nd->instantiated = 1;
 }  }
   
 BusState *qdev_get_child_bus(DeviceState *dev, const char *name)  BusState *qdev_get_child_bus(DeviceState *dev, const char *name)

Removed from v.1.1.1.4  
changed lines
  Added in v.1.1.1.5


unix.superglobalmegacorp.com