]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: pass the virDomainDef to qemuDomainChrDefValidate
authorPino Toscano <ptoscano@redhat.com>
Thu, 7 Sep 2017 12:19:38 +0000 (14:19 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 21 Sep 2017 11:05:14 +0000 (13:05 +0200)
This will be used to improve the validation for this type of devices.

The former @def parameter is renamed to @dev, leaving @def for the
virDomainDef (following the style used elsewhere).

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
src/qemu/qemu_domain.c

index 50b536eec7b1d8e12c83eceef94ace0a61d968d7..c9522e870e5e2a6989c426448e86209ad9f12b43 100644 (file)
@@ -3291,9 +3291,10 @@ qemuDomainChrSourceDefValidate(const virDomainChrSourceDef *def)
 
 
 static int
-qemuDomainChrDefValidate(const virDomainChrDef *def)
+qemuDomainChrDefValidate(const virDomainChrDef *dev,
+                         const virDomainDef *def ATTRIBUTE_UNUSED)
 {
-    if (qemuDomainChrSourceDefValidate(def->source) < 0)
+    if (qemuDomainChrSourceDefValidate(dev->source) < 0)
         return -1;
 
     return 0;
@@ -3334,7 +3335,7 @@ qemuDomainRedirdevDefValidate(const virDomainRedirdevDef *def)
 
 static int
 qemuDomainDeviceDefValidate(const virDomainDeviceDef *dev,
-                            const virDomainDef *def ATTRIBUTE_UNUSED,
+                            const virDomainDef *def,
                             void *opaque ATTRIBUTE_UNUSED)
 {
     int ret = -1;
@@ -3429,7 +3430,7 @@ qemuDomainDeviceDefValidate(const virDomainDeviceDef *dev,
             goto cleanup;
         }
     } else if (dev->type == VIR_DOMAIN_DEVICE_CHR) {
-        if (qemuDomainChrDefValidate(dev->data.chr) < 0)
+        if (qemuDomainChrDefValidate(dev->data.chr, def) < 0)
             goto cleanup;
     } else if (dev->type == VIR_DOMAIN_DEVICE_SMARTCARD) {
         if (qemuDomainSmartcardDefValidate(dev->data.smartcard) < 0)