[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/8] machine: query iommu machine property rather th
From: |
Marcel Apfelbaum |
Subject: |
[Qemu-devel] [PATCH 1/8] machine: query iommu machine property rather than qemu opts |
Date: |
Wed, 4 Feb 2015 17:43:48 +0200 |
Fixes a QEMU crash when passing iommu parameter in command line.
Signed-off-by: Marcel Apfelbaum <address@hidden>
---
hw/core/machine.c | 5 +++++
hw/pci-host/q35.c | 2 +-
include/hw/boards.h | 1 +
3 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/hw/core/machine.c b/hw/core/machine.c
index fbd91be..096eb10 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -403,6 +403,11 @@ bool machine_usb(MachineState *machine)
return machine->usb;
}
+bool machine_iommu(MachineState *machine)
+{
+ return machine->iommu;
+}
+
static const TypeInfo machine_info = {
.name = TYPE_MACHINE,
.parent = TYPE_OBJECT,
diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c
index b20bad8..dfd8bbf 100644
--- a/hw/pci-host/q35.c
+++ b/hw/pci-host/q35.c
@@ -415,7 +415,7 @@ static int mch_init(PCIDevice *d)
PAM_EXPAN_BASE + i * PAM_EXPAN_SIZE, PAM_EXPAN_SIZE);
}
/* Intel IOMMU (VT-d) */
- if (qemu_opt_get_bool(qemu_get_machine_opts(), "iommu", false)) {
+ if (machine_iommu(current_machine)) {
mch_init_dmar(mch);
}
return 0;
diff --git a/include/hw/boards.h b/include/hw/boards.h
index 3ddc449..a12f041 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -66,6 +66,7 @@ MachineClass *find_default_machine(void);
extern MachineState *current_machine;
bool machine_usb(MachineState *machine);
+bool machine_iommu(MachineState *machine);
/**
* MachineClass:
--
2.1.0
- [Qemu-devel] [PATCH 0/8] machine: query machine properties rather than qemu opts, Marcel Apfelbaum, 2015/02/04
- [Qemu-devel] [PATCH 1/8] machine: query iommu machine property rather than qemu opts,
Marcel Apfelbaum <=
- [Qemu-devel] [PATCH 3/8] machine: query kernel-irqchip machine property rather than qemu opts, Marcel Apfelbaum, 2015/02/04
- [Qemu-devel] [PATCH 6/8] machine: query phandle-start machine property rather than qemu opts, Marcel Apfelbaum, 2015/02/04
- [Qemu-devel] [PATCH 7/8] machine: query dump-guest-core machine property rather than qemu opts, Marcel Apfelbaum, 2015/02/04
- [Qemu-devel] [PATCH 5/8] machine: query kvm-shadow-mem machine property rather than qemu opts, Marcel Apfelbaum, 2015/02/04
- Re: [Qemu-devel] [PATCH 0/8] machine: query machine properties rather than qemu opts, Paolo Bonzini, 2015/02/04
- [Qemu-devel] [PATCH 2/8] hw/machine: kernel-irqchip property support for allowed/required, Marcel Apfelbaum, 2015/02/04
- [Qemu-devel] [PATCH 4/8] kvm: add machine state to kvm_arch_init, Marcel Apfelbaum, 2015/02/04