]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: domain: Don't set default USB model if qemuCaps is missing
authorPeter Krempa <pkrempa@redhat.com>
Wed, 16 Aug 2017 13:54:10 +0000 (15:54 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 18 Aug 2017 13:07:44 +0000 (15:07 +0200)
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

index 802dd9e39f342854fb884b930427332608f5d571..e28b373a95cbdae6ebb785dedc2c275183ed835f 100644 (file)
@@ -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