]> xenbits.xensource.com Git - libvirt.git/commitdiff
virDomainDeviceInfoIterateInternal: Iterate through redirdevs too
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 9 Jun 2016 08:41:13 +0000 (10:41 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 17 Jun 2016 16:12:43 +0000 (18:12 +0200)
This is going to be important later when we received
DEVICE_DELETED event on the qemu monitor. If we do,
virDomainDefFindDevice() is called to find the device for given
device alias in the virDomainDef tree. When we enable removal for
redirdevs we need to include them in the lookup process too.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/conf/domain_conf.c

index 0a641b0b7c9b21daf15da4400fd77b9d584dfefd..4196537324dd9be3c0e4754739e211d24495f2cf 100644 (file)
@@ -3509,6 +3509,13 @@ virDomainDeviceInfoIterateInternal(virDomainDefPtr def,
             return -1;
     }
 
+    device.type = VIR_DOMAIN_DEVICE_REDIRDEV;
+    for (i = 0; i < def->nredirdevs; i++) {
+        device.data.redirdev = def->redirdevs[i];
+        if (cb(def, &device, &def->redirdevs[i]->info, opaque) < 0)
+            return -1;
+    }
+
     /* Coverity is not very happy with this - all dead_error_condition */
 #if !STATIC_ANALYSIS
     /* This switch statement is here to trigger compiler warning when adding