qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 2/3] stubs: acpi_table_add() stub


From: Eduardo Habkost
Subject: [Qemu-devel] [PATCH 2/3] stubs: acpi_table_add() stub
Date: Tue, 17 Jan 2017 17:30:32 -0200

Create a stub to avoid an #ifdef in do_acpitable_option().

The stub should never be called because -acpitable is defined as
arch-specific in qemu-options.hx.

Signed-off-by: Eduardo Habkost <address@hidden>
---
 arch_init.c         | 2 --
 stubs/acpi.c        | 7 +++++++
 stubs/Makefile.objs | 1 +
 3 files changed, 8 insertions(+), 2 deletions(-)
 create mode 100644 stubs/acpi.c

diff --git a/arch_init.c b/arch_init.c
index 9647c8d337..0416d84211 100644
--- a/arch_init.c
+++ b/arch_init.c
@@ -237,7 +237,6 @@ void audio_init(void)
 
 void do_acpitable_option(const QemuOpts *opts)
 {
-#ifdef TARGET_I386
     Error *err = NULL;
 
     acpi_table_add(opts, &err);
@@ -245,7 +244,6 @@ void do_acpitable_option(const QemuOpts *opts)
         error_reportf_err(err, "Wrong acpi table provided: ");
         exit(1);
     }
-#endif
 }
 
 int kvm_available(void)
diff --git a/stubs/acpi.c b/stubs/acpi.c
new file mode 100644
index 0000000000..65ef2d7086
--- /dev/null
+++ b/stubs/acpi.c
@@ -0,0 +1,7 @@
+#include "qemu/osdep.h"
+#include "hw/acpi/acpi.h"
+
+void acpi_table_add(const QemuOpts *opts, Error **errp)
+{
+    abort(); /* must never be called */
+}
diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs
index 83ddcad3c3..18236935d5 100644
--- a/stubs/Makefile.objs
+++ b/stubs/Makefile.objs
@@ -51,3 +51,4 @@ stub-obj-y += ipmi.o
 stub-obj-y += pc_madt_cpu_entry.o
 stub-obj-y += migration-colo.o
 stub-obj-y += smbios.o
+stub-obj-y += acpi.o
-- 
2.11.0.259.g40922b1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]