render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
51d9a2
From b4c94ce2fb7d67af315c79a0f3ede70c36e85c70 Mon Sep 17 00:00:00 2001
51d9a2
Message-Id: <b4c94ce2fb7d67af315c79a0f3ede70c36e85c70@dist-git>
51d9a2
From: Erik Skultety <eskultet@redhat.com>
51d9a2
Date: Thu, 19 Jul 2018 15:03:50 +0200
51d9a2
Subject: [PATCH] qemu: address: Handle all the video devices within a single
51d9a2
 loop
51d9a2
MIME-Version: 1.0
51d9a2
Content-Type: text/plain; charset=UTF-8
51d9a2
Content-Transfer-Encoding: 8bit
51d9a2
51d9a2
Since 133fb140 moved the validation of a video device into a separate
51d9a2
function, the code handling PCI slot assignment for video devices has
51d9a2
been the same for both the primary device and the secondary devices.
51d9a2
Let's merge these and thus handle all the devices within the existing
51d9a2
'for' loop.
51d9a2
51d9a2
Signed-off-by: Erik Skultety <eskultet@redhat.com>
51d9a2
Reviewed-by: John Ferlan <jferlan@redhat.com>
51d9a2
(cherry picked from commit 3e90bd67a215adcb997b8c2be5d1d6b83251409f)
51d9a2
51d9a2
https://bugzilla.redhat.com/show_bug.cgi?id=1475770
51d9a2
Signed-off-by: Erik Skultety <eskultet@redhat.com>
51d9a2
Reviewed-by: Ján Tomko <jtomko@redhat.com>
51d9a2
---
51d9a2
 src/qemu/qemu_domain_address.c | 10 ++--------
51d9a2
 1 file changed, 2 insertions(+), 8 deletions(-)
51d9a2
51d9a2
diff --git a/src/qemu/qemu_domain_address.c b/src/qemu/qemu_domain_address.c
51d9a2
index e9f460d77a..ab2ac022f1 100644
51d9a2
--- a/src/qemu/qemu_domain_address.c
51d9a2
+++ b/src/qemu/qemu_domain_address.c
51d9a2
@@ -2103,15 +2103,9 @@ qemuDomainAssignDevicePCISlots(virDomainDefPtr def,
51d9a2
             goto error;
51d9a2
     }
51d9a2
 
51d9a2
-    /* Assign a PCI slot to the primary video card if there is not an
51d9a2
-     * assigned address. */
51d9a2
-    if (def->nvideos > 0 &&
51d9a2
-        virDeviceInfoPCIAddressWanted(&def->videos[0]->info)) {
51d9a2
-        if (qemuDomainPCIAddressReserveNextAddr(addrs, &def->videos[0]->info) < 0)
51d9a2
-            goto error;
51d9a2
-    }
51d9a2
+    /* Video devices */
51d9a2
+    for (i = 0; i < def->nvideos; i++) {
51d9a2
 
51d9a2
-    for (i = 1; i < def->nvideos; i++) {
51d9a2
         if (!virDeviceInfoPCIAddressWanted(&def->videos[i]->info))
51d9a2
             continue;
51d9a2
 
51d9a2
-- 
51d9a2
2.18.0
51d9a2