Omer Frenkel has submitted this change and it was merged. Change subject: backend: Add HostDev passthrough support #3 ......................................................................
backend: Add HostDev passthrough support #3 Added a new type of VmDevice for passthrough device -> VmHostDevice and related Add/Remove commands. One thing the commands need to handle is the IOMMU group restriction: The backend needs to make sure all device in given IOMMU group are either plugged or unplugged atomically. Otherwise libvirt will fail. To guarantee this we support bulk commands for Adding/Removing VmHostDevices that will compute the "closure" of affected devices -> devices that need to be either added or removed. After this the Add/Remove commad will apply the difference to get to desired state (e.g. some devices from group may already be attached/detached, we need to add/remove only the rest). To maintain consitency between configured VmHostDevices and actual HostDevices we run refresh host devices of UP hosts in InitBackendServicesOnStartupBean when engine restarts and in RefreshHostDevicesCommand we clear 'disappeard' host devices from Vms. To prevent conflicts when running multiple VMs with same configured host devices we introduced new LockingGroup.HOST_DEVICES. We are using this locking group to lock host id when we are accessing it's host devices from RunVmCommand, RefreshHostDevicesCommand, and ProcessDownVmCommand. Wiki: http://www.ovirt.org/Features/hostdev_passthrough Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1099760 Change-Id: I93c746cdda71678f7840d37683b890080a74341d Signed-off-by: Martin Betak <mbe...@redhat.com> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java A backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetExtendedHostDevicesByHostIdQuery.java A backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetExtendedVmHostDevicesByVmIdQuery.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetHostDeviceByHostIdAndDeviceNameQuery.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetHostDevicesByHostIdQuery.java A backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetVmHostDeviceByVmIdAndDeviceNameQuery.java A backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetVmHostDevicesQuery.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ProcessDownVmCommand.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommand.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmCommand.java A backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/hostdev/AbstractVmHostDevicesCommand.java A backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/hostdev/AddVmHostDevicesCommand.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/hostdev/HostDeviceManager.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/hostdev/RefreshHostDevicesCommand.java A backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/hostdev/RemoveVmHostDevicesCommand.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/AuditLogType.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/VdcActionType.java A backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/action/VmHostDevicesParameters.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/HostDevice.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmDeviceGeneralType.java A backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/VmHostDevice.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/locks/LockingGroup.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/VdcQueryType.java A backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/VmHostDeviceQueryParameters.java M backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties M backend/manager/modules/dal/src/main/resources/bundles/AuditLogMessages.properties M backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/lock/EngineLock.java M backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/CreateVDSCommand.java M backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilder.java M backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilderBase.java M backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmOldInfoBuilder.java M frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java M frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties A packaging/dbscripts/upgrade/03_06_1300_again_add_vm_host_device_commands.sql 35 files changed, 705 insertions(+), 54 deletions(-) Approvals: Martin Betak: Verified Omer Frenkel: Looks good to me, approved -- To view, visit https://gerrit.ovirt.org/37619 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I93c746cdda71678f7840d37683b890080a74341d Gerrit-PatchSet: 40 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Martin Betak <mbe...@redhat.com> Gerrit-Reviewer: Alona Kaplan <alkap...@redhat.com> Gerrit-Reviewer: Arik Hadas <aha...@redhat.com> Gerrit-Reviewer: Martin Betak <mbe...@redhat.com> Gerrit-Reviewer: Martin Beták <mato...@gmail.com> Gerrit-Reviewer: Martin Polednik <mpoled...@redhat.com> Gerrit-Reviewer: Moti Asayag <masa...@redhat.com> Gerrit-Reviewer: Omer Frenkel <ofren...@redhat.com> Gerrit-Reviewer: Shahar Havivi <shav...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches