mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
conf: Drop needless setting of VIR_DOMAIN_TPM_VERSION_DEFAULT
In previous commit the VIR_DOMAIN_TPM_VERSION_DEFAULT value was made just an alias to value of 0. And since all newly allocated memory is zeroed out (due to use of g_new0()), the def->version inside of virDomainTPMDefParseXML() is also 0 and thus there is no need to set it explicitly. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
d5712c54a6
commit
598ffbdd41
@ -10414,15 +10414,12 @@ virDomainTPMDefParseXML(virDomainXMLOption *xmlopt,
|
||||
}
|
||||
|
||||
version = virXMLPropString(backends[0], "version");
|
||||
if (!version) {
|
||||
def->version = VIR_DOMAIN_TPM_VERSION_DEFAULT;
|
||||
} else {
|
||||
if ((def->version = virDomainTPMVersionTypeFromString(version)) <= 0) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("Unsupported TPM version '%s'"),
|
||||
version);
|
||||
goto error;
|
||||
}
|
||||
if (version &&
|
||||
(def->version = virDomainTPMVersionTypeFromString(version)) <= 0) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("Unsupported TPM version '%s'"),
|
||||
version);
|
||||
goto error;
|
||||
}
|
||||
|
||||
switch (def->type) {
|
||||
|
Loading…
Reference in New Issue
Block a user