mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00: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:
parent
4dd6054000
commit
3b61f333ac
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user