mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-23 03:42:19 +00:00
domain_conf.c: move smartcard address check to domain_validate.c
This check is not tied to XML parsing and can be moved to virDomainSmartcardDefValidate(). Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
parent
4abfb330ea
commit
fee929dd20
@ -13227,13 +13227,6 @@ virDomainSmartcardDefParseXML(virDomainXMLOptionPtr xmlopt,
|
|||||||
if (virDomainDeviceInfoParseXML(xmlopt, node, &def->info, flags) < 0)
|
if (virDomainDeviceInfoParseXML(xmlopt, node, &def->info, flags) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (def->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE &&
|
|
||||||
def->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCID) {
|
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
|
||||||
_("Controllers must use the 'ccid' address type"));
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return g_steal_pointer(&def);
|
return g_steal_pointer(&def);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -484,6 +484,13 @@ int
|
|||||||
virDomainSmartcardDefValidate(const virDomainSmartcardDef *smartcard,
|
virDomainSmartcardDefValidate(const virDomainSmartcardDef *smartcard,
|
||||||
const virDomainDef *def)
|
const virDomainDef *def)
|
||||||
{
|
{
|
||||||
|
if (smartcard->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE &&
|
||||||
|
smartcard->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCID) {
|
||||||
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
_("Controllers must use the 'ccid' address type"));
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (smartcard->type == VIR_DOMAIN_SMARTCARD_TYPE_PASSTHROUGH)
|
if (smartcard->type == VIR_DOMAIN_SMARTCARD_TYPE_PASSTHROUGH)
|
||||||
return virDomainChrSourceDefValidate(smartcard->data.passthru, NULL, def);
|
return virDomainChrSourceDefValidate(smartcard->data.passthru, NULL, def);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user