qemuValidateDomainSmartcardDef: Move chardev validation under VIR_DOMAIN_SMARTCARD_TYPE_PASSTHROUGH

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

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2021-10-11 16:37:56 +02:00
parent d27edba370
commit 3c819a6ce8
1 changed files with 3 additions and 4 deletions

View File

@ -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;
}