[PATCH 11/12] qemu: domain: Don't set default USB model if qemuCaps is missing

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

 



qemuDomainControllerDefPostParse assigns the default USB controller
model when it was not specified by the user. Skip this step if @qemuCaps
is missing so that we don't fill wrong data. This will then be fixes by
re-running the post parse callback.
---
 src/qemu/qemu_domain.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 802dd9e39..e28b373a9 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -3438,9 +3438,10 @@ qemuDomainControllerDefPostParse(virDomainControllerDefPtr cont,
         break;

     case VIR_DOMAIN_CONTROLLER_TYPE_USB:
-        if (cont->model == -1) {
+        if (cont->model == -1 && qemuCaps) {
             /* Pick a suitable default model for the USB controller if none
-             * has been selected by the user.
+             * has been selected by the user and we have the qemuCaps for
+             * figuring out which contollers are supported.
              *
              * We rely on device availability instead of setting the model
              * unconditionally because, for some machine types, there's a
-- 
2.14.0

--
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]
  Powered by Linux