[PATCH] Reserve first 3 PCI slots for hardcoded devices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If a domain is initially created without a <vidoe> device but with other
devices (like <interface>), PCI device slots normally reserved for
hardcoded devices (host bridge, IDE controller, video) get assigned to
these. If than later on a <video> device is added without removing the
already assigned <addresse>s, the re-definition fails in
qemuAssignDevicePCISlots() with the error message "Primary video card
must have PCI address 0:0:2.0"

To simplify editing existing domains just reserve the first three slots
for internal usage by setting qemuDomainPCIAddressSet.nextslot = 3.

Signed-off-by: Philipp Hahn <hahn@xxxxxxxxxxxxx>
---
 src/qemu/qemu_command.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index c63de09..c359fd0 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -733,6 +733,9 @@ qemuDomainAssignPCIAddresses(virDomainDefPtr def)
         if (!(addrs = qemuDomainPCIAddressSetCreate(def)))
             goto cleanup;
 
+        /* reserve first 3 slots for hardcoded devices */
+        addrs->nextslot = 3;
+
         if (qemuAssignDevicePCISlots(def, addrs) < 0)
             goto cleanup;
     }
-- 
1.7.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]