q35: Check propery to determine if iommu is set
authorBandan Das <bsd@redhat.com>
Fri, 13 Nov 2015 06:55:47 +0000 (01:55 -0500)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 17 Nov 2015 13:41:13 +0000 (15:41 +0200)
The helper function machine_iommu() isn't necesary. We can
directly check for the property.

Signed-off-by: Bandan Das <bsd@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Bandan Das <bsd@redhat.com>
hw/core/machine.c
hw/pci-host/q35.c
include/hw/boards.h

index f4db340468f6156c396bf4ee314c8e8319040628..acca00db220e1554417a92a86d6ac7d47df1dd5d 100644 (file)
@@ -462,11 +462,6 @@ bool machine_usb(MachineState *machine)
     return machine->usb;
 }
 
-bool machine_iommu(MachineState *machine)
-{
-    return machine->iommu;
-}
-
 bool machine_kernel_irqchip_allowed(MachineState *machine)
 {
     return machine->kernel_irqchip_allowed;
index c81507d71098e801721f958302f94ad0c9eabcdf..1fb470758b6e22c804aa1f9db06213445879b9f0 100644 (file)
@@ -506,7 +506,7 @@ static void mch_realize(PCIDevice *d, Error **errp)
                  PAM_EXPAN_BASE + i * PAM_EXPAN_SIZE, PAM_EXPAN_SIZE);
     }
     /* Intel IOMMU (VT-d) */
-    if (machine_iommu(current_machine)) {
+    if (object_property_get_bool(qdev_get_machine(), "iommu", NULL)) {
         mch_init_dmar(mch);
     }
 }
index 3e9a92c0555d7eadd0d0bb89c63b4f12377b70e6..24eb6f0e770c7fd7e9a935b482be8fc380af100a 100644 (file)
@@ -33,7 +33,6 @@ MachineClass *find_default_machine(void);
 extern MachineState *current_machine;
 
 bool machine_usb(MachineState *machine);
-bool machine_iommu(MachineState *machine);
 bool machine_kernel_irqchip_allowed(MachineState *machine);
 bool machine_kernel_irqchip_required(MachineState *machine);
 int machine_kvm_shadow_mem(MachineState *machine);