[PATCH 04/14] qemuValidateDomainSmartcardDef: Move chardev validation under VIR_DOMAIN_SMARTCARD_TYPE_PASSTHROUGH

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

 



Don't check the type twice, move the chardev validation into the
switch.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_validate.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
index 5973f019d2..9865e29637 100644
--- a/src/qemu/qemu_validate.c
+++ b/src/qemu/qemu_validate.c
@@ -2112,6 +2112,9 @@ qemuValidateDomainSmartcardDef(const virDomainSmartcardDef *def,
                            _("this QEMU binary lacks smartcard passthrough mode support"));
             return -1;
         }
+
+        if (qemuValidateDomainChrSourceDef(def->data.passthru, qemuCaps) < 0)
+            return -1;
         break;

     default:
@@ -2119,10 +2122,6 @@ qemuValidateDomainSmartcardDef(const virDomainSmartcardDef *def,
         return -1;
     }

-    if (def->type == VIR_DOMAIN_SMARTCARD_TYPE_PASSTHROUGH &&
-        qemuValidateDomainChrSourceDef(def->data.passthru, qemuCaps) < 0)
-        return -1;
-
     return 0;
 }

-- 
2.31.1




[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