Revision 1ecda02b hw/qdev.c
b/hw/qdev.c | ||
---|---|---|
139 | 139 |
return 0; |
140 | 140 |
|
141 | 141 |
if (qdev_prop_parse(dev, name, value) == -1) { |
142 |
qemu_error("can't set property \"%s\" to \"%s\" for \"%s\"\n",
|
|
143 |
name, value, dev->info->name); |
|
142 |
error_report("can't set property \"%s\" to \"%s\" for \"%s\"",
|
|
143 |
name, value, dev->info->name);
|
|
144 | 144 |
return -1; |
145 | 145 |
} |
146 | 146 |
return 0; |
... | ... | |
184 | 184 |
|
185 | 185 |
driver = qemu_opt_get(opts, "driver"); |
186 | 186 |
if (!driver) { |
187 |
qemu_error("-device: no driver specified\n");
|
|
187 |
error_report("-device: no driver specified");
|
|
188 | 188 |
return NULL; |
189 | 189 |
} |
190 | 190 |
|
... | ... | |
195 | 195 |
return NULL; |
196 | 196 |
} |
197 | 197 |
if (info->no_user) { |
198 |
qemu_error("device \"%s\" can't be added via command line\n",
|
|
199 |
info->name); |
|
198 |
error_report("device \"%s\" can't be added via command line",
|
|
199 |
info->name);
|
|
200 | 200 |
return NULL; |
201 | 201 |
} |
202 | 202 |
|
... | ... | |
208 | 208 |
bus = qbus_find_recursive(main_system_bus, NULL, info->bus_info); |
209 | 209 |
} |
210 | 210 |
if (!bus) { |
211 |
qemu_error("Did not find %s bus for %s\n",
|
|
212 |
path ? path : info->bus_info->name, info->name); |
|
211 |
error_report("Did not find %s bus for %s",
|
|
212 |
path ? path : info->bus_info->name, info->name);
|
|
213 | 213 |
return NULL; |
214 | 214 |
} |
215 | 215 |
if (qdev_hotplug && !bus->allow_hotplug) { |
216 |
qemu_error("Bus %s does not support hotplugging\n",
|
|
217 |
bus->name); |
|
216 |
error_report("Bus %s does not support hotplugging",
|
|
217 |
bus->name);
|
|
218 | 218 |
return NULL; |
219 | 219 |
} |
220 | 220 |
|
... | ... | |
229 | 229 |
return NULL; |
230 | 230 |
} |
231 | 231 |
if (qdev_init(qdev) < 0) { |
232 |
qemu_error("Error initializing device %s\n", driver);
|
|
232 |
error_report("Error initializing device %s", driver);
|
|
233 | 233 |
return NULL; |
234 | 234 |
} |
235 | 235 |
qdev->opts = opts; |
... | ... | |
268 | 268 |
int qdev_unplug(DeviceState *dev) |
269 | 269 |
{ |
270 | 270 |
if (!dev->parent_bus->allow_hotplug) { |
271 |
qemu_error("Bus %s does not support hotplugging\n",
|
|
272 |
dev->parent_bus->name); |
|
271 |
error_report("Bus %s does not support hotplugging",
|
|
272 |
dev->parent_bus->name);
|
|
273 | 273 |
return -1; |
274 | 274 |
} |
275 | 275 |
assert(dev->info->unplug != NULL); |
... | ... | |
538 | 538 |
pos = 0; |
539 | 539 |
} else { |
540 | 540 |
if (sscanf(path, "%127[^/]%n", elem, &len) != 1) { |
541 |
qemu_error("path parse error (\"%s\")\n", path);
|
|
541 |
error_report("path parse error (\"%s\")", path);
|
|
542 | 542 |
return NULL; |
543 | 543 |
} |
544 | 544 |
bus = qbus_find_recursive(main_system_bus, elem, NULL); |
545 | 545 |
if (!bus) { |
546 |
qemu_error("bus \"%s\" not found\n", elem);
|
|
546 |
error_report("bus \"%s\" not found", elem);
|
|
547 | 547 |
return NULL; |
548 | 548 |
} |
549 | 549 |
pos = len; |
... | ... | |
557 | 557 |
|
558 | 558 |
/* find device */ |
559 | 559 |
if (sscanf(path+pos, "/%127[^/]%n", elem, &len) != 1) { |
560 |
qemu_error("path parse error (\"%s\" pos %d)\n", path, pos);
|
|
560 |
error_report("path parse error (\"%s\" pos %d)", path, pos);
|
|
561 | 561 |
return NULL; |
562 | 562 |
} |
563 | 563 |
pos += len; |
564 | 564 |
dev = qbus_find_dev(bus, elem); |
565 | 565 |
if (!dev) { |
566 |
qemu_error("device \"%s\" not found\n", elem);
|
|
566 |
error_report("device \"%s\" not found", elem);
|
|
567 | 567 |
qbus_list_dev(bus); |
568 | 568 |
return NULL; |
569 | 569 |
} |
... | ... | |
572 | 572 |
* one child bus accept it nevertheless */ |
573 | 573 |
switch (dev->num_child_bus) { |
574 | 574 |
case 0: |
575 |
qemu_error("device has no child bus (%s)\n", path);
|
|
575 |
error_report("device has no child bus (%s)", path);
|
|
576 | 576 |
return NULL; |
577 | 577 |
case 1: |
578 | 578 |
return QLIST_FIRST(&dev->child_bus); |
579 | 579 |
default: |
580 |
qemu_error("device has multiple child busses (%s)\n", path);
|
|
580 |
error_report("device has multiple child busses (%s)", path);
|
|
581 | 581 |
qbus_list_bus(dev); |
582 | 582 |
return NULL; |
583 | 583 |
} |
... | ... | |
585 | 585 |
|
586 | 586 |
/* find bus */ |
587 | 587 |
if (sscanf(path+pos, "/%127[^/]%n", elem, &len) != 1) { |
588 |
qemu_error("path parse error (\"%s\" pos %d)\n", path, pos);
|
|
588 |
error_report("path parse error (\"%s\" pos %d)", path, pos);
|
|
589 | 589 |
return NULL; |
590 | 590 |
} |
591 | 591 |
pos += len; |
592 | 592 |
bus = qbus_find_bus(dev, elem); |
593 | 593 |
if (!bus) { |
594 |
qemu_error("child bus \"%s\" not found\n", elem);
|
|
594 |
error_report("child bus \"%s\" not found", elem);
|
|
595 | 595 |
qbus_list_bus(dev); |
596 | 596 |
return NULL; |
597 | 597 |
} |
... | ... | |
749 | 749 |
|
750 | 750 |
dev = qdev_find_recursive(main_system_bus, id); |
751 | 751 |
if (NULL == dev) { |
752 |
qemu_error("Device '%s' not found\n", id);
|
|
752 |
error_report("Device '%s' not found", id);
|
|
753 | 753 |
return; |
754 | 754 |
} |
755 | 755 |
qdev_unplug(dev); |
Also available in: Unified diff