[PATCH 3/5] qemu: pass the virDomainDef to qemuDomainChrDefValidate

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

 



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@xxxxxxxxxx>
---
 src/qemu/qemu_domain.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 72031893f..0b8a66307 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -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;
@@ -3378,7 +3379,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)
-- 
2.13.5

--
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