From 3c819a6ce8abb015137f2143613fde2e3af5bd5a Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Mon, 11 Oct 2021 16:37:56 +0200 Subject: [PATCH] qemuValidateDomainSmartcardDef: Move chardev validation under VIR_DOMAIN_SMARTCARD_TYPE_PASSTHROUGH MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Don't check the type twice, move the chardev validation into the switch. Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- 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; }