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 QEMU binary lacks smartcard passthrough mode support"));
return -1;
}
+
+ if (qemuValidateDomainChrSourceDef(def->data.passthru, qemuCaps) < 0)
+ return -1;
break;
default:
return -1;
}
- if (def->type == VIR_DOMAIN_SMARTCARD_TYPE_PASSTHROUGH &&
- qemuValidateDomainChrSourceDef(def->data.passthru, qemuCaps) < 0)
- return -1;
-
return 0;
}