1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-25 01:34:11 +03:00

qemu: qemuBuildHostdevCommandLine: Use a helper variable mdevsrc

Decrease the number of accessors we have to use.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
Erik Skultety 2018-07-18 14:07:39 +02:00
parent 4dd6054000
commit 3b61f333ac

View File

@ -5424,7 +5424,9 @@ qemuBuildHostdevCommandLine(virCommandPtr cmd,
/* MDEV */
if (virHostdevIsMdevDevice(hostdev)) {
switch ((virMediatedDeviceModelType) subsys->u.mdev.model) {
virDomainHostdevSubsysMediatedDevPtr mdevsrc = &subsys->u.mdev;
switch ((virMediatedDeviceModelType) mdevsrc->model) {
case VIR_MDEV_MODEL_TYPE_VFIO_PCI:
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VFIO_PCI)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
@ -5432,6 +5434,7 @@ qemuBuildHostdevCommandLine(virCommandPtr cmd,
"supported by this version of QEMU"));
return -1;
}
break;
case VIR_MDEV_MODEL_TYPE_VFIO_CCW:
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VFIO_CCW)) {