mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 15:15:25 +00:00
qemu: address: Handle all the video devices within a single loop
Since 133fb140
moved the validation of a video device into a separate
function, the code handling PCI slot assignment for video devices has
been the same for both the primary device and the secondary devices.
Let's merge these and thus handle all the devices within the existing
'for' loop.
Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
ff767f083f
commit
3e90bd67a2
@ -2081,15 +2081,9 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Assign a PCI slot to the primary video card if there is not an
|
/* Video devices */
|
||||||
* assigned address. */
|
for (i = 0; i < def->nvideos; i++) {
|
||||||
if (def->nvideos > 0 &&
|
|
||||||
virDeviceInfoPCIAddressWanted(&def->videos[0]->info)) {
|
|
||||||
if (qemuDomainPCIAddressReserveNextAddr(addrs, &def->videos[0]->info) < 0)
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 1; i < def->nvideos; i++) {
|
|
||||||
if (!virDeviceInfoPCIAddressWanted(&def->videos[i]->info))
|
if (!virDeviceInfoPCIAddressWanted(&def->videos[i]->info))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user