void do_acpitable_option(const QemuOpts *opts)
{
#ifdef TARGET_I386
- if (acpi_table_add(opts) < 0) {
- fprintf(stderr, "Wrong acpi table provided\n");
+ Error *err = NULL;
+
+ acpi_table_add(opts, &err);
+ if (err) {
+ fprintf(stderr, "Wrong acpi table provided: %s\n",
+ error_get_pretty(err));
+ error_free(err);
exit(1);
}
#endif
ACPI_TABLE_PFX_SIZE, acpi_payload_size);
}
-int acpi_table_add(const QemuOpts *opts)
+void acpi_table_add(const QemuOpts *opts, Error **errp)
{
AcpiTableOptions *hdrs = NULL;
Error *err = NULL;
qapi_dealloc_visitor_cleanup(dv);
}
- if (err) {
- fprintf(stderr, "%s\n", error_get_pretty(err));
- error_free(err);
- return -1;
- }
- return 0;
+ error_propagate(errp, err);
}
static void acpi_notify_wakeup(Notifier *notifier, void *data)
{
char *filename = NULL, *arg = NULL;
QemuOpts *opts;
+ Error *err = NULL;
if (acpi_tables != NULL) {
/* manually set via -acpitable, leave it alone */
opts = qemu_opts_parse(qemu_find_opts("acpi"), arg, 0);
g_assert(opts != NULL);
- if (acpi_table_add(opts) != 0) {
- fprintf(stderr, "WARNING: failed to load %s\n", filename);
+ acpi_table_add(opts, &err);
+ if (err) {
+ fprintf(stderr, "WARNING: failed to load %s: %s\n", filename,
+ error_get_pretty(err));
+ error_free(err);
}
g_free(arg);
g_free(filename);
extern size_t acpi_tables_len;
void acpi_bios_init(void);
-int acpi_table_add(const QemuOpts *opts);
+void acpi_table_add(const QemuOpts *opts, Error **errp);
/* acpi_piix.c */