aboutsummaryrefslogtreecommitdiff
path: root/hw/i386
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2018-12-12 19:36:30 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2019-01-07 16:18:41 +0400
commitabd93cc7df8521d463c24b2106fdde4f40a3fdd5 (patch)
treee9f567fcd4a8cfc23a30fef148d4f5c6b3667a7e /hw/i386
parent638b47412b855867cffd291d16673f01f414882c (diff)
downloadqemu-abd93cc7df8521d463c24b2106fdde4f40a3fdd5.zip
qemu-abd93cc7df8521d463c24b2106fdde4f40a3fdd5.tar.gz
qemu-abd93cc7df8521d463c24b2106fdde4f40a3fdd5.tar.bz2
compat: replace PC_COMPAT_3_1 & HW_COMPAT_3_1 macros
Use static arrays instead. Suggested-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Acked-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'hw/i386')
-rw-r--r--hw/i386/pc.c9
-rw-r--r--hw/i386/pc_piix.c7
-rw-r--r--hw/i386/pc_q35.c7
3 files changed, 13 insertions, 10 deletions
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index f248662..33d09a8 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -109,6 +109,15 @@ static struct e820_entry *e820_table;
static unsigned e820_entries;
struct hpet_fw_config hpet_cfg = {.count = UINT8_MAX};
+GlobalProperty pc_compat_3_1[] = {
+ {
+ .driver = "intel-iommu",
+ .property = "dma-drain",
+ .value = "off",
+ },
+};
+const size_t pc_compat_3_1_len = G_N_ELEMENTS(pc_compat_3_1);
+
void gsi_handler(void *opaque, int n, int level)
{
GSIState *s = opaque;
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 2423428..c938437 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -440,14 +440,11 @@ DEFINE_I440FX_MACHINE(v4_0, "pc-i440fx-4.0", NULL,
static void pc_i440fx_3_1_machine_options(MachineClass *m)
{
- static GlobalProperty compat[] = {
- PC_COMPAT_3_1
- };
-
pc_i440fx_4_0_machine_options(m);
m->is_default = 0;
m->alias = NULL;
- compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat));
+ compat_props_add(m->compat_props, hw_compat_3_1, hw_compat_3_1_len);
+ compat_props_add(m->compat_props, pc_compat_3_1, pc_compat_3_1_len);
}
DEFINE_I440FX_MACHINE(v3_1, "pc-i440fx-3.1", NULL,
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index d846145..fad3d6d 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -323,14 +323,11 @@ DEFINE_Q35_MACHINE(v4_0, "pc-q35-4.0", NULL,
static void pc_q35_3_1_machine_options(MachineClass *m)
{
- static GlobalProperty compat[] = {
- PC_COMPAT_3_1
- };
-
pc_q35_4_0_machine_options(m);
m->default_kernel_irqchip_split = false;
m->alias = NULL;
- compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat));
+ compat_props_add(m->compat_props, hw_compat_3_1, hw_compat_3_1_len);
+ compat_props_add(m->compat_props, pc_compat_3_1, pc_compat_3_1_len);
}
DEFINE_Q35_MACHINE(v3_1, "pc-q35-3.1", NULL,